Problem adding a new route

Dan Williams dcbw at redhat.com
Mon Aug 18 08:05:36 PDT 2014


On Fri, 2014-08-08 at 17:19 +0200, Cedric Bosdonnat wrote:
> Hi all,
> 
> I'm trying to netlinkify libvirt a bit more... and I'm having a problem
> with the route adding function.
> 
> The code is here:
> https://github.com/cbosdo/libvirt/commit/b661e278c3dbbff84c9424b4ce56976153c18297
> 
> Starting a container with a gateway seems to add it as I can see it
> in /proc/net/route and with the route tool. However the route doesn't
> work and 'ip route' doesn't list it.
> 
> Is there anything obvious I have forgotten? I'm not using the
> libnl-route, only libnl since I guess we'll have platforms with old
> versions of libnl.
> 
> Thanks for the help,

I can't see anything immediately wrong, about all I can suggest is to
dump the message you're creating with libnl and see what it looks like,
then modify /sbin/ip to dump it's messages and run the command with it,
and compare the two.  What I've found is that the kernel often wants a
very specific message, and if you don't build that up correctly it'll
either reject it or do the wrong thing.

Dan




More information about the libnl mailing list