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

zebra: copy nexthop_srv6 in nexthop_set_resolved #9593

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

proelbtn
Copy link
Contributor

@proelbtn proelbtn commented Sep 9, 2021

Current implementation doesn't copy nexthop_srv6. This causes unexpected behavior when receiving SID information and nexthop isn't onlink.

For example:

Here is the example of unexpected behaviors. First nexthop of 172.31.2.0/24 has nexthop_srv6 correctly, but Second nexthop doesn't have. so SRv6 encap rule doesn't installed correctly when this route is installed into kernel.

r1# show ip route vrf vrf100
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF vrf100:
C>* 172.31.1.0/24 is directly connected, ens2, 01:49:02
B>  172.31.2.0/24 [20/0] via fc00::2 (vrf default) (recursive), label 1024, seg6local unspec unknown(seg6local_context2str), seg6 2001:db8:2::, weight 1, 01:48:31
  *                        via 2001:db8::2, ens8 (vrf default), label 1024, weight 1, 01:48:31

@frrbot frrbot bot added the bgp label Sep 9, 2021
@LabN-CI
Copy link
Collaborator

LabN-CI commented Sep 9, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/9593 ebcc8fb
Date 09/09/2021
Start 05:55:59
Finish 06:22:12
Run-Time 26:13
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-09-09-05:55:59.txt
Log autoscript-2021-09-09-05:57:15.log.bz2
Memory 505 514 425

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Sep 9, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-108/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

CentOS 7 rpm pkg check: Failed (click for details) CentOS 7 rpm pkg check: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-108/artifact/CENTOS7RPM/ErrorLog/log_restart.txt CentOS 7 rpm pkg check: No useful log found
Successful on other platforms/tests
  • Topotests debian 10 amd64 part 9
  • Addresssanitizer topotests part 4
  • Topotests Ubuntu 18.04 i386 part 7
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests debian 10 amd64 part 4
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests debian 10 amd64 part 3
  • Topotests debian 10 amd64 part 8
  • Addresssanitizer topotests part 0
  • Topotests Ubuntu 18.04 amd64 part 2
  • Topotests Ubuntu 18.04 arm8 part 4
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 9
  • Addresssanitizer topotests part 2
  • Topotests Ubuntu 18.04 i386 part 6
  • Debian 10 deb pkg check
  • IPv6 protocols on Ubuntu 18.04
  • IPv4 ldp protocol on Ubuntu 18.04
  • Ubuntu 16.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 5
  • Topotests Ubuntu 18.04 amd64 part 4
  • IPv4 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 i386 part 1
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 i386 part 3
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 arm8 part 2
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests debian 10 amd64 part 0
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 amd64 part 9
  • Topotests Ubuntu 18.04 i386 part 0
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 arm8 part 5
  • Fedora 29 rpm pkg check
  • Topotests debian 10 amd64 part 1
  • Topotests debian 10 amd64 part 2
  • Topotests debian 10 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests Ubuntu 18.04 amd64 part 0
  • Static analyzer (clang)
  • Topotests Ubuntu 18.04 i386 part 5
  • Ubuntu 18.04 deb pkg check
  • Debian 9 deb pkg check
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 amd64 part 1
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 i386 part 2
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests Ubuntu 18.04 arm8 part 6
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests debian 10 amd64 part 5
  • Topotests Ubuntu 18.04 arm8 part 8

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Sep 9, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-109/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

CentOS 7 rpm pkg check: Failed (click for details) CentOS 7 rpm pkg check: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-109/artifact/CENTOS7RPM/ErrorLog/log_restart.txt CentOS 7 rpm pkg check: No useful log found
Successful on other platforms/tests
  • Addresssanitizer topotests part 4
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests debian 10 amd64 part 9
  • Addresssanitizer topotests part 5
  • Topotests debian 10 amd64 part 4
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests debian 10 amd64 part 8
  • IPv6 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 amd64 part 2
  • Topotests debian 10 amd64 part 3
  • Addresssanitizer topotests part 0
  • Topotests Ubuntu 18.04 arm8 part 4
  • Topotests Ubuntu 18.04 arm8 part 9
  • Addresssanitizer topotests part 2
  • Topotests Ubuntu 18.04 amd64 part 5
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 6
  • IPv4 ldp protocol on Ubuntu 18.04
  • Debian 10 deb pkg check
  • Ubuntu 16.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 4
  • IPv4 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 i386 part 1
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 amd64 part 9
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 i386 part 3
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 2
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests debian 10 amd64 part 0
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 i386 part 0
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests debian 10 amd64 part 1
  • Fedora 29 rpm pkg check
  • Topotests debian 10 amd64 part 2
  • Topotests debian 10 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests Ubuntu 18.04 amd64 part 0
  • Static analyzer (clang)
  • Topotests Ubuntu 18.04 i386 part 5
  • Ubuntu 18.04 deb pkg check
  • Topotests debian 10 amd64 part 5
  • Debian 9 deb pkg check
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 amd64 part 1
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 i386 part 2
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests debian 10 amd64 part 6
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests Ubuntu 18.04 i386 part 7
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests Ubuntu 18.04 arm8 part 8

@proelbtn
Copy link
Contributor Author

proelbtn commented Sep 9, 2021

ci:rerun

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Sep 9, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-115/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Failed

Ubuntu 16.04 i386 build: Failed (click for details) Ubuntu 16.04 i386 build: No useful log found
Successful on other platforms/tests
  • Ubuntu 16.04 amd64 build
  • Ubuntu 16.04 arm8 build
  • Ubuntu 18.04 amd64 build
  • Ubuntu 18.04 i386 build
  • CentOS 7 amd64 build
  • Ubuntu 18.04 arm7 build
  • NetBSD 8 amd64 build
  • CentOS 8 amd64 build
  • Debian 11 amd64 build
  • FreeBSD 12 amd64 build
  • OpenBSD 6 amd64 build
  • Fedora 29 amd64 build
  • Ubuntu 18.04 arm8 build
  • Debian 9 amd64 build
  • Debian 10 amd64 build
  • FreeBSD 11 amd64 build
  • Ubuntu 20.04 amd64 build
  • Ubuntu 18.04 ppc64le build
  • Ubuntu 16.04 arm7 build

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Sep 9, 2021

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-109/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@donaldsharp
Copy link
Member

the subject line of the commit should be zebra: ... instead of bgp as that this is a change in zebra

Current implementation doesn't copy nexthop_srv6. This causes unexpected
behavior when receiving SID information and nexthop isn't onlink.t

Signed-off-by: Ryoga Saito <contact@proelbtn.com>
@frrbot frrbot bot added the zebra label Sep 10, 2021
@proelbtn proelbtn changed the title bgpd: copy nexthop_srv6 in nexthop_set_resolved zebra: copy nexthop_srv6 in nexthop_set_resolved Sep 10, 2021
@proelbtn
Copy link
Contributor Author

@donaldsharp Sorry, I fixed it.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Sep 10, 2021

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/9593 24b3c59
Date 09/10/2021
Start 18:30:59
Finish 18:57:15
Run-Time 26:16
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-09-10-18:30:59.txt
Log autoscript-2021-09-10-18:32:14.log.bz2
Memory 493 515 426

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-133/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@donaldsharp
Copy link
Member

Can I get a quick/dirty setup that shows this problem? I'd like to understand it better and am not sure how to set this up

@proelbtn
Copy link
Contributor Author

@donaldsharp Easiest way to create an environment for this issue I thought is to reuse bgp_srv6l3vpn_to_bgp_vrf topotest, Here is the patch to show this issue:

diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf
index d07d0532e..7a03a81fa 100644
--- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf
+++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/bgpd.conf
@@ -22,12 +22,13 @@ router bgp 1
  bgp router-id 1.1.1.1
  no bgp ebgp-requires-policy
  no bgp default ipv4-unicast
- neighbor 2001::2 remote-as 2
- neighbor 2001::2 timers 3 10
- neighbor 2001::2 timers connect 1
+ neighbor fc00::2 remote-as 1
+ neighbor fc00::2 timers 3 10
+ neighbor fc00::2 timers connect 1
+ neighbor fc00::2 update-source fc00::1
  !
  address-family ipv6 vpn
-  neighbor 2001::2 activate
+  neighbor fc00::2 activate
  exit-address-family
  !
  segment-routing srv6
diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf
index ec3687036..2b4deb5a9 100644
--- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf
+++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r1/zebra.conf
@@ -11,6 +11,9 @@ debug zebra packet
 debug zebra dplane
 debug zebra kernel
 !
+interface lo
+ ipv6 address fc00::1/128
+!
 interface eth0
  ipv6 address 2001::1/64
 !
@@ -34,6 +37,7 @@ segment-routing
 ip forwarding
 ipv6 forwarding
 !
+ipv6 route fc00::2/128 2001::2
 ipv6 route 2001:db8:2:2::/64 2001::2
 !
 line vty
diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf
index d0b3ea8ad..06dcd1839 100644
--- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf
+++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/bgpd.conf
@@ -19,16 +19,17 @@ log commands
 !debug bgp vpn leak-to-vrf
 !debug bgp vpn rmap-event
 !
-router bgp 2
+router bgp 1
  bgp router-id 2.2.2.2
  no bgp ebgp-requires-policy
  no bgp default ipv4-unicast
- neighbor 2001::1 remote-as 1
- neighbor 2001::1 timers 3 10
- neighbor 2001::1 timers connect 1
+ neighbor fc00::1 remote-as 1
+ neighbor fc00::1 timers 3 10
+ neighbor fc00::1 timers connect 1
+ neighbor fc00::1 update-source fc00::2
  !
  address-family ipv6 vpn
-  neighbor 2001::1 activate
+  neighbor fc00::1 activate
  exit-address-family
  !
  segment-routing srv6
diff --git a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf
index f3e025d23..b2e3dfd31 100644
--- a/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf
+++ b/tests/topotests/bgp_srv6l3vpn_to_bgp_vrf/r2/zebra.conf
@@ -11,6 +11,9 @@ debug zebra packet
 debug zebra dplane
 debug zebra kernel
 !
+interface lo
+ ipv6 address fc00::2/128
+!
 interface eth0
  ipv6 address 2001::2/64
 !
@@ -34,6 +37,7 @@ segment-routing
 ip forwarding
 ipv6 forwarding
 !
+ipv6 route fc00::1/128 2001::1
 ipv6 route 2001:db8:1:1::/64 2001::1
 !
 line vty

Here is the result of show ipv6 route vrf vrf10 before applying this patch (master branch). Resolved route for 2001:2::/64 doesn't have seg6 information, resulting in incorrect route insertion.

------ Host: r1 ------
DEBUG:topolog.r1:LinuxNamespace(r1): cmd_status("['/bin/bash', '-c', 'vtysh -c "show ipv6 route vrf vrf10"']", kwargs: {'encoding': 'utf-8', 'stdout': -1, 'stderr': -2, 'shell': False, 'stdin': None})
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF vrf10:
C>* 2001:1::/64 is directly connected, eth1, 00:00:25
B>  2001:2::/64 [20/0] via fc00::2 (vrf default) (recursive), label implicit-null, seg6local unspec unknown(seg6local_context2str), seg6 2001:db8:2:2::100, weight 1, 00:00:22
  *                      via 2001::2, eth0 (vrf default), label implicit-null, weight 1, 00:00:22
C>* 2001:3::/64 is directly connected, eth2, 00:00:25
C * fe80::/64 is directly connected, eth1, 00:00:25
C * fe80::/64 is directly connected, eth2, 00:00:25
C>* fe80::/64 is directly connected, vrf10, 00:00:26
------- End: r1 ------

Here is the result of show ipv6 route vrf vrf10 after applying this patch (proelbtn:fix-recursive-seg6 branch). Resolved route for 2001:2::/64 has seg6 information correctly.

------ Host: r1 ------
DEBUG:topolog.r1:LinuxNamespace(r1): cmd_status("['/bin/bash', '-c', 'vtysh -c "show ipv6 route vrf vrf10"']", kwargs: {'encoding': 'utf-8', 'stdout': -1, 'stderr': -2, 'shell': False, 'stdin': None})
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

VRF vrf10:
C>* 2001:1::/64 is directly connected, eth1, 00:00:35
B>  2001:2::/64 [20/0] via fc00::2 (vrf default) (recursive), label implicit-null, seg6local unspec unknown(seg6local_context2str), seg6 2001:db8:2:2::100, weight 1, 00:00:32
  *                      via 2001::2, eth0 (vrf default), label implicit-null, seg6local unspec unknown(seg6local_context2str), seg6 2001:db8:2:2::100, weight 1, 00:00:32
C>* 2001:3::/64 is directly connected, eth2, 00:00:35
C * fe80::/64 is directly connected, eth2, 00:00:35
C * fe80::/64 is directly connected, eth1, 00:00:36
C>* fe80::/64 is directly connected, vrf10, 00:00:37
------- End: r1 ------

Copy link
Member

@sworleys sworleys left a comment

Choose a reason for hiding this comment

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

Not an srv6 expert but this makes sense to me assuming srv6 is expected to recursively resolve.

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 riw777 merged commit b8c6d0b into FRRouting:master Sep 14, 2021
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.

6 participants