[PATCH v2 2/2] Add master support to rtnl_neigh for AF_BRIDGE objects
Thomas Graf
tgraf at suug.ch
Thu Nov 15 09:44:03 EST 2012
On 11/14/12 at 11:33am, roopa at cumulusnetworks.com wrote:
> + /*
> + * Get the bridge index for AF_BRIDGE family entries
> + */
> + if (neigh->n_family == AF_BRIDGE) {
> + struct nl_cache *lcache = nl_cache_mngt_require("route/link");
> + if (lcache ) {
> + struct rtnl_link *link = rtnl_link_get(lcache,
> + neigh->n_ifindex);
> + if (link) {
> + neigh->n_master = link->l_master;
> + rtnl_link_put(link);
> + neigh->ce_mask |= NEIGH_ATTR_MASTER;
> + }
> + }
> + }
> +
So what if no link cache has been made available? n_master will always
be 0 and we can't uniquely identify AF_BRIDGE cache entries, right?
More information about the libnl
mailing list