From 2e87f72bf4f5ebc2ca66443598f0ec0351765ddb Mon Sep 17 00:00:00 2001 From: Tobias Jungel Date: Tue, 17 Apr 2018 12:54:14 +0200 Subject: neigh: add get/set functions for NEIGH_ATTR_MASTER Beeing able to set NEIGH_ATTR_MASTER hash based lookups are possible for AF_BRIDGE neighbours. https://github.com/thom311/libnl/pull/189 --- include/netlink/route/neighbour.h | 3 +++ lib/route/neigh.c | 10 ++++++++++ libnl-route-3.sym | 2 ++ 3 files changed, 15 insertions(+) diff --git a/include/netlink/route/neighbour.h b/include/netlink/route/neighbour.h index 6ea4753..0f17b66 100644 --- a/include/netlink/route/neighbour.h +++ b/include/netlink/route/neighbour.h @@ -82,6 +82,9 @@ extern int rtnl_neigh_get_family(struct rtnl_neigh *); extern void rtnl_neigh_set_vlan(struct rtnl_neigh *, int); extern int rtnl_neigh_get_vlan(struct rtnl_neigh *); +extern void rtnl_neigh_set_master(struct rtnl_neigh *, int); +extern int rtnl_neigh_get_master(struct rtnl_neigh *); + #ifdef __cplusplus } #endif diff --git a/lib/route/neigh.c b/lib/route/neigh.c index 184a0c4..faad1d4 100644 --- a/lib/route/neigh.c +++ b/lib/route/neigh.c @@ -1048,6 +1048,16 @@ int rtnl_neigh_get_vlan(struct rtnl_neigh *neigh) return -1; } +void rtnl_neigh_set_master(struct rtnl_neigh *neigh, int ifindex) +{ + neigh->n_master = ifindex; + neigh->ce_mask |= NEIGH_ATTR_MASTER; +} + +int rtnl_neigh_get_master(struct rtnl_neigh *neigh) { + return neigh->n_master; +} + /** @} */ static struct nl_object_ops neigh_obj_ops = { diff --git a/libnl-route-3.sym b/libnl-route-3.sym index f6a55b0..159a3fd 100644 --- a/libnl-route-3.sym +++ b/libnl-route-3.sym @@ -1106,4 +1106,6 @@ global: rtnl_mall_get_first_action; rtnl_mall_del_action; rtnl_neigh_get_by_vlan; + rtnl_neigh_get_master; + rtnl_neigh_set_master; } libnl_3_4; -- cgit v0.12