[RFC] Appending Bridge entries to RTM_SETLINK messages

Thomas Haller thaller at redhat.com
Thu Aug 25 09:14:23 PDT 2016


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20160825/df8bef4f/attachment.sig>


More information about the libnl mailing list