diff options
Diffstat (limited to 'bgpd/bgp_updgrp_packet.c')
-rw-r--r-- | bgpd/bgp_updgrp_packet.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index 0f4738838..b7d5f6645 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -508,9 +508,6 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt, gnh_modified = 1; } } else if (IN6_IS_ADDR_UNSPECIFIED(&v6nhglobal)) { - /* the UPDATE is originating from the local router. - * Build the global nexthop. - */ mod_v6nhg = &peer->nexthop.v6_global; gnh_modified = 1; } else if ((peer->sort == BGP_PEER_EBGP) @@ -524,32 +521,18 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt, */ mod_v6nhg = &peer->nexthop.v6_global; gnh_modified = 1; - } else if (IS_MAPPED_IPV6(&v6nhglobal) && - !IN6_IS_ADDR_LINKLOCAL(&peer->nexthop.v6_global)) { - /* prefer a IPv6 native global address over - * an IPv4-mapped IPv6 address as nexthop when - * forwarding UPDATEs. - */ - mod_v6nhg = &peer->nexthop.v6_global; - gnh_modified = 1; } if (peer->nexthop.v4.s_addr != INADDR_ANY && (IN6_IS_ADDR_UNSPECIFIED(mod_v6nhg) || (IN6_IS_ADDR_LINKLOCAL(mod_v6nhg) && - ((peer->connection->su.sa.sa_family == AF_INET6 && - paf->afi == AFI_IP) || - (peer->connection->su.sa.sa_family == AF_INET && - paf->afi == AFI_IP6))))) { + peer->connection->su.sa.sa_family == AF_INET6 && + paf->afi == AFI_IP))) { ipv4_to_ipv4_mapped_ipv6(mod_v6nhg, peer->nexthop.v4); gnh_modified = 1; } if (IS_MAPPED_IPV6(&peer->nexthop.v6_global)) { - /* If the interface to the peer has no global IPv6 - * address, replace the nexthop in UPDATE with - * the IPv4-mapped IPv6 address if any. - */ mod_v6nhg = &peer->nexthop.v6_global; gnh_modified = 1; } |