diff options
| -rw-r--r-- | bgpd/bgp_zebra.c | 41 | ||||
| -rw-r--r-- | lib/nexthop.h | 1 | ||||
| -rw-r--r-- | lib/zclient.c | 7 | ||||
| -rw-r--r-- | lib/zclient.h | 1 | ||||
| -rw-r--r-- | ospfd/ospf_vty.c | 2 | ||||
| -rw-r--r-- | pimd/pim_pim.c | 100 | ||||
| -rw-r--r-- | pimd/pim_sock.c | 9 | ||||
| -rw-r--r-- | zebra/zapi_msg.c | 6 | ||||
| -rw-r--r-- | zebra/zebra_dplane.c | 2 | ||||
| -rw-r--r-- | zebra/zebra_fpm_netlink.c | 2 | ||||
| -rw-r--r-- | zebra/zebra_rib.c | 16 |
11 files changed, 120 insertions, 67 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index c1b388b05d..fc7590dcc2 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1132,6 +1132,7 @@ static bool update_ipv4nh_for_route_install(int nh_othervrf, struct bgp *nh_bgp, api_nh->type = NEXTHOP_TYPE_IPV4; else { api_nh->type = NEXTHOP_TYPE_IPV4_IFINDEX; + SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN); SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_ONLINK); api_nh->ifindex = nh_bgp->l3vni_svi_ifindex; } @@ -1170,6 +1171,7 @@ static bool update_ipv6nh_for_route_install(int nh_othervrf, struct bgp *nh_bgp, api_nh->type = NEXTHOP_TYPE_IPV6; else { api_nh->type = NEXTHOP_TYPE_IPV6_IFINDEX; + SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN); SET_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_ONLINK); api_nh->ifindex = nh_bgp->l3vni_svi_ifindex; } @@ -1268,7 +1270,6 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, mpls_label_t label; struct bgp_sid_info *sid_info; int nh_othervrf = 0; - bool is_evpn; bool nh_updated = false; bool do_wt_ecmp; uint64_t cum_bw = 0; @@ -1319,11 +1320,6 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, tag = info->attr->tag; - /* If the route's source is EVPN, flag as such. */ - is_evpn = is_route_parent_evpn(info); - if (is_evpn) - SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE); - if (peer->sort == BGP_PEER_IBGP || peer->sort == BGP_PEER_CONFED || info->sub_type == BGP_ROUTE_AGGREGATE) { SET_FLAG(api.flags, ZEBRA_FLAG_IBGP); @@ -1364,6 +1360,7 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, for (; mpinfo; mpinfo = bgp_path_info_mpath_next(mpinfo)) { uint32_t nh_weight; + bool is_evpn; if (valid_nh_count >= multipath_num) break; @@ -1430,6 +1427,8 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, BGP_ORIGINAL_UPDATE(bgp_orig, mpinfo, bgp); if (nh_family == AF_INET) { + is_evpn = is_route_parent_evpn(mpinfo); + nh_updated = update_ipv4nh_for_route_install( nh_othervrf, bgp_orig, &mpinfo_cp->attr->nexthop, mpinfo_cp->attr, @@ -1441,6 +1440,8 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, nexthop = bgp_path_info_to_ipv6_nexthop(mpinfo_cp, &ifindex); + is_evpn = is_route_parent_evpn(mpinfo); + if (!nexthop) nh_updated = update_ipv4nh_for_route_install( nh_othervrf, bgp_orig, @@ -1465,9 +1466,9 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, || mpinfo->peer->sort == BGP_PEER_CONFED)) allow_recursion = true; - if (mpinfo->extra - && bgp_is_valid_label(&mpinfo->extra->label[0]) - && !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)) { + if (mpinfo->extra && + bgp_is_valid_label(&mpinfo->extra->label[0]) && + !CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) { mpls_lse_decode(mpinfo->extra->label[0], &label, &ttl, &exp, &bos); @@ -1485,8 +1486,8 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, api_nh->weight = nh_weight; - if (mpinfo->extra && !sid_zero(&mpinfo->extra->sid[0].sid) - && !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)) { + if (mpinfo->extra && !sid_zero(&mpinfo->extra->sid[0].sid) && + !CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) { sid_info = &mpinfo->extra->sid[0]; memcpy(&api_nh->seg6_segs, &sid_info->sid, @@ -1613,19 +1614,21 @@ void bgp_zebra_announce(struct bgp_dest *dest, const struct prefix *p, label_buf[0] = '\0'; eth_buf[0] = '\0'; segs_buf[0] = '\0'; - if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_LABEL) - && !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)) + if (CHECK_FLAG(api_nh->flags, + ZAPI_NEXTHOP_FLAG_LABEL) && + !CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) snprintf(label_buf, sizeof(label_buf), "label %u", api_nh->labels[0]); - if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_SEG6) - && !CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE)) { + if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_SEG6) && + !CHECK_FLAG(api_nh->flags, + ZAPI_NEXTHOP_FLAG_EVPN)) { inet_ntop(AF_INET6, &api_nh->seg6_segs, sid_buf, sizeof(sid_buf)); snprintf(segs_buf, sizeof(segs_buf), "segs %s", sid_buf); } - if (CHECK_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE) - && !is_zero_mac(&api_nh->rmac)) + if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN) && + !is_zero_mac(&api_nh->rmac)) snprintf(eth_buf, sizeof(eth_buf), " RMAC %s", prefix_mac2str(&api_nh->rmac, buf1, sizeof(buf1))); @@ -1730,10 +1733,6 @@ void bgp_zebra_withdraw(const struct prefix *p, struct bgp_path_info *info, api.tableid = info->attr->rmap_table_id; } - /* If the route's source is EVPN, flag as such. */ - if (is_route_parent_evpn(info)) - SET_FLAG(api.flags, ZEBRA_FLAG_EVPN_ROUTE); - if (bgp_debug_zebra(p)) zlog_debug("Tx route delete VRF %u %pFX", bgp->vrf_id, &api.prefix); diff --git a/lib/nexthop.h b/lib/nexthop.h index c13f1b1376..e324e58491 100644 --- a/lib/nexthop.h +++ b/lib/nexthop.h @@ -94,6 +94,7 @@ struct nexthop { #define NEXTHOP_FLAG_RNH_FILTERED (1 << 5) /* rmap filtered, used by rnh */ #define NEXTHOP_FLAG_HAS_BACKUP (1 << 6) /* Backup nexthop index is set */ #define NEXTHOP_FLAG_SRTE (1 << 7) /* SR-TE color used for BGP traffic */ +#define NEXTHOP_FLAG_EVPN (1 << 8) /* nexthop is EVPN */ #define NEXTHOP_IS_ACTIVE(flags) \ (CHECK_FLAG(flags, NEXTHOP_FLAG_ACTIVE) \ diff --git a/lib/zclient.c b/lib/zclient.c index a933b6bb2b..e556b768ac 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -1038,7 +1038,7 @@ int zapi_nexthop_encode(struct stream *s, const struct zapi_nexthop *api_nh, stream_putl(s, api_nh->weight); /* Router MAC for EVPN routes. */ - if (CHECK_FLAG(api_flags, ZEBRA_FLAG_EVPN_ROUTE)) + if (CHECK_FLAG(nh_flags, ZAPI_NEXTHOP_FLAG_EVPN)) stream_put(s, &(api_nh->rmac), sizeof(struct ethaddr)); @@ -1402,7 +1402,7 @@ int zapi_nexthop_decode(struct stream *s, struct zapi_nexthop *api_nh, STREAM_GETL(s, api_nh->weight); /* Router MAC for EVPN routes. */ - if (CHECK_FLAG(api_flags, ZEBRA_FLAG_EVPN_ROUTE)) + if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) STREAM_GET(&(api_nh->rmac), s, sizeof(struct ethaddr)); @@ -1830,6 +1830,9 @@ int zapi_nexthop_from_nexthop(struct zapi_nexthop *znh, if (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_ONLINK)) SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_ONLINK); + if (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_EVPN)) + SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_EVPN); + if (nh->nh_label && (nh->nh_label->num_labels > 0)) { /* Validate */ diff --git a/lib/zclient.h b/lib/zclient.h index 9756923a69..c3ea2a16ff 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -452,6 +452,7 @@ struct zapi_nexthop { #define ZAPI_NEXTHOP_FLAG_HAS_BACKUP 0x08 /* Nexthop has a backup */ #define ZAPI_NEXTHOP_FLAG_SEG6 0x10 #define ZAPI_NEXTHOP_FLAG_SEG6LOCAL 0x20 +#define ZAPI_NEXTHOP_FLAG_EVPN 0x40 /* * ZAPI Nexthop Group. For use with protocol creation of nexthop groups. diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 747643465c..5bb65b6abc 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -4343,7 +4343,7 @@ static void show_ip_ospf_neighbour_brief(struct vty *vty, char msgbuf[16]; char timebuf[OSPF_TIME_DUMP_SIZE]; json_object *json_neighbor = NULL, *json_neigh_array = NULL; - struct timeval res; + struct timeval res = {.tv_sec = 0, .tv_usec = 0}; long time_val = 0; char uptime[OSPF_TIME_DUMP_SIZE]; diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index f0f4a7139b..1dd99d7ecd 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -42,6 +42,7 @@ #include "pim_register.h" #include "pim_errors.h" #include "pim_bsm.h" +#include <lib/lib_errors.h> static void on_pim_hello_send(struct thread *t); @@ -551,6 +552,7 @@ void pim_sock_reset(struct interface *ifp) static uint16_t ip_id = 0; #endif +#if PIM_IPV == 4 static int pim_msg_send_frame(int fd, char *buf, size_t len, struct sockaddr *dst, size_t salen, const char *ifname) @@ -558,7 +560,6 @@ static int pim_msg_send_frame(int fd, char *buf, size_t len, if (sendto(fd, buf, len, MSG_DONTWAIT, dst, salen) >= 0) return 0; -#if PIM_IPV == 4 if (errno == EMSGSIZE) { struct ip *ip = (struct ip *)buf; size_t hdrsize = sizeof(struct ip); @@ -585,7 +586,6 @@ static int pim_msg_send_frame(int fd, char *buf, size_t len, return pim_msg_send_frame(fd, (char *)ip2, sendlen, dst, salen, ifname); } -#endif zlog_warn( "%s: sendto() failure to %pSU: iface=%s fd=%d msg_size=%zd: %m", @@ -593,16 +593,65 @@ static int pim_msg_send_frame(int fd, char *buf, size_t len, return -1; } +#else +static int pim_msg_send_frame(pim_addr src, pim_addr dst, ifindex_t ifindex, + struct iovec *message, int fd) +{ + int retval; + struct msghdr smsghdr = {}; + struct cmsghdr *scmsgp; + union cmsgbuf { + struct cmsghdr hdr; + uint8_t buf[CMSG_SPACE(sizeof(struct in6_pktinfo))]; + }; + struct in6_pktinfo *pktinfo; + struct sockaddr_in6 dst_sin6 = {}; + + union cmsgbuf cmsg_buf = {}; + + /* destination address */ + dst_sin6.sin6_family = AF_INET6; +#ifdef SIN6_LEN + dst_sin6.sin6_len = sizeof(struct sockaddr_in6); +#endif /*SIN6_LEN*/ + dst_sin6.sin6_addr = dst; + dst_sin6.sin6_scope_id = ifindex; + + /* send msg hdr */ + smsghdr.msg_iov = message; + smsghdr.msg_iovlen = 1; + smsghdr.msg_name = (caddr_t)&dst_sin6; + smsghdr.msg_namelen = sizeof(dst_sin6); + smsghdr.msg_control = (caddr_t)&cmsg_buf.buf; + smsghdr.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo)); + smsghdr.msg_flags = 0; + + scmsgp = CMSG_FIRSTHDR(&smsghdr); + scmsgp->cmsg_level = IPPROTO_IPV6; + scmsgp->cmsg_type = IPV6_PKTINFO; + scmsgp->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); + + pktinfo = (struct in6_pktinfo *)(CMSG_DATA(scmsgp)); + pktinfo->ipi6_ifindex = ifindex; + pktinfo->ipi6_addr = src; + + retval = sendmsg(fd, &smsghdr, 0); + if (retval < 0) + flog_err( + EC_LIB_SOCKET, + "sendmsg failed: source: %pI6 Dest: %pI6 ifindex: %d: %s (%d)", + &src, &dst, ifindex, safe_strerror(errno), errno); + + return retval; +} +#endif + int pim_msg_send(int fd, pim_addr src, pim_addr dst, uint8_t *pim_msg, int pim_msg_size, struct interface *ifp) { - socklen_t tolen; - unsigned char buffer[10000]; - unsigned char *msg_start; - uint8_t ttl; - struct pim_msg_header *header; struct pim_interface *pim_ifp; + pim_ifp = ifp->info; if (pim_ifp->pim_passive_enable) { @@ -613,9 +662,15 @@ int pim_msg_send(int fd, pim_addr src, pim_addr dst, uint8_t *pim_msg, return 0; } +#if PIM_IPV == 4 + uint8_t ttl; + struct pim_msg_header *header; + unsigned char buffer[10000]; + memset(buffer, 0, 10000); header = (struct pim_msg_header *)pim_msg; + /* * Omnios apparently doesn't have a #define for IP default * ttl that is the same as all other platforms. @@ -643,10 +698,11 @@ int pim_msg_send(int fd, pim_addr src, pim_addr dst, uint8_t *pim_msg, break; } -#if PIM_IPV == 4 struct ip *ip = (struct ip *)buffer; struct sockaddr_in to = {}; int sendlen = sizeof(*ip) + pim_msg_size; + socklen_t tolen; + unsigned char *msg_start; ip->ip_id = htons(++ip_id); ip->ip_hl = 5; @@ -661,23 +717,6 @@ int pim_msg_send(int fd, pim_addr src, pim_addr dst, uint8_t *pim_msg, to.sin_family = AF_INET; to.sin_addr = dst; tolen = sizeof(to); -#else - struct ip6_hdr *ip = (struct ip6_hdr *)buffer; - struct sockaddr_in6 to = {}; - int sendlen = sizeof(*ip) + pim_msg_size; - - ip->ip6_flow = 0; - ip->ip6_vfc = (6 << 4) | (IPTOS_PREC_INTERNETCONTROL >> 4); - ip->ip6_plen = htons(pim_msg_size); - ip->ip6_nxt = PIM_IP_PROTO_PIM; - ip->ip6_hlim = ttl; - ip->ip6_src = src; - ip->ip6_dst = dst; - - to.sin6_family = AF_INET6; - to.sin6_addr = dst; - tolen = sizeof(to); -#endif msg_start = buffer + sizeof(*ip); memcpy(msg_start, pim_msg, pim_msg_size); @@ -694,6 +733,17 @@ int pim_msg_send(int fd, pim_addr src, pim_addr dst, uint8_t *pim_msg, pim_msg_send_frame(fd, (char *)buffer, sendlen, (struct sockaddr *)&to, tolen, ifp->name); return 0; + +#else + struct iovec iovector[2]; + + iovector[0].iov_base = pim_msg; + iovector[0].iov_len = pim_msg_size; + + pim_msg_send_frame(src, dst, ifp->ifindex, &iovector[0], fd); + + return 0; +#endif } static int hello_send(struct interface *ifp, uint16_t holdtime) diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c index 321775cce3..afc5d47118 100644 --- a/pimd/pim_sock.c +++ b/pimd/pim_sock.c @@ -70,18 +70,13 @@ int pim_socket_raw(int protocol) void pim_socket_ip_hdr(int fd) { - const int on = 1; - frr_with_privs(&pimd_privs) { #if PIM_IPV == 4 + const int on = 1; + if (setsockopt(fd, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on))) zlog_err("%s: Could not turn on IP_HDRINCL option: %m", __func__); -#else - if (setsockopt(fd, IPPROTO_IPV6, IPV6_HDRINCL, &on, sizeof(on))) - zlog_err( - "%s: Could not turn on IPV6_HDRINCL option: %m", - __func__); #endif } } diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 9a30c2b78f..9895943016 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -1606,13 +1606,14 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, /* Special handling for IPv4 routes sourced from EVPN: * the nexthop and associated MAC need to be installed. */ - if (CHECK_FLAG(flags, ZEBRA_FLAG_EVPN_ROUTE)) { + if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) { memset(&vtep_ip, 0, sizeof(vtep_ip)); vtep_ip.ipa_type = IPADDR_V4; memcpy(&(vtep_ip.ipaddr_v4), &(api_nh->gate.ipv4), sizeof(struct in_addr)); zebra_rib_queue_evpn_route_add( api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); } break; case NEXTHOP_TYPE_IPV6: @@ -1639,13 +1640,14 @@ static struct nexthop *nexthop_from_zapi(const struct zapi_nexthop *api_nh, /* Special handling for IPv6 routes sourced from EVPN: * the nexthop and associated MAC need to be installed. */ - if (CHECK_FLAG(flags, ZEBRA_FLAG_EVPN_ROUTE)) { + if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_EVPN)) { memset(&vtep_ip, 0, sizeof(vtep_ip)); vtep_ip.ipa_type = IPADDR_V6; memcpy(&vtep_ip.ipaddr_v6, &(api_nh->gate.ipv6), sizeof(struct in6_addr)); zebra_rib_queue_evpn_route_add( api_nh->vrf_id, &api_nh->rmac, &vtep_ip, p); + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN); } break; case NEXTHOP_TYPE_BLACKHOLE: diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 0da44e3c4e..bb03d33e99 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -2562,7 +2562,7 @@ int dplane_ctx_route_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op, } /* Check for available evpn encapsulations. */ - if (!CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE)) + if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN)) continue; zl3vni = zl3vni_from_vrf(nexthop->vrf_id); diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c index d4aced47f9..ca897251e2 100644 --- a/zebra/zebra_fpm_netlink.c +++ b/zebra/zebra_fpm_netlink.c @@ -208,7 +208,7 @@ static int netlink_route_info_add_nh(struct netlink_route_info *ri, if (!nhi.gateway && nhi.if_index == 0) return 0; - if (re && CHECK_FLAG(re->flags, ZEBRA_FLAG_EVPN_ROUTE)) { + if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN)) { nhi.encap_info.encap_type = FPM_NH_ENCAP_VXLAN; /* Extract VNI id for the nexthop SVI interface */ diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 3699b53f12..63f15b0f20 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -3302,7 +3302,7 @@ static void _route_entry_dump_nh(const struct route_entry *re, if (nexthop->weight) snprintf(wgt_str, sizeof(wgt_str), "wgt %d,", nexthop->weight); - zlog_debug("%s: %s %s[%u] %svrf %s(%u) %s%s with flags %s%s%s%s%s%s%s%s", + zlog_debug("%s: %s %s[%u] %svrf %s(%u) %s%s with flags %s%s%s%s%s%s%s%s%s", straddr, (nexthop->rparent ? " NH" : "NH"), nhname, nexthop->ifindex, label_str, vrf ? vrf->name : "Unknown", nexthop->vrf_id, @@ -3327,7 +3327,9 @@ static void _route_entry_dump_nh(const struct route_entry *re, (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_HAS_BACKUP) ? "BACKUP " : ""), (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_SRTE) - ? "SRTE " : "")); + ? "SRTE " : ""), + (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_EVPN) + ? "EVPN " : "")); } @@ -3764,6 +3766,8 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, } if (same) { + struct nexthop *tmp_nh; + if (fromkernel && CHECK_FLAG(flags, ZEBRA_FLAG_SELFROUTE) && !allow_delete) { rib_install_kernel(rn, same, NULL); @@ -3776,12 +3780,10 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, * EVPN - the nexthop (and associated MAC) need to be * uninstalled if no more refs. */ - if (CHECK_FLAG(flags, ZEBRA_FLAG_EVPN_ROUTE)) { - struct nexthop *tmp_nh; - - for (ALL_NEXTHOPS(re->nhe->nhg, tmp_nh)) { - struct ipaddr vtep_ip; + for (ALL_NEXTHOPS(re->nhe->nhg, tmp_nh)) { + struct ipaddr vtep_ip; + if (CHECK_FLAG(tmp_nh->flags, NEXTHOP_FLAG_EVPN)) { memset(&vtep_ip, 0, sizeof(struct ipaddr)); if (afi == AFI_IP) { vtep_ip.ipa_type = IPADDR_V4; |
