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

ospfd: implement NSSA default routes & ranges #12969

Merged
merged 8 commits into from
Apr 4, 2023

Conversation

rwestphal
Copy link
Member

1 - Add a knob to generate Type-7 default routes on NSSA ABR/ASBRs.

Syntax: area A.B.C.D nssa default-information-originate [{metric (0-16777214)|metric-type (1-2)}]

Example:

router ospf
 area 1 nssa default-information-originate
!

2 - Implement NSSA address ranges as specified by RFC 3101:

    NSSA border routers may be configured with Type-7 address ranges.
    Each Type-7 address range is defined as an [address,mask] pair.  Many
    separate Type-7 networks may fall into a single Type-7 address range,
    just as a subnetted network is composed of many separate subnets.
    NSSA border routers may aggregate Type-7 routes by advertising a
    single Type-5 LSA for each Type-7 address range.  The Type-5 LSA
    resulting from a Type-7 address range match will be distributed to
    all Type-5 capable areas.

Syntax: area A.B.C.D nssa range A.B.C.D/M [<not-advertise|cost (0-16777215)>]

Example:

router ospf
 router-id 1.1.1.1
 area 1 nssa
 area 1 nssa range 172.16.0.0/16
 area 1 nssa range 10.1.0.0/16
!

This PR is the ospfd's counterpart of #9585 and #9752.

@frrbot frrbot bot added ospf tests Topotests, make check, etc labels Mar 9, 2023
@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Mar 9, 2023

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

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

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 4: Failed (click for details)

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TP4U1804AMD64-10109/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 4
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-10109/artifact/TP4U1804AMD64/TopotestLogs/log_topotests.txt

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

Warnings Generated during build:

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

Topology Test Results are at https://ci1.netdef.org/browse/FRR-PULLREQ2-TP4U1804AMD64-10109/test

Topology Tests failed for Topotests Ubuntu 18.04 amd64 part 4
see full log at https://ci1.netdef.org/browse/FRR-PULLREQ2-10109/artifact/TP4U1804AMD64/TopotestLogs/log_topotests.txt

Report for ospf_abr.c | 2 issues
===============================================
< WARNING: line over 80 characters
< #692: FILE: /tmp/f1-305558/ospf_abr.c:692:
Report for ospf_abr.h | 20 issues
===============================================
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #47: FILE: /tmp/f1-305558/ospf_abr.h:47:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #54: FILE: /tmp/f1-305558/ospf_abr.h:54:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #54: FILE: /tmp/f1-305558/ospf_abr.h:54:
< WARNING: function definition argument 'bool' should also have an identifier name
< #54: FILE: /tmp/f1-305558/ospf_abr.h:54:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #57: FILE: /tmp/f1-305558/ospf_abr.h:57:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #57: FILE: /tmp/f1-305558/ospf_abr.h:57:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #60: FILE: /tmp/f1-305558/ospf_abr.h:60:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #60: FILE: /tmp/f1-305558/ospf_abr.h:60:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #62: FILE: /tmp/f1-305558/ospf_abr.h:62:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #65: FILE: /tmp/f1-305558/ospf_abr.h:65:
Report for ospf_lsa.c | 4 issues
===============================================
< ERROR: do not use assignment in if condition
< #2287: FILE: /tmp/f1-305558/ospf_lsa.c:2287:
< ERROR: do not use assignment in if condition
< #2331: FILE: /tmp/f1-305558/ospf_lsa.c:2331:
Report for ospf_route.h | 4 issues
===============================================
< WARNING: function definition argument 'bool' should also have an identifier name
< #154: FILE: /tmp/f1-305558/ospf_route.h:154:
< WARNING: function definition argument 'bool' should also have an identifier name
< #157: FILE: /tmp/f1-305558/ospf_route.h:157:
Report for ospf_vty.c | 2 issues
===============================================
< WARNING: line over 80 characters
< #12263: FILE: /tmp/f1-305558/ospf_vty.c:12263:

@riw777 riw777 self-requested a review March 14, 2023 12:46
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

@eqvinox
Copy link
Contributor

eqvinox commented Mar 14, 2023

CI:rerun

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Mar 14, 2023

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-10150/

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 ospf_abr.c | 2 issues
===============================================
< WARNING: line over 80 characters
< #692: FILE: /tmp/f1-2049933/ospf_abr.c:692:
Report for ospf_abr.h | 20 issues
===============================================
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #47: FILE: /tmp/f1-2049933/ospf_abr.h:47:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #54: FILE: /tmp/f1-2049933/ospf_abr.h:54:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #54: FILE: /tmp/f1-2049933/ospf_abr.h:54:
< WARNING: function definition argument 'bool' should also have an identifier name
< #54: FILE: /tmp/f1-2049933/ospf_abr.h:54:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #57: FILE: /tmp/f1-2049933/ospf_abr.h:57:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #57: FILE: /tmp/f1-2049933/ospf_abr.h:57:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #60: FILE: /tmp/f1-2049933/ospf_abr.h:60:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #60: FILE: /tmp/f1-2049933/ospf_abr.h:60:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #62: FILE: /tmp/f1-2049933/ospf_abr.h:62:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #65: FILE: /tmp/f1-2049933/ospf_abr.h:65:
Report for ospf_lsa.c | 4 issues
===============================================
< ERROR: do not use assignment in if condition
< #2287: FILE: /tmp/f1-2049933/ospf_lsa.c:2287:
< ERROR: do not use assignment in if condition
< #2331: FILE: /tmp/f1-2049933/ospf_lsa.c:2331:
Report for ospf_route.h | 4 issues
===============================================
< WARNING: function definition argument 'bool' should also have an identifier name
< #154: FILE: /tmp/f1-2049933/ospf_route.h:154:
< WARNING: function definition argument 'bool' should also have an identifier name
< #157: FILE: /tmp/f1-2049933/ospf_route.h:157:
Report for ospf_vty.c | 2 issues
===============================================
< WARNING: line over 80 characters
< #12263: FILE: /tmp/f1-2049933/ospf_vty.c:12263:

@riw777
Copy link
Member

riw777 commented Mar 21, 2023

I think the lint errors need to be fixed here ...

@rwestphal
Copy link
Member Author

@riw777 sigh I missed the style warnings again. Fixed... except the warnings that don't make sense (e.g. DEFPY reformatting).

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Mar 23, 2023

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-10352/

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 ospf_abr.h | 20 issues
===============================================
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #47: FILE: /tmp/f1-3370112/ospf_abr.h:47:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #53: FILE: /tmp/f1-3370112/ospf_abr.h:53:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #53: FILE: /tmp/f1-3370112/ospf_abr.h:53:
< WARNING: function definition argument 'bool' should also have an identifier name
< #53: FILE: /tmp/f1-3370112/ospf_abr.h:53:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #56: FILE: /tmp/f1-3370112/ospf_abr.h:56:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #56: FILE: /tmp/f1-3370112/ospf_abr.h:56:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #59: FILE: /tmp/f1-3370112/ospf_abr.h:59:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #59: FILE: /tmp/f1-3370112/ospf_abr.h:59:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #61: FILE: /tmp/f1-3370112/ospf_abr.h:61:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #64: FILE: /tmp/f1-3370112/ospf_abr.h:64:
Report for ospf_lsa.c | 4 issues
===============================================
< ERROR: do not use assignment in if condition
< #2288: FILE: /tmp/f1-3370112/ospf_lsa.c:2288:
< ERROR: do not use assignment in if condition
< #2332: FILE: /tmp/f1-3370112/ospf_lsa.c:2332:
Report for ospf_route.h | 4 issues
===============================================
< WARNING: function definition argument 'bool' should also have an identifier name
< #154: FILE: /tmp/f1-3370112/ospf_route.h:154:
< WARNING: function definition argument 'bool' should also have an identifier name
< #157: FILE: /tmp/f1-3370112/ospf_route.h:157:
Report for ospf_vty.c | 2 issues
===============================================
< WARNING: line over 80 characters
< #12010: FILE: /tmp/f1-3370112/ospf_vty.c:12010:

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

Combine all variation of the "area nssa" command into a single
DEFPY to improve code maintainability.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Add the "default-information-originate" option to the "area X nssa"
command. That option allows the origination of Type-7 default routes
on NSSA ABRs and ASBRs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
…ntly

A small change to improve code readability.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Update the "range" helpers to accept an area pointer instead of
  an area ID;
* Always call ospf_area_display_format_set() after every "range"
  command to ensure consistency.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Adding blackhole routes is unnecessary in that case.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Implement NSSA address ranges as specified by RFC 3101:

   NSSA border routers may be configured with Type-7 address ranges.
   Each Type-7 address range is defined as an [address,mask] pair.  Many
   separate Type-7 networks may fall into a single Type-7 address range,
   just as a subnetted network is composed of many separate subnets.
   NSSA border routers may aggregate Type-7 routes by advertising a
   single Type-5 LSA for each Type-7 address range.  The Type-5 LSA
   resulting from a Type-7 address range match will be distributed to
   all Type-5 capable areas.

Syntax:
  area A.B.C.D nssa range A.B.C.D/M [<not-advertise|cost (0-16777215)>]

Example:
  router ospf
   router-id 1.1.1.1
   area 1 nssa
   area 1 nssa range 172.16.0.0/16
   area 1 nssa range 10.1.0.0/16
  !

Since regular area ranges and NSSA ranges have a lot in common,
this commit reuses the existing infrastructure for area ranges as
much as possible to avoid code duplication.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
At this point OSPF NSSA deserves a dedicated topotest given the
latest nerd knobs that were added :)

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
@rwestphal
Copy link
Member Author

Rebased...

@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-10547/

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 ospf_abr.h | 20 issues
===============================================
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #47: FILE: /tmp/f1-153180/ospf_abr.h:47:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #53: FILE: /tmp/f1-153180/ospf_abr.h:53:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #53: FILE: /tmp/f1-153180/ospf_abr.h:53:
< WARNING: function definition argument 'bool' should also have an identifier name
< #53: FILE: /tmp/f1-153180/ospf_abr.h:53:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #56: FILE: /tmp/f1-153180/ospf_abr.h:56:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #56: FILE: /tmp/f1-153180/ospf_abr.h:56:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #59: FILE: /tmp/f1-153180/ospf_abr.h:59:
< WARNING: function definition argument 'struct route_table *' should also have an identifier name
< #59: FILE: /tmp/f1-153180/ospf_abr.h:59:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #61: FILE: /tmp/f1-153180/ospf_abr.h:61:
< WARNING: function definition argument 'struct ospf_area *' should also have an identifier name
< #64: FILE: /tmp/f1-153180/ospf_abr.h:64:
Report for ospf_lsa.c | 4 issues
===============================================
< ERROR: do not use assignment in if condition
< #2288: FILE: /tmp/f1-153180/ospf_lsa.c:2288:
< ERROR: do not use assignment in if condition
< #2332: FILE: /tmp/f1-153180/ospf_lsa.c:2332:
Report for ospf_route.h | 4 issues
===============================================
< WARNING: function definition argument 'bool' should also have an identifier name
< #154: FILE: /tmp/f1-153180/ospf_route.h:154:
< WARNING: function definition argument 'bool' should also have an identifier name
< #157: FILE: /tmp/f1-153180/ospf_route.h:157:
Report for ospf_vty.c | 2 issues
===============================================
< WARNING: line over 80 characters
< #12010: FILE: /tmp/f1-153180/ospf_vty.c:12010:

@riw777 riw777 merged commit 4af5e39 into FRRouting:master Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master ospf size/XXL tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants