[RFC PATCH 3/5] Add AF_BRIDGE object update support to link cache

Thomas Graf tgraf at suug.ch
Mon Nov 5 10:06:11 EST 2012


On 11/05/12 at 05:37am, roopa at cumulusnetworks.com wrote:
> From: roopa <roopa at cumulusnetworks.com>
> 
> This patch implements the oo_update operation for link cache objects.
> This implementation currently only handles objects of type AF_BRIDGE.
> 
> It updates the existing link object with the attributes of the new
> AF_BRIDGE link object
> 
> Signed-off-by: Roopa Prabhu <roopa at cumulusnetworks.com>
> Reviewed-by: Nolan Leake <nolan at cumulusnetworks.com>
> Reviewed-by: Shrijeet Mukherjee <shm at cumulusnetworks.com>
> Reviewed-by: Wilson Kok <wkok at cumulusnetworks.com>

I think this code should be in lib/route/link/bridge.c if it is
AF_BRIDGE specific. I realize the filter is currently in link.c
as well but that has always been a hack.

What about you have a link_update() that does:

af_ops = rtnl_link_af_ops_lookup(src->l_family);
if (af_ops && af_ops->ao_update)
	return af_ops->ao_update(...);
else
	return -NLE_OPNOTSUPP;

That would allow to neatly move this to bridge.c and allow for a
simplified update process. I guess you wouldn't even have to
free and realloc the bridge data but could just overwrite the port
state and link attributes.



More information about the libnl mailing list