!1029 Fix : 打开 LWIP_IPV6 时会有编译错误
Merge pull request !1029 from yinjiaming/fix
This commit is contained in:
commit
17309e232a
|
@ -125,7 +125,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
|
||||||
int squash_pos = ipv6_blocks;
|
int squash_pos = ipv6_blocks;
|
||||||
int i;
|
int i;
|
||||||
const unsigned char *sc = (const unsigned char *)cp;
|
const unsigned char *sc = (const unsigned char *)cp;
|
||||||
const char *ss = cp-1;
|
const unsigned char *ss = (const unsigned char *)(cp - 1);
|
||||||
|
|
||||||
for (; ; sc++) {
|
for (; ; sc++) {
|
||||||
if (current_block_index >= ipv6_blocks) {
|
if (current_block_index >= ipv6_blocks) {
|
||||||
|
@ -142,7 +142,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
|
||||||
break;
|
break;
|
||||||
} else if (*sc == ':') {
|
} else if (*sc == ':') {
|
||||||
if (sc - ss == 1) {
|
if (sc - ss == 1) {
|
||||||
if (sc != cp || sc[1] != ':') {
|
if (sc != (const unsigned char *)cp || sc[1] != ':') {
|
||||||
return 0; // address begins with a single ':' or contains ":::"
|
return 0; // address begins with a single ':' or contains ":::"
|
||||||
} // else address begins with one valid "::"
|
} // else address begins with one valid "::"
|
||||||
} else {
|
} else {
|
||||||
|
@ -163,7 +163,7 @@ int ip6addr_aton(const char *cp, ip6_addr_t *addr)
|
||||||
#if LWIP_IPV4
|
#if LWIP_IPV4
|
||||||
} else if (*sc == '.' && current_block_index < ipv6_blocks - 1) {
|
} else if (*sc == '.' && current_block_index < ipv6_blocks - 1) {
|
||||||
ip4_addr_t ip4;
|
ip4_addr_t ip4;
|
||||||
int ret = ip4addr_aton(ss+1, &ip4);
|
int ret = ip4addr_aton((const char *)(ss + 1), &ip4);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue