[RFC] Appending Bridge entries to RTM_SETLINK messages

Oliver, Jef jef.oliver at intel.com
Fri Aug 26 16:58:37 PDT 2016


> -----Original Message-----
> From: Thomas Haller [mailto:thaller at redhat.com]
> Sent: Thursday, August 25, 2016 9:14 AM
> To: Oliver, Jef <jef.oliver at intel.com>; libnl at lists.infradead.org
> Subject: Re: [RFC] Appending Bridge entries to RTM_SETLINK messages
> 
> On Thu, 2016-08-25 at 00:48 +0000, Oliver, Jef wrote:
> > I am working on enabling libnl to set the entries for a bridge link in
> > RTM_SETLINK messages sent to the kernel. I think I am following the
> > code flow intended for the project.
> >
> > However, when using a test program to set supported entries, the
> > changes are not reflecting. Am I appending at the correct area? In the
> > correct way?
> > I'm using iproute2 code as a guide for this. I did notice that
> > iproute2 is setting RTM_SETLINK as the nlmsg_type rather than
> > RTM_NEWLINK, but libnl seems to account for this in messages already
> > by switching the type on failure.
> >
> > Patch work located here.
> > https://github.com/jeagoss/libnl/tree/bridging
> >
> https://github.com/jeagoss/libnl/commit/501dee04dbd69090b2864ea45340a
> > d2d5da42902
> >
> 
> hi Oliver,
> 
> 
> I am not familiar with this, but in iproute2 it seems that NLA_F_NESTED
> matters, see
> 
> https://git.kernel.org/cgit/linux/kernel/git/shemminger/iproute2.git/tr
> ee/bridge/link.c?id=06be01f75def7be137640ca82ee64a4e233cd3a6#n369
> 
> same when grepping the kernel sources (net/bridge/br_netlink.c).
> 
> 
> how about
>   if (!(pi_attr = nla_nest_start(msg, IFLA_PROTINFO | NLA_F_NESTED)))
> 
> 
> Thomas

This was a combination of things. NLA_F_NESTED did indeed help. However, extra functionality was needed.

Patchset incoming after breakup and cleanup.

Jef


More information about the libnl mailing list