From 45c80fbd085d743db0856ee1f8f7c8ef272f171b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jakub=20Urba=C5=84czyk?= Date: Thu, 16 Jul 2020 15:49:05 +0200 Subject: [PATCH] zebra: fix installing an evpn neighbor update MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix the function encoding evpn neighbor. The size of the buffer for the netlink message wasn't correct and because of that we thought that the message didn't fit entirely in the buffer and thus we were not sending the update to the kernel. Signed-off-by: Jakub Urbańczyk --- zebra/rt_netlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 40a7eeba8e..07e8e37b82 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2686,7 +2686,7 @@ static ssize_t netlink_neigh_update_msg_encode( if (datalen < sizeof(*req)) return 0; - memset(req, 0, datalen); + memset(req, 0, sizeof(*req)); op = dplane_ctx_get_op(ctx); @@ -2703,7 +2703,7 @@ static ssize_t netlink_neigh_update_msg_encode( req->ndm.ndm_flags = flags; req->ndm.ndm_ifindex = dplane_ctx_get_ifindex(ctx); - if (!nl_attr_put(&req->n, sizeof(req), NDA_PROTOCOL, &protocol, + if (!nl_attr_put(&req->n, datalen, NDA_PROTOCOL, &protocol, sizeof(protocol))) return 0; -- 2.39.5