Question regarding rtnl_link objects and address family.

Bushman, Jeff JBushman at ciena.com
Fri Feb 24 13:43:57 EST 2012


I just started using libnl and am quite impressed. I've found a few small bugs that I'll post patches for in the near future.

My dilemma is how to handle the different types of RTM_NEWLINK messages for the different address families.

I create an nl_cache_mgr, and then call nl_cache_mngr_add() for "route/link". This works great, until I do something that causes a change to the IPv6 configuration. Then I get an RTM_NEWLINK message for family PF_INET with completely different attributes. This messages replaces the one in the cache, discarding useful information in the PF_UNSPEC family message that was in the cache.

I'd like to maintain the messages from both families. Do I need to set up a separate cache structure and code for the AF_INET6 family messages? I see that the cache functionality has some support for this with the nl_cache.c_iarg1 attribute. But it doesn't appear that there's any way to de-multiplex incoming messages based on family. I also couldn't find a way to just 'get' and 'set' protocol-family specific link message from the kernel.

Am I missing something, or doing things the wrong way? I'd be happy to make changes to the library that continued the existing design philosophy.

Jeff

Jeffrey M. Bushman | Software Engineer 4
jbushman at ciena.com<mailto:jbushman at ciena.com> | 1185 Sanctuary Pkwy, Ste 300 | Alpharetta, GA 30009 USA
Direct +1.678.867.3572 | Fax +1.678.867.5101

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20120224/a4d97da9/attachment.html>


More information about the libnl mailing list