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
This commit is contained in:
Tobias Jungel 2018-04-05 13:24:59 +02:00 committed by Thomas Haller
parent e9ed96be7e
commit d1bd68d100

View File

@ -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;
}