summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index b641d07000..dc0c839674 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -3390,9 +3390,18 @@ static int netlink_ipneigh_change(struct nlmsghdr *h, int len, ns_id_t ns_id)
l2_len = RTA_PAYLOAD(tb[NDA_LLADDR]);
memcpy(&mac, RTA_DATA(tb[NDA_LLADDR]), l2_len);
}
- if (l2_len == IPV4_MAX_BYTELEN || l2_len == 0)
+ if (l2_len == IPV4_MAX_BYTELEN || l2_len == 0) {
+ union sockunion link_layer_ipv4;
+
+ if (l2_len) {
+ sockunion_family(&link_layer_ipv4) = AF_INET;
+ memcpy((void *)sockunion_get_addr(&link_layer_ipv4),
+ &mac, l2_len);
+ } else
+ sockunion_family(&link_layer_ipv4) = AF_UNSPEC;
zsend_nhrp_neighbor_notify(cmd, ifp, &ip, ndm->ndm_state,
- &mac, l2_len);
+ &link_layer_ipv4);
+ }
if (h->nlmsg_type == RTM_GETNEIGH)
return 0;