zebra: fixes NDA_DST in netlink_neigh_update() function

When netlink_neigh_update() is called, the link registration was
failing, due to bad request length.
Also, the query was failing if NDA_DST was an ipv6 address.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2021-02-25 15:06:23 +01:00
parent 451e2b8c7e
commit df948efc56

View File

@ -1570,7 +1570,8 @@ static int netlink_neigh_update(int cmd, int ifindex, void *addr, char *lla,
nl_attr_put(&req.n, sizeof(req), NDA_PROTOCOL, &protocol,
sizeof(protocol));
req.ndm.ndm_type = RTN_UNICAST;
nl_attr_put32(&req.n, family2addrsize(family), NDA_DST, addr);
nl_attr_put(&req.n, sizeof(req), NDA_DST, addr,
family2addrsize(family));
if (lla)
nl_attr_put(&req.n, sizeof(req), NDA_LLADDR, lla, llalen);