diff options
author | Tobias Jungel <tobias.jungel@bisdn.de> | 2018-04-17 10:54:14 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-06-25 12:27:50 (GMT) |
commit | 2e87f72bf4f5ebc2ca66443598f0ec0351765ddb (patch) | |
tree | f2122c2a1056fbeb8967387a26c3c8c31db1e9a2 | |
parent | ad7c49e77bd6734f220872c70164d8fabdabdfcd (diff) | |
download | libnl-2e87f72bf4f5ebc2ca66443598f0ec0351765ddb.zip libnl-2e87f72bf4f5ebc2ca66443598f0ec0351765ddb.tar.gz libnl-2e87f72bf4f5ebc2ca66443598f0ec0351765ddb.tar.bz2 |
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
-rw-r--r-- | include/netlink/route/neighbour.h | 3 | ||||
-rw-r--r-- | lib/route/neigh.c | 10 | ||||
-rw-r--r-- | libnl-route-3.sym | 2 |
3 files changed, 15 insertions, 0 deletions
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; |