From 9c0a2e5a29b19a7ed3afbf4418b9990e61072d92 Mon Sep 17 00:00:00 2001 From: vivek Date: Fri, 15 May 2020 13:58:30 -0700 Subject: [PATCH 1/2] zebra: Pass correct buffer to MAC FDB netlink message build Fixes: zebra: adapt and export rmac netlink functions Signed-off-by: Vivek Venkatraman --- zebra/rt_netlink.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 466e985494..5d0026ccbb 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2975,7 +2975,6 @@ netlink_macfdb_update_ctx(struct zebra_dplane_ctx *ctx, uint8_t *data, int cmd; uint8_t flags; uint16_t state; - uint8_t nl_pkt[NL_PKT_BUF_SIZE]; cmd = dplane_ctx_get_op(ctx) == DPLANE_OP_MAC_INSTALL ? RTM_NEWNEIGH : RTM_DELNEIGH; @@ -3016,7 +3015,7 @@ netlink_macfdb_update_ctx(struct zebra_dplane_ctx *ctx, uint8_t *data, total = netlink_update_neigh_ctx_internal( ctx, cmd, dplane_ctx_mac_get_addr(ctx), dplane_ctx_neigh_get_ipaddr(ctx), true, AF_BRIDGE, 0, - flags, state, nl_pkt, sizeof(nl_pkt)); + flags, state, data, datalen); return total; } From f0b014fdae31f5897be0c8cb4c3f42fa55aadbce Mon Sep 17 00:00:00 2001 From: vivek Date: Fri, 15 May 2020 14:01:59 -0700 Subject: [PATCH 2/2] zebra: Install bridge FDB entries with correct VTEP IP Fixes: zebra: adapt and export rmac netlink functions Signed-off-by: Vivek Venkatraman --- zebra/rt_netlink.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 5d0026ccbb..89d9f4c973 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -2552,10 +2552,15 @@ int kernel_neigh_update(int add, int ifindex, uint32_t addr, char *lla, /** * netlink_update_neigh_ctx_internal() - Common helper api for evpn * neighbor updates using dataplane context object. + * Here, a neighbor refers to a bridge forwarding database entry for + * either unicast forwarding or head-end replication or an IP neighbor + * entry. * @ctx: Dataplane context * @cmd: Netlink command (RTM_NEWNEIGH or RTM_DELNEIGH) * @mac: A neighbor cache link layer address * @ip: A neighbor cache n/w layer destination address + * In the case of bridge FDB, this represnts the remote + * VTEP IP. * @replace_obj: Whether NEW request should replace existing object or * add to the end of the list * @family: AF_* netlink family @@ -3013,9 +3018,8 @@ netlink_macfdb_update_ctx(struct zebra_dplane_ctx *ctx, uint8_t *data, } total = netlink_update_neigh_ctx_internal( - ctx, cmd, dplane_ctx_mac_get_addr(ctx), - dplane_ctx_neigh_get_ipaddr(ctx), true, AF_BRIDGE, 0, - flags, state, data, datalen); + ctx, cmd, dplane_ctx_mac_get_addr(ctx), &vtep_ip, + true, AF_BRIDGE, 0, flags, state, data, datalen); return total; }