diff --git a/core/net/uiplib.c b/core/net/uiplib.c index 630385373..29db1f629 100644 --- a/core/net/uiplib.c +++ b/core/net/uiplib.c @@ -53,15 +53,17 @@ uiplib_ipaddrconv(const char *addrstr, uip_ipaddr_t *ipaddr) value = 0; zero = -1; + if(*addrstr == '[') addrstr++; + for(len = 0; len < sizeof(uip_ipaddr_t) - 1; addrstr++) { c = *addrstr; - if(c == ':' || c == '\0') { + if(c == ':' || c == '\0' || c == ']') { ipaddr->u8[len] = (value >> 8) & 0xff; ipaddr->u8[len + 1] = value & 0xff; len += 2; value = 0; - if(c == '\0') { + if(c == '\0' || c == ']') { break; } diff --git a/examples/ipv6/sky-websense/websense-remote.c b/examples/ipv6/sky-websense/websense-remote.c index aad3022f7..a30da909f 100644 --- a/examples/ipv6/sky-websense/websense-remote.c +++ b/examples/ipv6/sky-websense/websense-remote.c @@ -46,13 +46,13 @@ #include /* The address of the server to register the services for this node */ -#define SERVER "aaaa::1" +#define SERVER "[aaaa::1]" /* This command registers two services (/0 and /1) to turn the leds on or off */ #define REGISTER_COMMAND "/r?p=0&d=Turn%20off%20leds&p=1&d=Turn%20on%20leds" /* The address of the other node to control */ -#define OTHER_NODE "aaaa::212:7403:3:303" +#define OTHER_NODE "[aaaa::1]" /* The commands to send to the other node */ #define SET_LEDS_ON "/1"