Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
74 changes: 74 additions & 0 deletions tests/topotests/bgp_srv6_recursive_nhop_encap/r1/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
! SPDX-License-Identifier: ISC
!
! r1 — router under test
!
! Topology:
! r1 ---eth0-eth0--- r2
!
! r1 receives 2600:1000::101/128 from r2 via IPv6 VPN with SRv6 encap and
! imports it into vrf test1. A local static IPv4 route for 198.0.0.150/32
! points at that IPv6 nexthop, triggering the recursive resolution code path
! in nexthop_set_resolved() that the fix targets.
!
hostname r1
!
interface lo
ipv6 address 2001:db8:1:1::1/128
!
interface eth0
ipv6 address 2001:db8:12::1/64
!
segment-routing
srv6
locators
locator loc1
prefix 2001:db8:1:1::/64 block-len 40 node-len 24 func-bits 16
!
!
!
!
ip forwarding
ipv6 forwarding
!
! Underlay reachability to r2's loopback (VPN BGP nexthop)
ipv6 route 2001:db8:2:2::/64 2001:db8:12::2
!
! Underlay reachability to r2's SRv6 locator (needed for kernel to forward SRv6 packets)
ipv6 route 2001:db8:3::/48 2001:db8:12::2
!
! The IPv4 route under test: NH is an IPv6 address only reachable via the
! SRv6 VPN route imported into vrf test1. No SRv6 SID is associated with
! this static route — its nexthop->nh_srv6 is NULL — which is exactly the
! condition that exposed the bug.
ip route 198.0.0.150/32 2600:1000::101 vrf test1
!
line vty
!
router bgp 65001
bgp router-id 1.1.1.1
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
neighbor 2001:db8:12::2 remote-as 65002
neighbor 2001:db8:12::2 timers 3 10
neighbor 2001:db8:12::2 timers connect 1
neighbor 2001:db8:12::2 capability extended-nexthop
!
segment-routing srv6
locator loc1
!
address-family ipv6 vpn
neighbor 2001:db8:12::2 activate
exit-address-family
!
router bgp 65001 vrf test1
bgp router-id 1.1.1.1
no bgp ebgp-requires-policy
!
address-family ipv6 unicast
! Import the SRv6 VPN route for 2600:1000::101/128 so the recursive
! nexthop of 198.0.0.150/32 can be resolved through it.
rd vpn export 65001:10
rt vpn both 0:20
import vpn
exit-address-family
!
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"198.0.0.150/32": [
{
"prefix": "198.0.0.150/32",
"protocol": "static",
"installed": true,
"nexthops": [
{
"fib": true,
"active": true,
"seg6": {
"segs": "2001:db8:3:1::"
},
"srv6EncapBehavior": "H.Encaps"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"2600:1000::101/128": [
{
"prefix": "2600:1000::101/128",
"protocol": "bgp",
"installed": true,
"nexthops": [
{
"fib": true,
"active": true,
"seg6": {
"segs": "2001:db8:3:1::"
},
"srv6EncapBehavior": "H.Encaps"
}
]
}
]
}
66 changes: 66 additions & 0 deletions tests/topotests/bgp_srv6_recursive_nhop_encap/r2/frr.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
! SPDX-License-Identifier: ISC
!
! r2 — peer / origin router
!
! r2 exports 2600:1000::101/128 from vrf test1 as an IPv6 VPN route with an
! SRv6 SID drawn from locator 2001:db8:3::/48. r1 imports this route into
! its own vrf test1 so the recursive resolution of 198.0.0.150/32 goes
! through a nexthop that carries SRv6 encapsulation information.
!
hostname r2
!
interface lo
ipv6 address 2001:db8:2:2::1/128
!
interface eth0
ipv6 address 2001:db8:12::2/64
!
segment-routing
srv6
locators
locator loc1
prefix 2001:db8:3::/48 block-len 32 node-len 16 func-bits 16
!
!
!
!
ip forwarding
ipv6 forwarding
!
! Underlay reachability to r1's loopback
ipv6 route 2001:db8:1:1::/64 2001:db8:12::1
!
! The SRv6 VPN destination address: exported to r1 with an SRv6 SID so that
! r1's recursive resolution of 198.0.0.150/32 finds a nexthop with nh_srv6.
ipv6 route 2600:1000::101/128 Null0 vrf test1
!
line vty
!
router bgp 65002
bgp router-id 2.2.2.2
no bgp ebgp-requires-policy
no bgp default ipv4-unicast
neighbor 2001:db8:12::1 remote-as 65001
neighbor 2001:db8:12::1 timers 3 10
neighbor 2001:db8:12::1 timers connect 1
neighbor 2001:db8:12::1 capability extended-nexthop
!
segment-routing srv6
locator loc1
!
address-family ipv6 vpn
neighbor 2001:db8:12::1 activate
exit-address-family
!
router bgp 65002 vrf test1
bgp router-id 2.2.2.2
no bgp ebgp-requires-policy
!
address-family ipv6 unicast
redistribute static
sid vpn export 1
rd vpn export 65002:20
rt vpn both 0:20
export vpn
exit-address-family
!
Loading
Loading