nl_addr_parse handling of 'default', 'any', and 'all'

Justin Mayfield jmayfield at cradlepoint.com
Fri Aug 17 20:16:44 EDT 2012


Hi,

I found a small bug in the nl_addr_parse function when being passed the 
strings "default", "any", or "all".  Currently nl_addr_parse will create 
a zeroed nl_addr with a length corresponding to the family/hint or 
AF_INET if omitted.  This behavior when used in conjunction with the 
libnl-route library to add default routes to the system has the side 
effect of creating a route to the host address 0.0.0.0/32.

Attached is a patch that matches the iproute2 behavior more closely 
where we do set the family but the length of the nl_addr is set to 0.

Cheers,
Justin Mayfield
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libnl_addr_create_fix.patch
Type: text/x-patch
Size: 656 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20120817/f8de2447/attachment.bin>


More information about the libnl mailing list