Skip to content

Commit

Permalink
bgpd: Do not use mapped IPv4/IPv6 addresses for unnumbered peering
Browse files Browse the repository at this point in the history
Before:

```
router bgp 4283023031
 bgp router-id 100.83.23.31
 neighbor leafs peer-group
 neighbor leafs remote-as external
 neighbor eth1 interface peer-group leafs
 !
 address-family ipv4 unicast
  network 100.83.23.31/32
 exit-address-family
 !
exit
```

```
leaf2# show ip bgp 100.83.23.31/32
…
  4283023031
    ::ffff:6453:171f (inaccessible) from node31-h23-osl3(swp32) (100.83.23.31)
    (fe80::a6bf:1ff:fe2d:689a) (used)
      Origin IGP, metric 0, invalid, external
      Last update: Tue Aug 13 08:36:46 2024
```

Fixes: fc5a738 ("bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
  • Loading branch information
ton31337 authored and louis-6wind committed Oct 7, 2024
1 parent bd8f81a commit 4b983b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bgpd/bgp_updgrp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
gnh_modified = 1;
}

if (peer->nexthop.v4.s_addr != INADDR_ANY &&
if (!peer->conf_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 &&
Expand Down

0 comments on commit 4b983b5

Please sign in to comment.