From d1bd68d1009601ee4e4217fbad9ad9c33a940a50 Mon Sep 17 00:00:00 2001 From: Tobias Jungel Date: Thu, 5 Apr 2018 13:24:59 +0200 Subject: neigh: set correct AF for NDA_DST In case using a VXLAN interface at a bridge you will set L2 bridging entries using a IP destination to tunnel the according L2 traffic. The current behavior for the dst entries for a neighbor is to use the AF of the neighbor itself thus in this case AF_BRIDGE is set. This is changed in the PR to update the family of the dst using nl_addr_guess_family. https://github.com/thom311/libnl/pull/180 --- lib/route/neigh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/route/neigh.c b/lib/route/neigh.c index 9700fbc3..824cf492 100644 --- a/lib/route/neigh.c +++ b/lib/route/neigh.c @@ -389,11 +389,13 @@ int rtnl_neigh_parse(struct nlmsghdr *n, struct rtnl_neigh **result) } if (tb[NDA_DST]) { - neigh->n_dst = nl_addr_alloc_attr(tb[NDA_DST], neigh->n_family); + neigh->n_dst = nl_addr_alloc_attr(tb[NDA_DST], AF_UNSPEC); if (!neigh->n_dst) { err = -NLE_NOMEM; goto errout; } + nl_addr_set_family(neigh->n_dst, + nl_addr_guess_family(neigh->n_dst)); neigh->ce_mask |= NEIGH_ATTR_DST; } -- cgit v1.2.3