diff --git a/core/net/uiplib.c b/core/net/uiplib.c index 0bf35b039..7ca55bb36 100644 --- a/core/net/uiplib.c +++ b/core/net/uiplib.c @@ -57,13 +57,13 @@ uiplib_ipaddrconv(const char *addrstr, uip_ipaddr_t *ipaddr) for(len = 0; len < sizeof(uip_ipaddr_t) - 1; addrstr++) { c = *addrstr; - if(c == ':' || c == '\0' || c == ']') { + if(c == ':' || c == '\0' || c == ']' || c == '/') { ipaddr->u8[len] = (value >> 8) & 0xff; ipaddr->u8[len + 1] = value & 0xff; len += 2; value = 0; - if(c == '\0' || c == ']') { + if(c == '\0' || c == ']' || c == '/') { break; } @@ -88,7 +88,7 @@ uiplib_ipaddrconv(const char *addrstr, uip_ipaddr_t *ipaddr) value = (value << 4) + (tmp & 0xf); } } - if(c != '\0' && c != ']') { + if(c != '\0' && c != ']' && c != '/') { PRINTF("uiplib: too large address\n"); return 0; }