diff options
Diffstat (limited to 'bgpd/bgp_updgrp_packet.c')
| -rw-r--r-- | bgpd/bgp_updgrp_packet.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index cecb844fce..872ead000c 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -607,6 +607,30 @@ bpacket_reformat_for_peer (struct bpacket *pkt, struct peer_af *paf) (nhlen == 24 ? " and RD" : "")); } } + else if (paf->afi == AFI_L2VPN) + { + struct in_addr v4nh, *mod_v4nh; + int nh_modified = 0; + + stream_get_from (&v4nh, s, vec->offset + 1, 4); + mod_v4nh = &v4nh; + + /* No route-map changes allowed for EVPN nexthops. */ + if (!v4nh.s_addr) + { + mod_v4nh = &peer->nexthop.v4; + nh_modified = 1; + } + + if (nh_modified) + stream_put_in_addr_at (s, vec->offset + 1, mod_v4nh); + + if (bgp_debug_update(peer, NULL, NULL, 0)) + zlog_debug ("u%" PRIu64 ":s%" PRIu64 " %s send UPDATE w/ nexthop %s", + PAF_SUBGRP(paf)->update_group->id, PAF_SUBGRP(paf)->id, + peer->host, inet_ntoa (*mod_v4nh)); + + } } bgp_packet_add (peer, s); |
