NSSA default injection not working for non-ABR/non-ASBR #17948
Description
Description
Internal router (not ABR && not ASBR) should be able to inject default route into NSSA area.
(A Type-7 default LSA for the network 0.0.0.0/0 may be originated into the NSSA by any NSSA router. - RFC 3101)
Basically, command "area x nssa default-information-originate" should enable OSPF_FLAG_ASBR for a router, but it does not happen now.
Version
FRRouting 10.2.1 (debian) on Linux(5.10.0-33-amd64).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
configured with:
'--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--sbindir=/usr/lib/frr' '--with-vtysh-pager=/usr/bin/pager' '--libdir=/usr/lib/x86_64-linux-gnu/frr' '--with-moduledir=/usr/lib/x86_64-linux-gnu/frr/modules' '--disable-dependency-tracking' '--enable-rpki' '--disable-scripting' '--enable-pim6d' '--disable-grpc' '--with-libpam' '--enable-doc' '--enable-doc-html' '--enable-snmp' '--enable-fpm' '--disable-protobuf' '--disable-zeromq' '--enable-ospfapi' '--enable-bgp-vnc' '--enable-multipath=256' '--enable-user=frr' '--enable-group=frr' '--enable-vty-group=frrvty' '--enable-configfile-mask=0640' '--enable-logfile-mask=0640' 'build_alias=x86_64-linux-gnu' 'PYTHON=python3'
How to reproduce
Topology:
Internet - R1 - area 1 nssa - R2
R1 has a default route (towards Internet) in the routing table.
router ospf
area 1 nssa default-information-originate
Expected behavior
Should work without any additional commands.
Actual behavior
Command "area 1 nssa default-information-originate" should inject Type-7 LSA into LSDB, but it does not happen.
If we enter any "redistribute" command and "area 1 nssa default-information-originate", it starts working.
Additional context
Function ospf_abr_nssa_type7_defaults (ospfd / ospf_abr.c) requires at least one of the flags [OSPF_FLAG_ABR / OSPF_FLAG_ASBR] enabled to inject Type-7 LSA into NSSA area.
Activating "area 1 nssa default-information-originate" does not enable OSPF_FLAG_ASBR, which is wrong.
Checklist
- I have searched the open issues for this bug.
- I have not included sensitive information in this report.