Hi all,

 
this is concerning the ubox package. If there is a more specific mailing 
list/issue tracker for this, please tell me so.

 

We have found that the during validation of an NTP server in [1], the 
validation as “host” fails if the “host” is a link-local IPv6 address.

 

If you track the issue through the various wrappers, it narrows down to

inet_pton(AF_INET6, s->value, &a);

in [2].

 

Eventually, the problem is inet_pton not understanding the scope ID present in 
a link-local IPv6 address.

 

From googling how to address this, a possible solution would be a switch to 
getaddrinfo [3].

Another (less desirable) solution would be to just split at the % and then only 
validate the left part; however, I cannot judge whether this is easy to do in C.

 

Since I’m not very confident about my C capabilities and I did not find a way 
to build the ubox package separately (for testing), I hope someone is 
interested in having a look into this.

 

Best

 

Adrian

 

 

[1] 
https://github.com/openwrt/openwrt/blob/master/package/utils/busybox/files/sysntpd#L31

[2] 
https://git.openwrt.org/?p=project/ubox.git;a=blob;f=validate/validate.c;h=e72b8117ecd8b680778b0f5c7637ed6546a7736b;hb=876c7f5bfb9b13d48e6d7960dd114082a0a95a6d#l398

[3] http://man7.org/linux/man-pages/man3/getaddrinfo.3.html

 

Attachment: pgpcnbWkMH7As.pgp
Description: PGP signature

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to