summaryrefslogtreecommitdiff
path: root/ospfd
AgeCommit message (Collapse)Author
2025-04-08ospfd: clean up -Wshadow warningsMark Stapp
Clean up various "shadow" warnings. Signed-off-by: Mark Stapp <mjs@cisco.com>
2025-03-03ospfd: cosmetic change for one commandanlan_cs
Just use the same style for all `DEFPY`s. It is a cosmetic change, doesn't affect the actual function. Signed-off-by: anlan_cs <anlan_cs@126.com>
2025-02-24ospfd: remove unused function ins ospfd/ospf_lsa.cDonna Sharp
Signed-off-by: Donna Sharp <dksharp5@gmail.com>
2025-02-12ospfd: Replace LSDB callbacks with LSA Update/Delete hooks.Acee Lindem
Replace the LSDB callbacks with LSA update and delete hooks using the the FRR hook mechanism. Remove redundant callbacks by placing the LSA update and delete hooks in a single place so that deletes don't need to be handled by the update hook. Simplify existing OSPF TE and OSPF API Server callbacks now that there is no ambiguity or redundancy. Also cleanup the debugging by separating out opaque-lsa debugging from the overloaded event debugging. Signed-off-by: Acee Lindem <acee@lindem.com>
2025-02-06Merge pull request #17865 from donaldsharp/coverity_2024_new_hotnessJafar Al-Gharaibeh
Coverity 2024 new hotness
2025-01-23ospfd: Prune duplicate next-hops when installing into zebraAcee Lindem
Duplicate next-hops are maintained for OSPF inter-area and AS external routes in the OSPF routing table as long as they correspond to LSAs for different adverting routers. The intra-area route computation will not result in duplicate next-hops. Signed-off-by: Acee Lindem <acee@lindem.com>
2025-01-17ospfd: Fix Coverity SA #1617470, 76 and 78Donald Sharp
msg_new takes a uint16_t, the length passed down variable is a unsigned int, thus 32 bit. It's possible, but highly unlikely, that the msglen could be greater than 16 bit. Let's just add some checks to ensure that this could not happen. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2025-01-10ospfd: avoid the redundant timersanlan_cs
Since the timer thread for ```OSPF_ROUTE_AGGR_DEL``` has been created, the subsequent "no summary-address" commands shouldn't trigger redundant timers. Signed-off-by: anlan_cs <anlan_cs@126.com>
2025-01-07ospfd: fix wrong check for two commandsanlan_cs
The users would know the failure of some case for the two commands, just return the error ```CMD_WARNING_CONFIG_FAILED```. Signed-off-by: anlan_cs <anlan_cs@126.com>
2025-01-03ospfd: Correct one wordanlan_cs
Signed-off-by: anlan_cs <anlan_cs@126.com>
2024-11-23ospfd: Correct invalid SR-MPLS output labelOlivier Dugeon
When OSPFd starts, there is 2 possible scenarios for Segment Routing: 1/ Routes associated to Prefixes are not yet available i.e. Segment Routing LSA are received before LSA Type 1. In this case, the function ospf_sr_nhlfe_update() is triggered when a new SPF is launch. Thus, neighbors and output label are always synchronise with the routing table. 2/ Routes are already available i.e. LSA Type 1 are received before Segment Routing LSA, in particular the Router Information which contains the SRGB. During nhlfe computation, perfixes are leave with incomplete configuration, in particular, the SR nexthop is set to NULL. If this scenario is handle through the function update_out_nhlfe (triggered when SRGB is received or modified from a neighbor node), the output label is not correctly configured as the nexthop SR node associated to the prefix has been leave to NULL. This patch correct this problem by calling the function compute_nhlfe() when the nexthop SR Node associated to the prefix is NULL within the update_out_nhlfe() function. Thus, we guarantee that the SR prefix is always correctly configuration indpedently of the scenario i.e. arrival of the different LSA. Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2024-11-17ospfd: OSPF multi-instance default origination fixesAcee Lindem
When originating a default AS-External LSA in one OSPF instance, it wasn't working if the criteria route was installed by another OSPF instance. This required more flexible processing of the OSPF external route information. Also fix problem multi-instance display for "show ip ospf <instance> database ...". Signed-off-by: Acee Lindem <acee@lindem.com>
2024-11-05Merge pull request #17346 from ↵Jafar Al-Gharaibeh
LabNConsulting/aceelindem/fix_ospf_refresh_interval_assert ospfd: Fix assert in LSA refresh interval setting
2024-11-05Merge pull request #17319 from opensourcerouting/fix/no_ospf_router-idRuss White
ospfd: Use router_id what Zebra has if we remove a static router_id
2024-11-05ospfd: Fix assert in LSA refresh interval settingAcee
Under certain timing conditions, the current logic asserts in ospf_lsa_refresh_delay(). While this isn't readily reproducible, the only explanation is that the conversion from struct timeval to milliseconds is 0 due to rounding off the microseconds. Signed-off-by: Acee <aceelindem@gmail.com>
2024-11-01Merge pull request #17194 from ↵Russ White
LabNConsulting/aceelindem/ospf-ls-refresh-interval-fix ospfd: Fix opaque LSA refresh interval and modify LSA cmds.
2024-10-31Revert "ospfd: update ospf_asbr_status when using no_area_nssa command"Donald Sharp
This reverts commit 71aa5ab7f6f166065e3b869e3c33ba5b7a57fccb.
2024-10-31ospfd: Use router_id what Zebra has if we remove a static router_idDonatas Abraitis
If we set router-id, e.g. `router-id x.x.x.x`, then we have: ``` pc.donatas.net# show ip ospf | include Router ID OSPF Routing Process, Router ID: x.x.x.x ``` But once we remove it (`no router-id x.x.x.x`), the old router-id remains. This is kinda OK, but to be consistent with OSPFv3 we should use what Zebra already has, instead of retaining the old one. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-31ospfd: Add a hidden command for old `no router-id`Donatas Abraitis
A new command is `ospf router-id ...`, but the old one is also valid. Just a no form was missed. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-10-29Merge pull request #17189 from Shbinging/fix_some_ospf_unset_commands_syntaxDonatas Abraitis
ospfd:fix syntax of some ospf no commands
2024-10-25ospfd: Fix opaque LSA refresh interval and modify LSA cmds.Acee Lindem
The configured OSPF refresh interval was not being used for opaque LSA (it always used the constant). Also, modified the timers lsa min-arrival command to have a maximum of 5000 msecs as well as providing a path for backward command compatibility. Added missing user documentation for both timers lsa min-arrival and timers throttle lsa all. Signed-off-by: Acee Lindem <acee@lindem.com>
2024-10-23ospfd:fix syntax of some no commandsShbinging
Fix syntax of the following no commands: 1. `no area virtual link A.B.C.D hello-interval <NUM>`, `<NUM>` can be omitted. 2. `no area nssa default-information-originate metric <NUM>`, `<NUM>` can be omitted. 3. `no area nssa range cost <NUM>`, `<NUM>` can be omitted. 4. `no area default cost <NUM>`, `<NUM>` can be omitted. 5. `no ospf write-multiplier <NUM>`, `<NUM>` can be omitted. 6. `no default-information originate metric <NUM>`, `<NUM>` can be omitted. 7. `no distance <NUM>`, `<NUM>` can be omitted. Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-10-22ospfd:fix the bug that the empty area was not free after no area range ↵Shbinging
command was executed When we use the no area X.X.X.X range A.B.C.D/M command, if the area no longer has an interface to which it belongs, then the area should be deleted from the LSDB. This processing logic is consistent with instructions such as no network area and no area authentication. Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-10-18Merge pull request #17134 from Shbinging/fix_no_area_nssa_commandDonatas Abraitis
ospfd: update ospf_asbr_status when using no_area_nssa command
2024-10-17ospfd: update ospf_asbr_status when using no_area_nssa commandShbinging
In the processing of nssa, if the number of areas that need to be translated is greater than 0, then abr will be regarded as asbr, and it will be marked (0x3) in the flag of router lsa. When a certain area is set from nssa to a normal area, the areas that need to be translated may be reduced. The asbr should be re-interpreted as abr when the translated area is 0. Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-10-17Merge pull request #17065 from Shbinging/fix_some_ospf_commandsDonatas Abraitis
ospfd: fix some ospf commands
2024-10-16ospfd: fix no area shortcut MODE command, MODE can be defaultShbinging
Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-10-15ospfd: Fixup ospf_lsa.[ch] to properly spell out parameters for functionsDonald Sharp
Our standard says when in a .h file and declaring a function all parameters must have their variables spelled out. Let's do this for ospf_lsa.h Modified ospf_lsa.c to also use event instead of thread, and uint8_t instead of unsigned short. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-10-15ospfd:fix the bug that the empty area was not free after the command was ↵Shbinging
executed When we use the no area X.X.X.X range A.B.C.D/M command, if the area no longer has an interface to which it belongs, then the area should be deleted from the LSDB. This processing logic is consistent with instructions such as no network area and no area authentication. Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-10-11ospfd: fix no_area_range_cost_NUM command, NUM can be omittedShbinging
Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-09-24Merge pull request #16853 from Shbinging/no_ip_ospf_dead_interval_minimalRuss White
ospfd: fix snytax of some no commands
2024-09-24Merge pull request #16851 from Shbinging/fix_timer_throttle_spfRuss White
ospfd: reset spf_hold_multiplier when current SPF delay state is changed
2024-09-23ospfd: reset spf_hold_multiplier when current SPF delay state is changedShbinging
Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-09-20ospfd: Interface 'ip ospf neighbor-filter' startup config not applied.Acee Lindem
When 'ip ospf neighbor-filter <filter-name>' is configured in the startup configuration, it is in the running configuration but not applied on the interface. Signed-off-by: Acee Lindem <acee@lindem.com>
2024-09-20ospfd: fix no ospf abr-type syntaxShbinging
Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-09-18ospfd: Fix heap corruption vulnerability when parsing SR-Algorithm TLVAcee Lindem
When parsing the SR-Algorithm TLV in the OSPF Router Information Opaque LSA, assure that not more than the maximum number of supported algorithms are copied from the TLV. Signed-off-by: Acee Lindem <acee@lindem.com>
2024-09-18ospfd: Add vrf name to debug functions in ospf_zebra.cDonald Sharp
This file had a bunch of debugs that were operating on specific vrf's but not telling you which vrf this was happening in. Add code to allow operator debugging to understand what vrf is being worked on. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-09-18ospfd: fix no ip ospf dead-interval minimal hello-multiplier syntaxShbinging
Signed-off-by: Shbinging <bingshui@smail.nju.edu.cn>
2024-09-13ospfd: fix missing '[no]ip ospf graceful-restart hello-delay <N>' commandsDmitrii Turlupov
Signed-off-by: Dmitrii Turlupov <turlupov@bk.ru>
2024-09-12ospfd: An OSPF Ack should be sent when P2MP reflooding is delayed.Acee Lindem
When "ip ospf network point-to-multipoint delayed-reflooding" is configured, LSAs received on an OSPF P2MP network are not reflooded. Since LSA reflooding would normally serve as an implied LSA acknowledgment, an explicit OSPF ack should be sent to avoid retransmission by the neighbor which orginally flooded the LSA on the P2MP network. Signed-off-by: Acee Lindem <acee@lindem.com>
2024-09-10Merge pull request #16759 from lsang6WIND/ospf_logRuss White
ospfd: logging behavior for area id mismatches
2024-09-09ospfd: logging behavior for area id mismatchesLoïc Sang
When an ospf interface is not in the backbone area, but it receives a packet from the backbone, no logs are generated for this mismatch. However, the opposite scenario does generate logs. Add a log for this case. Signed-off-by: Loïc Sang <loic.sang@6wind.com>
2024-09-06ospfd: add assert to resolve SA warningMark Stapp
Resolve a couple of SA warnings by asserting that pointers are valid. Signed-off-by: Mark Stapp <mjs@cisco.com>
2024-08-18*: Spelling issuesDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-16 ospfd: Fix SA warnings in ospf_packet.c and ospf_vty.cAcee
Fix SA warnings in ospf_packet.c and ospf_vty.c. The former was introduced by commit ed480148844259b7e9e30ed92489cdf44085457e. Signed-off-by: Acee <aceelindem@gmail.com>
2024-08-15Merge pull request #16590 from donaldsharp/spelling_in_masterMark Stapp
*: Fix spelling errors found
2024-08-15*: Fix spelling errors foundDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-08-14ospfd: Remove deprecated router_info_area_id_cmdDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-23Merge pull request #16376 from c-po/ospfd-ldp-syncRuss White
ospfd: fix internal ldp-sync state flags when feature is disabled
2024-07-17ospfd: fix internal ldp-sync state flags when feature is disabledChristian Breunig
When enabling "mpls ldp-sync" under "router ospf" ospfd configures SET_FLAG(ldp_sync_info->flags, LDP_SYNC_FLAG_IF_CONFIG) so internally knowing that the ldp-sync feature is enabled. However the flag is not cleared when turning of the feature using "nompls ldp-sync"! https://github.com/FRRouting/frr/issues/16375 Signed-off-by: Christian Breunig <christian@breunig.cc>