diff options
author | Tobias Jungel <tobias.jungel@bisdn.de> | 2018-04-05 13:24:59 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-06 19:47:03 +0200 |
commit | d1bd68d1009601ee4e4217fbad9ad9c33a940a50 (patch) | |
tree | 96022d5d5bcaae3043d90ba5a05376f0f209e0ce /lib | |
parent | e9ed96be7e6ca7150dc9fcef589a800cff7a4ccc (diff) | |
download | libnl-d1bd68d1009601ee4e4217fbad9ad9c33a940a50.tar.gz |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/route/neigh.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |