summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTobias Jungel <tobias.jungel@bisdn.de>2018-04-06 09:40:27 +0200
committerThomas Haller <thaller@redhat.com>2018-04-06 19:51:22 +0200
commit3c96f6513c621ddf229761210c71ab66fcf9ffb7 (patch)
treedb8d0b87e4acc22b46dd2268c4d6566f93b649c0 /lib
parentd1bd68d1009601ee4e4217fbad9ad9c33a940a50 (diff)
downloadlibnl-3c96f6513c621ddf229761210c71ab66fcf9ffb7.tar.gz
neigh: support bridge entries for vxlan interfaces
bridge entries used for switching into vxlan interfaces do not include a vlan. A comparison of such entires currently always fails which leads to an invalid cache. This patch selectively adds the NEIGH_ATTR_VLAN flag based on the passed entry. https://github.com/thom311/libnl/pull/182
Diffstat (limited to 'lib')
-rw-r--r--lib/route/neigh.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/route/neigh.c b/lib/route/neigh.c
index 824cf492..dc321a8f 100644
--- a/lib/route/neigh.c
+++ b/lib/route/neigh.c
@@ -319,11 +319,13 @@ static uint32_t neigh_id_attrs_get(struct nl_object *obj)
if (neigh->n_family == AF_BRIDGE) {
if (neigh->n_flags & NTF_SELF)
- return (NEIGH_ATTR_LLADDR | NEIGH_ATTR_FAMILY | NEIGH_ATTR_IFINDEX | NEIGH_ATTR_VLAN);
+ return (NEIGH_ATTR_LLADDR | NEIGH_ATTR_FAMILY | NEIGH_ATTR_IFINDEX |
+ ((neigh->ce_mask & NEIGH_ATTR_DST) ? NEIGH_ATTR_DST: 0) |
+ ((neigh->ce_mask & NEIGH_ATTR_VLAN) ? NEIGH_ATTR_VLAN : 0));
else
return (NEIGH_ATTR_LLADDR | NEIGH_ATTR_FAMILY | NEIGH_ATTR_MASTER | NEIGH_ATTR_VLAN);
} else
- return (NEIGH_ATTR_IFINDEX | NEIGH_ATTR_DST | NEIGH_ATTR_FAMILY);
+ return neigh_obj_ops.oo_id_attrs;
}
static struct nla_policy neigh_policy[NDA_MAX+1] = {