From cabddbf5f65bb833cca72dce25e8684731422476 Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Tue, 10 May 2022 21:48:50 -0400 Subject: [PATCH] bgpd: remove unncessary check for evpn In current code, `build_evpn_type2_prefix()` doesn't distinguish ARP according to the `ip` parameter. The `ip` parameter from caller is always non-NULL. Be consistent and not confused, just remove the unnecessary check. Signed-off-by: anlan_cs --- bgpd/bgp_evpn_private.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bgpd/bgp_evpn_private.h b/bgpd/bgp_evpn_private.h index 763408782f..64fdc29704 100644 --- a/bgpd/bgp_evpn_private.h +++ b/bgpd/bgp_evpn_private.h @@ -450,8 +450,7 @@ static inline void build_evpn_type2_prefix(struct prefix_evpn *p, p->prefix.route_type = BGP_EVPN_MAC_IP_ROUTE; memcpy(&p->prefix.macip_addr.mac.octet, mac->octet, ETH_ALEN); p->prefix.macip_addr.ip.ipa_type = IPADDR_NONE; - if (ip) - memcpy(&p->prefix.macip_addr.ip, ip, sizeof(*ip)); + memcpy(&p->prefix.macip_addr.ip, ip, sizeof(*ip)); } static inline void