diff --git a/lib/ntop.c b/lib/ntop.c index 89b4d5ecdcab..edf03cd07680 100644 --- a/lib/ntop.c +++ b/lib/ntop.c @@ -116,7 +116,18 @@ const char *frr_inet_ntop(int af, const void * restrict src, best = i - curlen; bestlen = curlen; } - /* do we want ::ffff:A.B.C.D? */ + if (best == 0 && bestlen == 5 && b[10] == 0xff && b[11] == 0xff) { + /* ::ffff:A.B.C.D */ + *o++ = ':'; + *o++ = ':'; + *o++ = 'f'; + *o++ = 'f'; + *o++ = 'f'; + *o++ = 'f'; + *o++ = ':'; + b += 12; + goto inet4; + } if (best == 0 && bestlen == 6) { *o++ = ':'; *o++ = ':'; diff --git a/tests/isisd/test_fuzz_isis_tlv_tests.h.gz b/tests/isisd/test_fuzz_isis_tlv_tests.h.gz index 05e9f723a162..902b671b32c7 100644 Binary files a/tests/isisd/test_fuzz_isis_tlv_tests.h.gz and b/tests/isisd/test_fuzz_isis_tlv_tests.h.gz differ diff --git a/tests/topotests/bfd_isis_topo1/rt1/step1/show_ipv6_route.ref b/tests/topotests/bfd_isis_topo1/rt1/step1/show_ipv6_route.ref index 68d3fe2c44e0..a760f1c24936 100644 --- a/tests/topotests/bfd_isis_topo1/rt1/step1/show_ipv6_route.ref +++ b/tests/topotests/bfd_isis_topo1/rt1/step1/show_ipv6_route.ref @@ -1,7 +1,7 @@ { - "::ffff:202:202\/128":[ + "::ffff:2.2.2.2\/128":[ { - "prefix":"::ffff:202:202\/128", + "prefix":"::ffff:2.2.2.2\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -16,9 +16,9 @@ ] } ], - "::ffff:303:303\/128":[ + "::ffff:3.3.3.3\/128":[ { - "prefix":"::ffff:303:303\/128", + "prefix":"::ffff:3.3.3.3\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -33,9 +33,9 @@ ] } ], - "::ffff:404:404\/128":[ + "::ffff:4.4.4.4\/128":[ { - "prefix":"::ffff:404:404\/128", + "prefix":"::ffff:4.4.4.4\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -50,9 +50,9 @@ ] } ], - "::ffff:505:505\/128":[ + "::ffff:5.5.5.5\/128":[ { - "prefix":"::ffff:505:505\/128", + "prefix":"::ffff:5.5.5.5\/128", "protocol":"isis", "selected":true, "destSelected":true, diff --git a/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_healthy.ref b/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_healthy.ref index 68d3fe2c44e0..a760f1c24936 100644 --- a/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_healthy.ref +++ b/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_healthy.ref @@ -1,7 +1,7 @@ { - "::ffff:202:202\/128":[ + "::ffff:2.2.2.2\/128":[ { - "prefix":"::ffff:202:202\/128", + "prefix":"::ffff:2.2.2.2\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -16,9 +16,9 @@ ] } ], - "::ffff:303:303\/128":[ + "::ffff:3.3.3.3\/128":[ { - "prefix":"::ffff:303:303\/128", + "prefix":"::ffff:3.3.3.3\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -33,9 +33,9 @@ ] } ], - "::ffff:404:404\/128":[ + "::ffff:4.4.4.4\/128":[ { - "prefix":"::ffff:404:404\/128", + "prefix":"::ffff:4.4.4.4\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -50,9 +50,9 @@ ] } ], - "::ffff:505:505\/128":[ + "::ffff:5.5.5.5\/128":[ { - "prefix":"::ffff:505:505\/128", + "prefix":"::ffff:5.5.5.5\/128", "protocol":"isis", "selected":true, "destSelected":true, diff --git a/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt2_down.ref b/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt2_down.ref index 200053c3e830..116876545753 100644 --- a/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt2_down.ref +++ b/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt2_down.ref @@ -1,7 +1,7 @@ { - "::ffff:202:202\/128":[ + "::ffff:2.2.2.2\/128":[ { - "prefix":"::ffff:202:202\/128", + "prefix":"::ffff:2.2.2.2\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -16,9 +16,9 @@ ] } ], - "::ffff:303:303\/128":[ + "::ffff:3.3.3.3\/128":[ { - "prefix":"::ffff:303:303\/128", + "prefix":"::ffff:3.3.3.3\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -33,9 +33,9 @@ ] } ], - "::ffff:404:404\/128":[ + "::ffff:4.4.4.4\/128":[ { - "prefix":"::ffff:404:404\/128", + "prefix":"::ffff:4.4.4.4\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -50,9 +50,9 @@ ] } ], - "::ffff:505:505\/128":[ + "::ffff:5.5.5.5\/128":[ { - "prefix":"::ffff:505:505\/128", + "prefix":"::ffff:5.5.5.5\/128", "protocol":"isis", "selected":true, "destSelected":true, diff --git a/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt3_down.ref b/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt3_down.ref index 4297f163b568..3e8505e79baa 100644 --- a/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt3_down.ref +++ b/tests/topotests/bfd_isis_topo1/rt1/step3/show_ipv6_route_rt3_down.ref @@ -1,7 +1,7 @@ { - "::ffff:202:202\/128":[ + "::ffff:2.2.2.2\/128":[ { - "prefix":"::ffff:202:202\/128", + "prefix":"::ffff:2.2.2.2\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -16,9 +16,9 @@ ] } ], - "::ffff:303:303\/128":[ + "::ffff:3.3.3.3\/128":[ { - "prefix":"::ffff:303:303\/128", + "prefix":"::ffff:3.3.3.3\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -33,9 +33,9 @@ ] } ], - "::ffff:404:404\/128":[ + "::ffff:4.4.4.4\/128":[ { - "prefix":"::ffff:404:404\/128", + "prefix":"::ffff:4.4.4.4\/128", "protocol":"isis", "selected":true, "destSelected":true, @@ -50,9 +50,9 @@ ] } ], - "::ffff:505:505\/128":[ + "::ffff:5.5.5.5\/128":[ { - "prefix":"::ffff:505:505\/128", + "prefix":"::ffff:5.5.5.5\/128", "protocol":"isis", "selected":true, "destSelected":true, diff --git a/tests/topotests/bfd_isis_topo1/rt1/zebra.conf b/tests/topotests/bfd_isis_topo1/rt1/zebra.conf index 7e6f7881b4d5..bf2428e62562 100644 --- a/tests/topotests/bfd_isis_topo1/rt1/zebra.conf +++ b/tests/topotests/bfd_isis_topo1/rt1/zebra.conf @@ -10,7 +10,7 @@ hostname rt1 ! interface lo ip address 1.1.1.1/32 - ipv6 address ::ffff:0101:0101/128 + ipv6 address ::ffff:1.1.1.1/128 ! interface eth-rt2 ip address 10.0.1.1/24 diff --git a/tests/topotests/bfd_isis_topo1/rt2/zebra.conf b/tests/topotests/bfd_isis_topo1/rt2/zebra.conf index 5788e31f123a..1670c205064e 100644 --- a/tests/topotests/bfd_isis_topo1/rt2/zebra.conf +++ b/tests/topotests/bfd_isis_topo1/rt2/zebra.conf @@ -7,7 +7,7 @@ hostname rt2 ! interface lo ip address 2.2.2.2/32 - ipv6 address ::ffff:0202:0202/128 + ipv6 address ::ffff:2.2.2.2/128 ! interface eth-rt1 ip address 10.0.1.2/24 diff --git a/tests/topotests/bfd_isis_topo1/rt3/zebra.conf b/tests/topotests/bfd_isis_topo1/rt3/zebra.conf index 78eac2e15a60..d59085560f3e 100644 --- a/tests/topotests/bfd_isis_topo1/rt3/zebra.conf +++ b/tests/topotests/bfd_isis_topo1/rt3/zebra.conf @@ -7,7 +7,7 @@ hostname rt3 ! interface lo ip address 3.3.3.3/32 - ipv6 address ::ffff:0303:0303/128 + ipv6 address ::ffff:3.3.3.3/128 ! interface eth-rt1 ip address 10.0.2.2/24 diff --git a/tests/topotests/bfd_isis_topo1/rt4/zebra.conf b/tests/topotests/bfd_isis_topo1/rt4/zebra.conf index a6cb573ed878..66121662ddec 100644 --- a/tests/topotests/bfd_isis_topo1/rt4/zebra.conf +++ b/tests/topotests/bfd_isis_topo1/rt4/zebra.conf @@ -7,7 +7,7 @@ hostname rt4 ! interface lo ip address 4.4.4.4/32 - ipv6 address ::ffff:0404:0404/128 + ipv6 address ::ffff:4.4.4.4/128 ! interface eth-rt3 ip address 10.0.4.2/24 diff --git a/tests/topotests/bfd_isis_topo1/rt5/zebra.conf b/tests/topotests/bfd_isis_topo1/rt5/zebra.conf index 33473c91a3d1..d3331b5b6ca9 100644 --- a/tests/topotests/bfd_isis_topo1/rt5/zebra.conf +++ b/tests/topotests/bfd_isis_topo1/rt5/zebra.conf @@ -7,7 +7,7 @@ hostname rt5 ! interface lo ip address 5.5.5.5/32 - ipv6 address ::ffff:0505:0505/128 + ipv6 address ::ffff:5.5.5.5/128 ! interface eth-rt2 ip address 10.0.3.2/24 diff --git a/tests/topotests/bfd_ospf_topo1/rt1/step1/show_ipv6_route.ref b/tests/topotests/bfd_ospf_topo1/rt1/step1/show_ipv6_route.ref index 6465efb8b532..0526d8a6af5d 100644 --- a/tests/topotests/bfd_ospf_topo1/rt1/step1/show_ipv6_route.ref +++ b/tests/topotests/bfd_ospf_topo1/rt1/step1/show_ipv6_route.ref @@ -1,7 +1,7 @@ { - "::ffff:202:202\/128":[ + "::ffff:2.2.2.2\/128":[ { - "prefix":"::ffff:202:202\/128", + "prefix":"::ffff:2.2.2.2\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -16,9 +16,9 @@ ] } ], - "::ffff:303:303\/128":[ + "::ffff:3.3.3.3\/128":[ { - "prefix":"::ffff:303:303\/128", + "prefix":"::ffff:3.3.3.3\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -33,9 +33,9 @@ ] } ], - "::ffff:404:404\/128":[ + "::ffff:4.4.4.4\/128":[ { - "prefix":"::ffff:404:404\/128", + "prefix":"::ffff:4.4.4.4\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -50,9 +50,9 @@ ] } ], - "::ffff:505:505\/128":[ + "::ffff:5.5.5.5\/128":[ { - "prefix":"::ffff:505:505\/128", + "prefix":"::ffff:5.5.5.5\/128", "protocol":"ospf6", "selected":true, "destSelected":true, diff --git a/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_healthy.ref b/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_healthy.ref index 6465efb8b532..0526d8a6af5d 100644 --- a/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_healthy.ref +++ b/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_healthy.ref @@ -1,7 +1,7 @@ { - "::ffff:202:202\/128":[ + "::ffff:2.2.2.2\/128":[ { - "prefix":"::ffff:202:202\/128", + "prefix":"::ffff:2.2.2.2\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -16,9 +16,9 @@ ] } ], - "::ffff:303:303\/128":[ + "::ffff:3.3.3.3\/128":[ { - "prefix":"::ffff:303:303\/128", + "prefix":"::ffff:3.3.3.3\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -33,9 +33,9 @@ ] } ], - "::ffff:404:404\/128":[ + "::ffff:4.4.4.4\/128":[ { - "prefix":"::ffff:404:404\/128", + "prefix":"::ffff:4.4.4.4\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -50,9 +50,9 @@ ] } ], - "::ffff:505:505\/128":[ + "::ffff:5.5.5.5\/128":[ { - "prefix":"::ffff:505:505\/128", + "prefix":"::ffff:5.5.5.5\/128", "protocol":"ospf6", "selected":true, "destSelected":true, diff --git a/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt2_down.ref b/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt2_down.ref index cfb1ef1bb6c1..8a8a0cd77d99 100644 --- a/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt2_down.ref +++ b/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt2_down.ref @@ -1,7 +1,7 @@ { - "::ffff:202:202\/128":[ + "::ffff:2.2.2.2\/128":[ { - "prefix":"::ffff:202:202\/128", + "prefix":"::ffff:2.2.2.2\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -16,9 +16,9 @@ ] } ], - "::ffff:303:303\/128":[ + "::ffff:3.3.3.3\/128":[ { - "prefix":"::ffff:303:303\/128", + "prefix":"::ffff:3.3.3.3\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -33,9 +33,9 @@ ] } ], - "::ffff:404:404\/128":[ + "::ffff:4.4.4.4\/128":[ { - "prefix":"::ffff:404:404\/128", + "prefix":"::ffff:4.4.4.4\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -50,9 +50,9 @@ ] } ], - "::ffff:505:505\/128":[ + "::ffff:5.5.5.5\/128":[ { - "prefix":"::ffff:505:505\/128", + "prefix":"::ffff:5.5.5.5\/128", "protocol":"ospf6", "selected":true, "destSelected":true, diff --git a/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt3_down.ref b/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt3_down.ref index 58b44da5c21b..e4f056f7b5b6 100644 --- a/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt3_down.ref +++ b/tests/topotests/bfd_ospf_topo1/rt1/step3/show_ipv6_route_rt3_down.ref @@ -1,7 +1,7 @@ { - "::ffff:202:202\/128":[ + "::ffff:2.2.2.2\/128":[ { - "prefix":"::ffff:202:202\/128", + "prefix":"::ffff:2.2.2.2\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -16,9 +16,9 @@ ] } ], - "::ffff:303:303\/128":[ + "::ffff:3.3.3.3\/128":[ { - "prefix":"::ffff:303:303\/128", + "prefix":"::ffff:3.3.3.3\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -33,9 +33,9 @@ ] } ], - "::ffff:404:404\/128":[ + "::ffff:4.4.4.4\/128":[ { - "prefix":"::ffff:404:404\/128", + "prefix":"::ffff:4.4.4.4\/128", "protocol":"ospf6", "selected":true, "destSelected":true, @@ -50,9 +50,9 @@ ] } ], - "::ffff:505:505\/128":[ + "::ffff:5.5.5.5\/128":[ { - "prefix":"::ffff:505:505\/128", + "prefix":"::ffff:5.5.5.5\/128", "protocol":"ospf6", "selected":true, "destSelected":true, diff --git a/tests/topotests/bfd_ospf_topo1/rt1/zebra.conf b/tests/topotests/bfd_ospf_topo1/rt1/zebra.conf index 7e6f7881b4d5..bf2428e62562 100644 --- a/tests/topotests/bfd_ospf_topo1/rt1/zebra.conf +++ b/tests/topotests/bfd_ospf_topo1/rt1/zebra.conf @@ -10,7 +10,7 @@ hostname rt1 ! interface lo ip address 1.1.1.1/32 - ipv6 address ::ffff:0101:0101/128 + ipv6 address ::ffff:1.1.1.1/128 ! interface eth-rt2 ip address 10.0.1.1/24 diff --git a/tests/topotests/bfd_ospf_topo1/rt2/zebra.conf b/tests/topotests/bfd_ospf_topo1/rt2/zebra.conf index 5788e31f123a..1670c205064e 100644 --- a/tests/topotests/bfd_ospf_topo1/rt2/zebra.conf +++ b/tests/topotests/bfd_ospf_topo1/rt2/zebra.conf @@ -7,7 +7,7 @@ hostname rt2 ! interface lo ip address 2.2.2.2/32 - ipv6 address ::ffff:0202:0202/128 + ipv6 address ::ffff:2.2.2.2/128 ! interface eth-rt1 ip address 10.0.1.2/24 diff --git a/tests/topotests/bfd_ospf_topo1/rt3/zebra.conf b/tests/topotests/bfd_ospf_topo1/rt3/zebra.conf index 78eac2e15a60..d59085560f3e 100644 --- a/tests/topotests/bfd_ospf_topo1/rt3/zebra.conf +++ b/tests/topotests/bfd_ospf_topo1/rt3/zebra.conf @@ -7,7 +7,7 @@ hostname rt3 ! interface lo ip address 3.3.3.3/32 - ipv6 address ::ffff:0303:0303/128 + ipv6 address ::ffff:3.3.3.3/128 ! interface eth-rt1 ip address 10.0.2.2/24 diff --git a/tests/topotests/bfd_ospf_topo1/rt4/zebra.conf b/tests/topotests/bfd_ospf_topo1/rt4/zebra.conf index a6cb573ed878..66121662ddec 100644 --- a/tests/topotests/bfd_ospf_topo1/rt4/zebra.conf +++ b/tests/topotests/bfd_ospf_topo1/rt4/zebra.conf @@ -7,7 +7,7 @@ hostname rt4 ! interface lo ip address 4.4.4.4/32 - ipv6 address ::ffff:0404:0404/128 + ipv6 address ::ffff:4.4.4.4/128 ! interface eth-rt3 ip address 10.0.4.2/24 diff --git a/tests/topotests/bfd_ospf_topo1/rt5/zebra.conf b/tests/topotests/bfd_ospf_topo1/rt5/zebra.conf index 33473c91a3d1..d3331b5b6ca9 100644 --- a/tests/topotests/bfd_ospf_topo1/rt5/zebra.conf +++ b/tests/topotests/bfd_ospf_topo1/rt5/zebra.conf @@ -7,7 +7,7 @@ hostname rt5 ! interface lo ip address 5.5.5.5/32 - ipv6 address ::ffff:0505:0505/128 + ipv6 address ::ffff:5.5.5.5/128 ! interface eth-rt2 ip address 10.0.3.2/24 diff --git a/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py b/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py index 2d027081cb55..9dfb7fc4d90d 100644 --- a/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py +++ b/tests/topotests/bgp_evpn_rt5/test_bgp_evpn.py @@ -210,7 +210,7 @@ def test_protocols_convergence(): "vrfName": "r1-vrf-101", "nexthops": [ { - "ip": "::ffff:c0a8:6429", + "ip": "::ffff:192.168.100.41", } ], } @@ -227,8 +227,8 @@ def test_protocols_convergence(): "192.168.100.41": { "nexthopIp": "192.168.100.41", }, - "::ffff:c0a8:6429": { - "nexthopIp": "::ffff:c0a8:6429", + "::ffff:192.168.100.41": { + "nexthopIp": "::ffff:192.168.100.41", }, } } diff --git a/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py b/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py index 803b51c04327..8382fea18886 100644 --- a/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py +++ b/tests/topotests/bgp_ipv4_over_ipv6/test_rfc5549_ebgp_unnumbered_nbr.py @@ -670,7 +670,7 @@ def bgp_prefix_received_v4_mapped_v6_nh(router): { "nexthops": [ { - "ip": "::ffff:a00:501", + "ip": "::ffff:10.0.5.1", "hostname": "r1", "afi": "ipv6", "scope": "global", @@ -754,7 +754,7 @@ def bgp_prefix_received_v4_mapped_v6_nh(router): assert ( result is None ), "Testcase {} : Failed \n Error: Nexthop for prefix 11.0.20.1 \ - is not ::ffff:a00:501".format( + is not ::ffff:10.0.5.1".format( tc_name )