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

ospf6d: Limit the number of interface addresses being supported in ospfv3 #8622

Merged
merged 2 commits into from May 12, 2021
Merged

ospf6d: Limit the number of interface addresses being supported in ospfv3 #8622

merged 2 commits into from May 12, 2021

Conversation

lynne-volta
Copy link
Contributor

The code had no limits on addresses configured on an interface running
ospfv3. The code would crash when more than 100 addresses were added.
This change limits the number of interface address to 100 if mtu is set
to the default value. If the mtu is set to a jumbo packet size or larger
we will support 200 interface addresses.

Signed-off-by: Lynne Morrison lynne@voltanet.io

@lynne-volta
Copy link
Contributor Author

this fix addresses issue 5773

@LabN-CI
Copy link
Collaborator

LabN-CI commented May 4, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/8622 7216887
Date 05/04/2021
Start 13:47:50
Finish 14:13:46
Run-Time 25:56
Total 1815
Pass 1815
Fail 0
Valgrind-Errors
Valgrind-Loss
Details vncregress-2021-05-04-13:47:50.txt
Log autoscript-2021-05-04-13:49:15.log.bz2
Memory 498 507 424

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented May 4, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

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

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

Topotests Ubuntu 18.04 arm8 part 1: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 1: No useful log found
Successful on other platforms/tests
  • CentOS 7 rpm pkg check
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests Ubuntu 18.04 amd64 part 9
  • Addresssanitizer topotests part 2
  • Fedora 29 rpm pkg check
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests Ubuntu 18.04 i386 part 2
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests debian 10 amd64 part 5
  • Topotests Ubuntu 18.04 i386 part 7
  • Topotests debian 10 amd64 part 1
  • Topotests Ubuntu 18.04 i386 part 3
  • Addresssanitizer topotests part 4
  • Topotests Ubuntu 18.04 arm8 part 7
  • Addresssanitizer topotests part 9
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 amd64 part 0
  • Ubuntu 16.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 2
  • Addresssanitizer topotests part 5
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests debian 10 amd64 part 2
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests Ubuntu 18.04 arm8 part 0
  • Ubuntu 18.04 deb pkg check
  • Addresssanitizer topotests part 0
  • Topotests debian 10 amd64 part 4
  • Topotests Ubuntu 18.04 amd64 part 1
  • Static analyzer (clang)
  • IPv6 protocols on Ubuntu 18.04
  • Addresssanitizer topotests part 3
  • Topotests debian 10 amd64 part 3
  • Addresssanitizer topotests part 1
  • Topotests debian 10 amd64 part 8
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests Ubuntu 18.04 amd64 part 5
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 amd64 part 4
  • Topotests Ubuntu 18.04 arm8 part 6
  • IPv4 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 2
  • Debian 10 deb pkg check
  • Topotests debian 10 amd64 part 7
  • Addresssanitizer topotests part 6
  • Ubuntu 20.04 deb pkg check
  • IPv4 ldp protocol on Ubuntu 18.04
  • Debian 9 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 4
  • Topotests Ubuntu 18.04 arm8 part 9
  • Topotests Ubuntu 18.04 i386 part 0
  • Topotests debian 10 amd64 part 9
  • Topotests Ubuntu 18.04 i386 part 5

Warnings Generated during build:

Checkout code: Successful with additional warnings
Topotests Ubuntu 18.04 arm8 part 1: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 1: No useful log found
Report for ospf6_interface.h | 2 issues
===============================================
< WARNING: function definition argument 'struct connected *' should also have an identifier name
< #191: FILE: /tmp/f1-12904/ospf6_interface.h:191:

CLANG Static Analyzer Summary

  • Github Pull Request 8622, comparing to Git base SHA 52a65a8

No Changes in Static Analysis warnings compared to base

2 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18805/artifact/shared/static_analysis/index.html

@LabN-CI
Copy link
Collaborator

LabN-CI commented May 4, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/8622 ef2e95a
Date 05/04/2021
Start 18:12:39
Finish 18:38:12
Run-Time 25:33
Total 1815
Pass 1815
Fail 0
Valgrind-Errors
Valgrind-Loss
Details vncregress-2021-05-04-18:12:39.txt
Log autoscript-2021-05-04-18:13:49.log.bz2
Memory 509 503 429

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented May 5, 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-FRRPULLREQ-18819/

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.

Warnings Generated during build:

Checkout code: Successful with additional warnings
Report for ospf6_interface.h | 2 issues
===============================================
< WARNING: function definition argument 'struct connected *' should also have an identifier name
< #191: FILE: /tmp/f1-30757/ospf6_interface.h:191:

CLANG Static Analyzer Summary

  • Github Pull Request 8622, comparing to Git base SHA bc79672

No Changes in Static Analysis warnings compared to base

2 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18819/artifact/shared/static_analysis/index.html

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.

Two other questions, neither of which might be important. :-)

Should there be some note in the docs about this limit?

What happens if the user reduces the MTU on an interface from jumbo to something smaller and there are too many addresses? Should there be a warning and the user not be allowed to reduce the MTU? Or should we print a warning and intentionally crash (since we're going to crash anyway)?

ospf6d/ospf6_top.c Show resolved Hide resolved
@lynne-volta
Copy link
Contributor Author

If you reduce the MTU we will go back to only advertising the first 100 addresses added on the interface.

Yes I agree that this limit should be documented. I will add that.

The code had no limits on addresses configured on an interface running
ospf6d.  The code would crash when more than 100 addresses were added.
This change limits the number of interface address to 100 if mtu is set
to the default value.  If the mtu is set to a jumbo packet size or larger
we will support 200 interface addresses.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
Signed-off-by: Lynne Morrison <lynne@voltanet.io>
@LabN-CI
Copy link
Collaborator

LabN-CI commented May 11, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git pull/8622 0da671d (merge failed)
Date 05/11/2021
Start 09:43:04
Finish 10:08:37
Run-Time 25:33
Total 1815
Pass 1815
Fail 0
Valgrind-Errors
Valgrind-Loss
Details vncregress-2021-05-11-09:43:04.txt
Log autoscript-2021-05-11-09:44:10.log.bz2
Memory 516 518 428

For details, please contact louberger

@LabN-CI
Copy link
Collaborator

LabN-CI commented May 11, 2021

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/8622 9160389
Date 05/11/2021
Start 10:10:53
Finish 10:36:13
Run-Time 25:20
Total 1815
Pass 1815
Fail 0
Valgrind-Errors
Valgrind-Loss
Details vncregress-2021-05-11-10:10:53.txt
Log autoscript-2021-05-11-10:12:00.log.bz2
Memory 517 515 428

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented May 11, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

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

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

Topotests Ubuntu 18.04 amd64 part 6: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO6U18AMD64-18936/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 6:

*** defaultIntf: warning: r1 has no interfaces
2021-05-11 14:15:52,454 ERROR: 'router_json_cmp' failed after 121.47 seconds
2021-05-11 14:15:52,456 ERROR: assert failed at "bgp_vrf_lite_ipv6_rtadv.test_bgp_vrf_lite_ipv6_rtadv/test_protocols_convergence": "r2" JSON output mismatches
assert Generated JSON diff error report:
  
  > $: d2 has key '10.254.254.1/32' which is not present in d1

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18936/artifact/TOPO6U18AMD64/ErrorLog/log_topotests.txt

Topotests debian 10 amd64 part 9: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9DEB10AMD64-18936/test

Topology Tests failed for Topotests debian 10 amd64 part 9:

2021-05-11 13:54:18,530 ERROR: 'router_json_cmp' failed after 97.81 seconds
2021-05-11 13:54:18,533 ERROR: assert failed at "test_ospf_sr_topo1/test_rib_ipv4_step4": "rt6" JSON output mismatches the expected result
assert Generated JSON diff error report:
  
  > $->10.0.7.0/24: d2 has the following element at index 0 which is not present in d1: 
  
  	{
  	    "distance": 110,
  	    "prefix": "10.0.7.0/24",
  	    "protocol": "ospf",
  	    "metric": 10,
  	    "nexthops": [
  	        {
  	            "active": true,
  	            "directlyConnected": true,
  	            "interfaceName": "eth-rt4"
  	        }
  	    ]
  	}
  
  	Closest match in d1 is at index 0 with the following errors: 
  
  	> $->10.0.7.0/24[0]->nexthops: d2 has the following element at index 0 which is not present in d1: 
  	
  		{
  		    "active": true,
  		    "directlyConnected": true,
  		    "interfaceName": "eth-rt4"
  		}
  	
  		Closest match in d1 is at index 0 with the following errors: 
  	
  		> $->10.0.7.0/24[0]->nexthops[0]: d2 has key 'active' which is not present in d1
  	
  
2021-05-11 14:04:22,235 WARNING: vtysh_cmd: failed to convert json output
2021-05-11 14:04:45,793 WARNING: vtysh_cmd: failed to convert json output
2021-05-11 14:15:00,859 ERROR: r1: zebra left a dead pidfile (pid=32376)
2021-05-11 14:16:17,013 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 1802, in create_interfaces_cfg
    tgen, c_router, interface_data, "interface_config", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 3: % Unknown command[16]: ip ospf hello-interval 65536 


2021-05-11 14:16:51,704 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 1802, in create_interfaces_cfg
    tgen, c_router, interface_data, "interface_config", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 3: % Unknown command[16]: ip ospf dead-interval 65536 

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18936/artifact/TOPO9DEB10AMD64/ErrorLog/log_topotests.txt

Successful on other platforms/tests
  • Topotests Ubuntu 18.04 amd64 part 8
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 amd64 part 9
  • Addresssanitizer topotests part 2
  • Topotests Ubuntu 18.04 i386 part 3
  • Fedora 29 rpm pkg check
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests debian 10 amd64 part 5
  • Topotests debian 10 amd64 part 1
  • Topotests Ubuntu 18.04 i386 part 7
  • Topotests debian 10 amd64 part 6
  • Addresssanitizer topotests part 7
  • Topotests debian 10 amd64 part 0
  • Addresssanitizer topotests part 4
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests Ubuntu 18.04 i386 part 2
  • Static analyzer (clang)
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 amd64 part 2
  • Topotests Ubuntu 18.04 i386 part 4
  • Ubuntu 16.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 0
  • Topotests debian 10 amd64 part 2
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 arm8 part 0
  • Addresssanitizer topotests part 0
  • Topotests Ubuntu 18.04 arm8 part 5
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 1
  • Topotests debian 10 amd64 part 4
  • CentOS 7 rpm pkg check
  • Topotests debian 10 amd64 part 8
  • Topotests debian 10 amd64 part 3
  • IPv6 protocols on Ubuntu 18.04
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 amd64 part 5
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests Ubuntu 18.04 amd64 part 4
  • IPv4 protocols on Ubuntu 18.04
  • Topotests Ubuntu 18.04 arm8 part 6
  • Topotests Ubuntu 18.04 arm8 part 1
  • Addresssanitizer topotests part 3
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests debian 10 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 2
  • Addresssanitizer topotests part 6
  • IPv4 ldp protocol on Ubuntu 18.04
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 0
  • Debian 9 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 5
  • Topotests Ubuntu 18.04 arm8 part 4
  • Topotests Ubuntu 18.04 arm8 part 9
  • Debian 10 deb pkg check

Warnings Generated during build:

Checkout code: Successful with additional warnings
Topotests Ubuntu 18.04 amd64 part 6: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO6U18AMD64-18936/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 6:

*** defaultIntf: warning: r1 has no interfaces
2021-05-11 14:15:52,454 ERROR: 'router_json_cmp' failed after 121.47 seconds
2021-05-11 14:15:52,456 ERROR: assert failed at "bgp_vrf_lite_ipv6_rtadv.test_bgp_vrf_lite_ipv6_rtadv/test_protocols_convergence": "r2" JSON output mismatches
assert Generated JSON diff error report:
  
  > $: d2 has key '10.254.254.1/32' which is not present in d1

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18936/artifact/TOPO6U18AMD64/ErrorLog/log_topotests.txt

Topotests debian 10 amd64 part 9: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9DEB10AMD64-18936/test

Topology Tests failed for Topotests debian 10 amd64 part 9:

2021-05-11 13:54:18,530 ERROR: 'router_json_cmp' failed after 97.81 seconds
2021-05-11 13:54:18,533 ERROR: assert failed at "test_ospf_sr_topo1/test_rib_ipv4_step4": "rt6" JSON output mismatches the expected result
assert Generated JSON diff error report:
  
  > $->10.0.7.0/24: d2 has the following element at index 0 which is not present in d1: 
  
  	{
  	    "distance": 110,
  	    "prefix": "10.0.7.0/24",
  	    "protocol": "ospf",
  	    "metric": 10,
  	    "nexthops": [
  	        {
  	            "active": true,
  	            "directlyConnected": true,
  	            "interfaceName": "eth-rt4"
  	        }
  	    ]
  	}
  
  	Closest match in d1 is at index 0 with the following errors: 
  
  	> $->10.0.7.0/24[0]->nexthops: d2 has the following element at index 0 which is not present in d1: 
  	
  		{
  		    "active": true,
  		    "directlyConnected": true,
  		    "interfaceName": "eth-rt4"
  		}
  	
  		Closest match in d1 is at index 0 with the following errors: 
  	
  		> $->10.0.7.0/24[0]->nexthops[0]: d2 has key 'active' which is not present in d1
  	
  
2021-05-11 14:04:22,235 WARNING: vtysh_cmd: failed to convert json output
2021-05-11 14:04:45,793 WARNING: vtysh_cmd: failed to convert json output
2021-05-11 14:15:00,859 ERROR: r1: zebra left a dead pidfile (pid=32376)
2021-05-11 14:16:17,013 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 1802, in create_interfaces_cfg
    tgen, c_router, interface_data, "interface_config", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 3: % Unknown command[16]: ip ospf hello-interval 65536 


2021-05-11 14:16:51,704 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 1802, in create_interfaces_cfg
    tgen, c_router, interface_data, "interface_config", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 3: % Unknown command[16]: ip ospf dead-interval 65536 

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18936/artifact/TOPO9DEB10AMD64/ErrorLog/log_topotests.txt

<stdin>:18: trailing whitespace.
  
<stdin>:17: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
Report for ospf6_interface.h | 2 issues
===============================================
< WARNING: function definition argument 'struct connected *' should also have an identifier name
< #191: FILE: /tmp/f1-29849/ospf6_interface.h:191:

CLANG Static Analyzer Summary

  • Github Pull Request 8622, comparing to Git base SHA bc79672

No Changes in Static Analysis warnings compared to base

2 Static Analyzer issues remaining.

See details at
https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18936/artifact/shared/static_analysis/index.html

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented May 11, 2021

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

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

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

Topotests debian 10 amd64 part 9: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9DEB10AMD64-18939/test

Topology Tests failed for Topotests debian 10 amd64 part 9:

2021-05-11 14:41:24,424 ERROR: 'router_json_cmp' failed after 92.21 seconds
2021-05-11 14:41:24,428 ERROR: assert failed at "test_ospf_sr_topo1/test_rib_ipv4_step4": "rt6" JSON output mismatches the expected result
assert Generated JSON diff error report:
  
  > $->10.0.7.0/24: d2 has the following element at index 0 which is not present in d1: 
  
  	{
  	    "distance": 110,
  	    "prefix": "10.0.7.0/24",
  	    "protocol": "ospf",
  	    "metric": 10,
  	    "nexthops": [
  	        {
  	            "active": true,
  	            "directlyConnected": true,
  	            "interfaceName": "eth-rt4"
  	        }
  	    ]
  	}
  
  	Closest match in d1 is at index 0 with the following errors: 
  
  	> $->10.0.7.0/24[0]->nexthops: d2 has the following element at index 0 which is not present in d1: 
  	
  		{
  		    "active": true,
  		    "directlyConnected": true,
  		    "interfaceName": "eth-rt4"
  		}
  	
  		Closest match in d1 is at index 0 with the following errors: 
  	
  		> $->10.0.7.0/24[0]->nexthops[0]: d2 has key 'active' which is not present in d1
  	
  
2021-05-11 14:51:58,280 WARNING: vtysh_cmd: failed to convert json output
2021-05-11 14:52:22,730 WARNING: vtysh_cmd: failed to convert json output
2021-05-11 15:04:12,822 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 1802, in create_interfaces_cfg
    tgen, c_router, interface_data, "interface_config", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 3: % Unknown command[16]: ip ospf hello-interval 65536 


2021-05-11 15:04:41,085 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 1802, in create_interfaces_cfg
    tgen, c_router, interface_data, "interface_config", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 3: % Unknown command[16]: ip ospf dead-interval 65536 

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18939/artifact/TOPO9DEB10AMD64/ErrorLog/log_topotests.txt

Successful on other platforms/tests
  • Topotests Ubuntu 18.04 amd64 part 9
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests debian 10 amd64 part 5
  • Fedora 29 rpm pkg check
  • Topotests debian 10 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 3
  • Topotests debian 10 amd64 part 6
  • Addresssanitizer topotests part 4
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 i386 part 7
  • Topotests Ubuntu 18.04 i386 part 2
  • Topotests debian 10 amd64 part 1
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 i386 part 4
  • Static analyzer (clang)
  • Topotests Ubuntu 18.04 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 arm8 part 0
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests debian 10 amd64 part 2
  • Ubuntu 16.04 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 5
  • Topotests Ubuntu 18.04 i386 part 6
  • Ubuntu 18.04 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 1
  • Topotests Ubuntu 18.04 arm8 part 3
  • Topotests Ubuntu 18.04 amd64 part 2
  • Topotests debian 10 amd64 part 4
  • CentOS 7 rpm pkg check
  • Addresssanitizer topotests part 0
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests debian 10 amd64 part 3
  • IPv6 protocols on Ubuntu 18.04
  • Addresssanitizer topotests part 1
  • Topotests debian 10 amd64 part 8
  • Topotests Ubuntu 18.04 i386 part 1
  • Topotests Ubuntu 18.04 amd64 part 5
  • Topotests Ubuntu 18.04 arm8 part 8
  • Topotests Ubuntu 18.04 amd64 part 4
  • IPv4 protocols on Ubuntu 18.04
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 arm8 part 6
  • Addresssanitizer topotests part 3
  • Topotests debian 10 amd64 part 7
  • Topotests Ubuntu 18.04 arm8 part 1
  • Topotests Ubuntu 18.04 arm8 part 7
  • Topotests Ubuntu 18.04 arm8 part 2
  • Topotests Ubuntu 18.04 amd64 part 7
  • Addresssanitizer topotests part 6
  • Topotests Ubuntu 18.04 arm8 part 4
  • Addresssanitizer topotests part 2
  • Ubuntu 20.04 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 0
  • Topotests Ubuntu 18.04 i386 part 5
  • Debian 9 deb pkg check
  • Topotests Ubuntu 18.04 arm8 part 9
  • IPv4 ldp protocol on Ubuntu 18.04
  • Debian 10 deb pkg check
  • Topotests Ubuntu 18.04 amd64 part 8

Warnings Generated during build:

Checkout code: Successful with additional warnings
Topotests debian 10 amd64 part 9: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-TOPO9DEB10AMD64-18939/test

Topology Tests failed for Topotests debian 10 amd64 part 9:

2021-05-11 14:41:24,424 ERROR: 'router_json_cmp' failed after 92.21 seconds
2021-05-11 14:41:24,428 ERROR: assert failed at "test_ospf_sr_topo1/test_rib_ipv4_step4": "rt6" JSON output mismatches the expected result
assert Generated JSON diff error report:
  
  > $->10.0.7.0/24: d2 has the following element at index 0 which is not present in d1: 
  
  	{
  	    "distance": 110,
  	    "prefix": "10.0.7.0/24",
  	    "protocol": "ospf",
  	    "metric": 10,
  	    "nexthops": [
  	        {
  	            "active": true,
  	            "directlyConnected": true,
  	            "interfaceName": "eth-rt4"
  	        }
  	    ]
  	}
  
  	Closest match in d1 is at index 0 with the following errors: 
  
  	> $->10.0.7.0/24[0]->nexthops: d2 has the following element at index 0 which is not present in d1: 
  	
  		{
  		    "active": true,
  		    "directlyConnected": true,
  		    "interfaceName": "eth-rt4"
  		}
  	
  		Closest match in d1 is at index 0 with the following errors: 
  	
  		> $->10.0.7.0/24[0]->nexthops[0]: d2 has key 'active' which is not present in d1
  	
  
2021-05-11 14:51:58,280 WARNING: vtysh_cmd: failed to convert json output
2021-05-11 14:52:22,730 WARNING: vtysh_cmd: failed to convert json output
2021-05-11 15:04:12,822 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 1802, in create_interfaces_cfg
    tgen, c_router, interface_data, "interface_config", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 3: % Unknown command[16]: ip ospf hello-interval 65536 


2021-05-11 15:04:41,085 ERROR: Traceback (most recent call last):
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 1802, in create_interfaces_cfg
    tgen, c_router, interface_data, "interface_config", build=build
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 344, in create_common_configuration
    load_config_to_router(tgen, router)
  File "/root/bamboo-agent-home/xml-data/build-dir/FRR-FRRPULLREQ-TOPO9DEB10AMD64/topotests/lib/common_config.py", line 605, in load_config_to_router
    raise InvalidCLIError("%s" % output)
InvalidCLIError: line 3: % Unknown command[16]: ip ospf dead-interval 65536 

see full log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-18939/artifact/TOPO9DEB10AMD64/ErrorLog/log_topotests.txt

<stdin>:18: trailing whitespace.
  
<stdin>:17: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
Report for ospf6_interface.h | 2 issues
===============================================
< WARNING: function definition argument 'struct connected *' should also have an identifier name
< #191: FILE: /tmp/f1-1304/ospf6_interface.h:191:

@riw777
Copy link
Member

riw777 commented May 11, 2021

ci:rerun

@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-FRRPULLREQ-18942/

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.

Warnings Generated during build:

Checkout code: Successful with additional warnings
<stdin>:18: trailing whitespace.
  
<stdin>:17: new blank line at EOF.
+
warning: 2 lines add whitespace errors.
Report for ospf6_interface.h | 2 issues
===============================================
< WARNING: function definition argument 'struct connected *' should also have an identifier name
< #191: FILE: /tmp/f1-25870/ospf6_interface.h:191:

@riw777 riw777 merged commit 6158f83 into FRRouting:master May 12, 2021
@eqvinox
Copy link
Contributor

eqvinox commented Jun 29, 2021

So I stumbled on this while doing other work and sorry to say but it's just wrong in several places and on several levels :(.

To begin with, the entire approach is not correct. When there are too many addresses to fit into one LSA, a second intra-prefix LSA should just be added with the next batch of addresses. And another if that's still not enough. (Bonus points for an implementation that does this without fragment wandering.)

But even if we wanted to limit addresses, the code has several issues; adding separate comments for that on the code itself.

I'll also open a PR to revert this shortly. (Yes that might get us back to a crash, but whether this is better is debatable since it could [rarely] break the entire network rather than just one router.)

* size of OSPFv3 packet
*/
count++;
if (count >= max_addr_count)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is absolutely the wrong place to do a check like this; oi->route_connected is just an internal table of prefixes. There's no semantic connection to LSAs just yet.

for (route = ospf6_route_head(oi->route_connected); route;
route = ospf6_route_next(route)) {
/* connected prefix to advertise, number of interface addresses
* supported is based on MTU size of OSPFv3 packets
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be the only place where limiting the number of addresses is correct; RFC5340 suggests only one Link LSA for each link. However, looking at the MTU is still wrong - https://datatracker.ietf.org/doc/html/rfc5340#appendix-A.1 clearly suggests that OSPFv3 should just rely on IPv6 fragmentation for larger packets. So the limit is 64k minus worst case headers.

@@ -1068,8 +1080,14 @@ int ospf6_intra_prefix_lsa_originate_stub(struct thread *thread)
zlog_debug(" Interface %s:", oi->interface->name);

/* connected prefix to advertise */
for (route = ospf6_route_head(oi->route_connected); route;
route = ospf6_route_best_next(route)) {
if (oi->ifmtu >= OSPF6_JUMBO_MTU)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is completely wrong here. The function is originating an Intra-Prefix LSA which is flooded through the entire area. The interface (whose addresses we're adding) 's MTU is irrelevant, if anything we would need to know the minimum MTU of any link in the entire area. But as noted above, even that does not matter since it's supposed to be fragmented.

Since we can originate multiple Intra-Prefix LSAs without problem, the limit here is either 64k or 1280 (not 1500) minus headers depending on whether we want to avoid fragmentation or not. Going with 1280 has the downside of emitting a larger number of LSAs; an argument could be made for some middle value (to reduce the number of fragments and thus the impact of a single lost fragment.)

vty_out(vty,
"can not configure OSPFv3 on if %s, must have less than %d interface addresses but has %d addresses\n",
ifp->name, OSPF6_MAX_IF_ADDRS, ipv6_count);
return CMD_WARNING_CONFIG_FAILED;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please never refuse config based on state. State can always be ordered differently, so any look at state while processing config can introduce a race. If the addresses are added slowly for whatever reasons, we would accept the config here, but if ospf6d is slow we refuse it. Also, the user might never see the warning if they configure ospf6d first.

ipv6_count = connected_count_by_family(c->ifp, AF_INET6);
if (oi->ifmtu == OSPF6_DEFAULT_MTU && ipv6_count > OSPF6_MAX_IF_ADDRS) {
zlog_warn(
"Zebra Interface : %s has too many interface addresses %d only support %d, increase MTU",
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency, you theoretically would need to disable the interface when you hit this. But that's pretty bad too.

#define OSPF6_MAX_IF_ADDRS 100
#define OSPF6_MAX_IF_ADDRS_JUMBO 200
#define OSPF6_DEFAULT_MTU 1500
#define OSPF6_JUMBO_MTU 9000
Copy link
Contributor

Choose a reason for hiding this comment

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

Neither 1500 nor 9000 are valid MTU numbers to hardcode here. You can either assume 1280 == IPv6 minimum, or 64k (minus some bytes) for fragmentation. For anything else, the only correct approach is to rely on actual MTU reported by the interface.

@eqvinox eqvinox mentioned this pull request Jun 29, 2021
idryzhov added a commit that referenced this pull request Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants