Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: fixes for ipv4 mapped ipv6 address #16439

Merged
merged 4 commits into from
Aug 12, 2024

Conversation

louis-6wind
Copy link
Contributor

fixes for ipv4 mapped ipv6 address. See individual commit logs

@riw777 riw777 self-requested a review July 23, 2024 15:07
@frrbot frrbot bot added the tests Topotests, make check, etc label Jul 23, 2024
When IPv6 prefixes are sent over an IPv4 session, the UPDATE is sent
with a link-local nexthop as global nexthop instead of a IPv4-mapped
IPv6 address. If the peer interface has no IPv6 address, routes are
not installed.

Seen with bgp_nexthop_mp_ipv4_6 topotests on step2:

> root@r2:/# vtysh -c 'show bgp ipv6 fd00:100::/64 json' | jq .
> {
>   "prefix": "fd00:100::/64",
>   "paths": [
>     {
>       "nexthops": [
>         {
>           "ip": "fe80::449a:f8ff:fe67:1f93",
>           "hostname": "r1",
>           "afi": "ipv6",
>           "scope": "global",
>           "metric": 0,
>           "accessible": true
>         },
>         {
>           "ip": "fe80::449a:f8ff:fe67:1f93",
>           "hostname": "r1",
>           "afi": "ipv6",
>           "scope": "link-local",
>           "accessible": true,
>           "used": true
>         }
>       ],
>     }
>   ]
> }

Now:

> root@r2:/# vtysh -c 'show bgp ipv6 fd00:100::/64 json' | jq .
> {
>   "prefix": "fd00:100::/64",
>   "paths": [
>       "nexthops": [
>         {
>           "ip": "::ffff:172.16.0.1",
>           "hostname": "r1",
>           "afi": "ipv6",
>           "scope": "global",
>           "metric": 0,
>           "accessible": true
>         },
>         {
>           "ip": "fe80::3842:28ff:fe90:f815",
>           "hostname": "r1",
>           "afi": "ipv6",
>           "scope": "link-local",
>           "accessible": true,
>           "used": true
>         }
>       ],
>     }
>   ]
> }

Note that the link-local is still preferred over the global address.

Fixes: 25995695f5 ("bgpd: set ipv4-mapped ipv6 for ipv4 with ipv6 nexthop")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Fix nexthop resolution of ipv4-mapped ipv6 nexthop addresses.

Fixes: 5dd731a ("bgpd: prefer link-local to a ipv4-mapped ipv6 global")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Replace IPv4-mapped IPv6 at update forwarding because the peer may not
be able to create a route with the IPv4-mapped IPv6.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Test that a IPv4-mapped IPv6 is sent from a peer that has no global IPv6
address.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
@louis-6wind louis-6wind force-pushed the fix-ipv4-mapped-ipv6 branch from 1790abb to d618436 Compare July 24, 2024 21:23
@github-actions github-actions bot added size/M and removed size/L labels Jul 24, 2024
@louis-6wind louis-6wind changed the title bgpd, lib: fixes for ipv4 mapped ipv6 address bgpd: fixes for ipv4 mapped ipv6 address Jul 25, 2024
@louis-6wind
Copy link
Contributor Author

ci:rerun

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@riw777
Copy link
Member

riw777 commented Jul 30, 2024

should there be a knob to change the behavior in case someone wants the link local address as the forwarding address?

@riw777
Copy link
Member

riw777 commented Jul 30, 2024

Looks like the topo isn't passing --

E   AssertionError: Testcase test_verify_bgp_always_compare_med_functionality_bw_eBGP_peers_by_changing_AD_values_p0 : Failed 
      Error: Nexthop {'fd00::2'} is Missing for route 192:168:20::1/128 in RIB of router r1
     
   assert "Nexthop {'fd00::2'} is Missing for route 192:168:20::1/128 in RIB of router r1\n" is True

@ton31337 ton31337 merged commit cc0fdd3 into FRRouting:master Aug 12, 2024
11 checks passed
Jafaral added a commit to Jafaral/frr that referenced this pull request Aug 21, 2024
…mapped-ipv6"

This reverts commit cc0fdd3, reversing
changes made to 4e20808.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants