summaryrefslogtreecommitdiffstats
path: root/ospfd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #13227 from mjstapp/ospf_sock_bufsizesRuss White2023-04-115-4/+142
|\ | | | | ospfd: support configuration of socket buffer sizes
| * ospfd: support configuration of socket buffer sizesMark Stapp2023-04-065-4/+142
| | | | | | | | | | | | | | Add configurable socket send and receive buffer sizes, configured at the instance level. Signed-off-by: Mark Stapp <mjs@labn.net>
* | *: Use a `struct prefix *p` instead of a `struct prefix` in functionsDonald Sharp2023-04-071-10/+10
|/ | | | | | | When passing a prefix into a function let's pass by address instead of pass by value. Let's save our stack space. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #13160 from chiragshah6/fdev2Russ White2023-04-041-12/+32
|\ | | | | ospfd:display correct DR-BDR router-id in nbr cmd
| * ospfd:display correct DR-BDR router-id in nbr cmdSindhu Parvathi Gopinathan2023-04-031-12/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ospf neighbor DR and BDR router-id wrongly displays with interface ip-address instead of router-id. It is fixed to display the correct DR & BDR router-id for JSON and CLI commands. Commands: ``` show ip ospf vrf <vrf-name> neighbor detail json show ip ospf vrf <vrf-name> neighbor detail ``` Before Fix:- ``` r1# show ip ospf vrf default neighbor swp1 detail Neighbor 0.0.0.17, interface address 11.0.0.1 In the area 0.0.0.0 via interface swp1 local interface IP 11.0.0.2 Neighbor priority is 1, State is Full, Role is DR, 6 state changes Most recent state change statistics: Progressive change 1d15h05m ago DR is 11.0.0.1, BDR is 11.0.0.2 ======> DR and BDR shows the intef & local intf ipaddress Options 2 *|-|-|-|-|-|E|- Dead timer due in 35.178s Database Summary List 0 Link State Request List 0 Link State Retransmission List 0 Thread Inactivity Timer on Thread Database Description Retransmision off Thread Link State Request Retransmission on Thread Link State Update Retransmission on r1# r1# show ip ospf vrf default neighbor swp1 detail json { "0.0.0.17":[ { "ifaceAddress":"11.0.0.1", "areaId":"0.0.0.0", "ifaceName":"swp1", "localIfaceAddress":"11.0.0.2", "nbrPriority":1, "nbrState":"Full", "role":"DR", "stateChangeCounter":6, "lastPrgrsvChangeMsec":141141533, "routerDesignatedId":"11.0.0.1", =============> interface ip instead of DR rotuer-id "routerDesignatedBackupId":"11.0.0.2", =======> lo-interface ip instead of BDR rotuer-id "optionsCounter":2, "optionsList":"*|-|-|-|-|-|E|-", "routerDeadIntervalTimerDueMsec":32272, "databaseSummaryListCounter":0, "linkStateRequestListCounter":0, "linkStateRetransmissionListCounter":0, "threadInactivityTimer":"on", "threadLinkStateRequestRetransmission":"on", "threadLinkStateUpdateRetransmission":"on" } ] } r1# ``` After Fix:- ``` r1# show ip ospf vrf default neighbor detail json { "default":{ "vrfName":"default", "vrfId":0, "neighbors":{ "0.0.0.17":[ { "ifaceAddress":"11.0.0.1", "areaId":"0.0.0.0", "ifaceName":"swp1", "localIfaceAddress":"11.0.0.2", "nbrPriority":1, "nbrState":"Full", "role":"DR", "stateChangeCounter":6, "lastPrgrsvChangeMsec":4531505, "routerDesignatedId":"0.0.0.17", =====> DR Router-Id "routerDesignatedBackupId":"0.0.0.12", =====> BDR Router-Id "optionsCounter":2, "optionsList":"*|-|-|-|-|-|E|-", "routerDeadIntervalTimerDueMsec":38495, "databaseSummaryListCounter":0, "linkStateRequestListCounter":0, "linkStateRetransmissionListCounter":0, "threadInactivityTimer":"on", "threadLinkStateRequestRetransmission":"on", "threadLinkStateUpdateRetransmission":"on" } ], "0.0.0.13":[ { "ifaceAddress":"11.0.2.2", "areaId":"0.0.0.0", "ifaceName":"swp2", "localIfaceAddress":"11.0.2.1", "nbrPriority":1, "nbrState":"Full", "role":"DR", "stateChangeCounter":6, "lastPrgrsvChangeMsec":4522182, "routerDesignatedId":"0.0.0.13", =====> DR Router-Id "routerDesignatedBackupId":"0.0.0.12", =====> BDR Router-Id "optionsCounter":2, "optionsList":"*|-|-|-|-|-|E|-", "routerDeadIntervalTimerDueMsec":37840, "databaseSummaryListCounter":0, "linkStateRequestListCounter":0, "linkStateRetransmissionListCounter":0, "threadInactivityTimer":"on", "threadLinkStateRequestRetransmission":"on", "threadLinkStateUpdateRetransmission":"on" } ], "0.0.0.14":[ { "ifaceAddress":"11.0.3.2", "areaId":"0.0.0.0", "ifaceName":"swp3", "localIfaceAddress":"11.0.3.1", "nbrPriority":1, "nbrState":"Full", "role":"DR", "stateChangeCounter":6, "lastPrgrsvChangeMsec":4522182, "routerDesignatedId":"0.0.0.14", =====> DR Router-Id "routerDesignatedBackupId":"0.0.0.12", =====> BDR Router-Id "optionsCounter":2, "optionsList":"*|-|-|-|-|-|E|-", "routerDeadIntervalTimerDueMsec":37840, "databaseSummaryListCounter":0, "linkStateRequestListCounter":0, "linkStateRetransmissionListCounter":0, "threadInactivityTimer":"on", "threadLinkStateRequestRetransmission":"on", "threadLinkStateUpdateRetransmission":"on" } ] } } } r1# r1# show ip ospf vrf default neighbor swp1 detail Neighbor 0.0.0.17, interface address 11.0.0.1 In the area 0.0.0.0 via interface swp1 local interface IP 11.0.0.2 Neighbor priority is 1, State is Full, Role is DR, 6 state changes Most recent state change statistics: Progressive change 1h18m11s ago DR is 0.0.0.17, BDR is 0.0.0.12 =======> correct DR and BDR router-id Options 2 *|-|-|-|-|-|E|- Dead timer due in 38.339s Database Summary List 0 Link State Request List 0 Link State Retransmission List 0 Thread Inactivity Timer on Thread Database Description Retransmision off Thread Link State Request Retransmission on Thread Link State Update Retransmission on r1# r1# show ip ospf vrf default neighbor swp swp1 swp2 swp3 swp4 r1# show ip ospf vrf default neighbor swp2 detail Neighbor 0.0.0.13, interface address 11.0.2.2 In the area 0.0.0.0 via interface swp2 local interface IP 11.0.2.1 Neighbor priority is 1, State is Full, Role is DR, 6 state changes Most recent state change statistics: Progressive change 12m02s ago DR is 0.0.0.13, BDR is 0.0.0.12 =======> correct DR and BDR router-id Options 2 *|-|-|-|-|-|E|- Dead timer due in 37.136s Database Summary List 0 Link State Request List 0 Link State Retransmission List 0 Thread Inactivity Timer on Thread Database Description Retransmision off Thread Link State Request Retransmission on Thread Link State Update Retransmission on r1# ``` Ticket:#3395270 Issue:3395270 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
* | Merge pull request #12969 from opensourcerouting/ospfd-nssaRuss White2023-04-0412-326/+682
|\ \ | | | | | | ospfd: implement NSSA default routes & ranges
| * | ospfd: add support for NSSA Type-7 address rangesRenato Westphal2023-04-018-101/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ospfd: do not install blackhole routes for ranges with "not-advertise"Renato Westphal2023-04-011-19/+22
| | | | | | | | | | | | | | | | | | Adding blackhole routes is unnecessary in that case. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospfd: refactor range commandsRenato Westphal2023-04-013-47/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * | ospfd: use the ospf_area_range_active() helper function more consistentlyRenato Westphal2023-04-011-5/+5
| | | | | | | | | | | | | | | | | | A small change to improve code readability. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospfd: remove duplicated codeRenato Westphal2023-04-011-3/+0
| | | | | | | | | | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | ospfd: implement Type-7 default routes for NSSA areasRenato Westphal2023-04-019-18/+360
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ospfd: refactor the "area nssa" command using DEFPYRenato Westphal2023-04-013-178/+55
| |/ | | | | | | | | | | | | Combine all variation of the "area nssa" command into a single DEFPY to improve code maintainability. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | Merge pull request #12837 from donaldsharp/unlikely_routemapRuss White2023-04-041-4/+4
|\ \ | |/ |/| Unlikely routemap
| * bgpd, ospfd, zebra: Use unlikely for DEBUG_ROUTEMAP_DETAILDonald Sharp2023-03-231-4/+4
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | ospfd: Fix for vitual-link crash in signal handlerPooja Jagadeesh Doijode2023-03-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever OSPF virtual-link is created, a virtual interface is associated with it. Name of the virtual interface is derived by combining "VLINK" string with the value of vlink_count, which is a global variable. Problem: Consider a scenario where 2 virtual links A and B are created in OSPF with virtual interfaces VLINK0 and VLINK1 respectively. When virtual-link A is unconfigured and reconfigured, new interface name derived for it will be VLINK1, which is already associated with virtual-link B. Due to this, both virtual-links A and B will point to the same interface, VLINK1. During FRR restart when signal handler is called, OSPF goes through all the virtual links and deletes the interface(oi) associated with it. During the deletion of interface for virtual-link B,it accesses the interface which was deleted already(which was deleted during deletion of virual-link A) and whose fields were set to NULL. This leads to OSPF crash. Fixed it by not decrementing vlink_count during unconfig/deletion for virtual-link. Signed-off-by: Pooja Jagadeesh Doijode <pdoijode@nvidia.com>
* | Merge pull request #12953 from donaldsharp/struct_eventJafar Al-Gharaibeh2023-03-2443-391/+391
|\ \ | | | | | | Struct event
| * | *: Fixup formatting issues due to reorderingDonald Sharp2023-03-242-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | All the event changes exposed a bunch of places where we were not properly following our standards. Just clean them up in one big fell swoop. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Convert event.h to frrevent.hDonald Sharp2023-03-2428-28/+28
| | | | | | | | | | | | | | | | | | | | | We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Convert `struct event_master` to `struct event_loop`Donald Sharp2023-03-249-12/+12
| | | | | | | | | | | | | | | | | | Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp2023-03-2419-135/+135
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Convert struct thread_master to struct event_master and it's ilkDonald Sharp2023-03-249-12/+12
| | | | | | | | | | | | | | | | | | | | | Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Convert thread_should_yield and thread_set_yield_timeDonald Sharp2023-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | Convert thread_should_yield and thread_set_yield_time to event_should_yield and event_set_yield_time Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Convert thread_timer_remain_XXX to event_timer_remain_XXXDonald Sharp2023-03-241-4/+4
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Convert thread_execute to event_executeDonald Sharp2023-03-243-3/+3
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Convert thread_cancelXXX to event_cancelXXXDonald Sharp2023-03-242-2/+2
| | | | | | | | | | | | | | | | | | Modify the code base so that thread_cancel becomes event_cancel Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Convert thread_add_XXX functions to event_add_XXXDonald Sharp2023-03-2417-86/+87
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Rename `struct thread` to `struct event`Donald Sharp2023-03-2428-111/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | *: Rename thread.[ch] to event.[ch]Donald Sharp2023-03-2428-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | Merge pull request #13093 from manojvn/ospf_mem_leaksDonald Sharp2023-03-241-4/+4
|\ \ \ | |/ / |/| | ospfd: Fix for memory leak issue in ospf related to flood_reduction tests.
| * | ospfd: Fix for memory leak issue in ospf related to flood_reduction tests.Manoj Naragund2023-03-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Multiple memory leaks after pr12366 RCA: ospf_lsa_unlock was not happening for the few of the LSAs in ospf_lsa_refresh_walker after pr12366 due to which memory related to lsas was leaking. Fix: Moved the ospf_lsa_unlock outside if check. Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
* | | Merge pull request #13065 from rgirada/ospf_abr_summaryDonald Sharp2023-03-241-8/+8
|\ \ \ | |/ / |/| |
| * | ospfd: Fixing Summary origination after range configurationrgirada2023-03-211-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: After area range config, summary lsas are aggerated to configured route but later it was being flushed instead of the actual summary lsa. This was seen when prefix-id of the aggregated route is same as one of the actual summary route. Here, aggregated summary lsa need to be returned to set the flag SUMMARY_APPROVE after originating aggregated summary lsa but its not. Which is being cleaned up as part of unapproved summary cleanup. Corrected this now. Issue: #13028 Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* | | *: Add a hash_clean_and_free() functionDonald Sharp2023-03-213-19/+7
| |/ |/| | | | | | | | | | | | | | | | | Add a hash_clean_and_free() function as well as convert the code to use it. This function also takes a double pointer to the hash to set it NULL. Also it cleanly does nothing if the pointer is NULL( as a bunch of code tested for ). Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | Merge pull request #13031 from opensourcerouting/ospf-show-databaseDonald Sharp2023-03-211-421/+162
|\ \ | |/ |/| ospfd: Improve the "show ip ospf database" command
| * ospfd: Fix inconsistency in LSDB JSON outputRenato Westphal2023-03-181-32/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it can be seen below, the LSDB JSON output varies depending whether a filter option is specified or not (e.g. "adv-router", "self-originate"): > show ip ospf database router json { "routerId":"3.3.3.3", "routerLinkStates":{ "areas":{ "0.0.0.0":[ { "lsaAge":175, "options":"*|-|-|-|-|-|E|-", [snip] > show ip ospf database router adv-router 2.2.2.2 json { "routerId":"3.3.3.3", "Router Link States":{ "0.0.0.0":{ "2.2.2.2":{ "lsaAge":193, "options":"*|-|-|-|-|-|E|-", [snip] This inconsistency is undesirable since it makes this data harder to consume programmatically. Also, in the second output, "Router Link States" is used as a JSON key, which doesn't conform to our JSON guidelines (JSON keys need to be camelCased). Make the required changes to ensure the first output structure is used, regardless if any output filter is used or not. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * ospfd: Add "detail" option to "show ip ospf database"Renato Westphal2023-03-181-7/+35
| | | | | | | | | | | | | | This option is useful to dump detailed information about the LSDB using a single command (instead of one command per LSA type). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * ospfd: Refactor the "show ip ospf database" commandRenato Westphal2023-03-181-393/+101
| | | | | | | | | | | | | | Combine all variations of this command into a single DEFPY to improve maintainability. No behavioral changes intended. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | Merge pull request #13025 from donaldsharp/ospf_ti_lfa_leaksJafar Al-Gharaibeh2023-03-192-13/+14
|\ \ | | | | | | Ospf ti lfa leaks
| * | ospfd: Free up q_space in early return pathDonald Sharp2023-03-171-0/+5
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
| * | ospfd: Fix ospf_ti_lfa drop of an entire tableDonald Sharp2023-03-172-13/+9
| | | | | | | | | | | | | | | | | | | | | The new_rtrs variable was just generated and then dropped. Let's fix that entirely Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | | ospfd: Cleanup some memory leaks on shutdown in ospf_apiserver.cDonald Sharp2023-03-182-2/+15
| |/ |/| | | | | | | | | | | Clean up some memory leaks found in ospf_apiserver.c Also a crash in the original implementation. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | Merge pull request #13019 from rgirada/ospf_type3_fixRenato Westphal2023-03-171-6/+7
|\ \ | |/ |/| ospfd: Ospf ABR doesnt Advertise LSA summary
| * ospfd: Ospf ABR doesnt Advertise LSA summaryrgirada2023-03-171-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: OSPF ABR will summarise the networks based on configured range and re-advtertise the summarised route. But if configured range prefix id is same as one of the subset of routes prefix id then as per rcf2328 Appendex-E recommendation, it will prepare the LSID and originate. While re-advertising, it is using ospf LSDB instead of area specific LSDB which is making it fail to re-advertise the summary lsa. Fixed this by passing correct LSDB pointer. Issue: #12995 Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* | ospfd: Log Adjacency Changes with Neighbor IP in addition to Neighbor IDMartin Winter2023-03-171-6/+7
| | | | | | | | | | Signed-off-by: Martin Winter <mwinter@opensourcerouting.org> Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | ospfd, ospf6d: Add more logging detailsDonatas Abraitis2023-03-171-40/+49
|/ | | | | | Basically just router-id or interface/IP. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* Merge pull request #12936 from opensourcerouting/ospf6d-out-filter-listRuss White2023-03-141-1/+1
|\ | | | | ospfd: correctly update outbound filter-list once prefix-list is updated
| * ospfd: correctly update outbound filter-list once prefix-list is updatedRenato Westphal2023-03-021-1/+1
| | | | | | | | | | | | | | Fix obvious bug where the wrong area filter-lists were being updated in response to a prefix-list update. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* | ospfd, ospf6d: perform GR consistency check only when necessaryRenato Westphal2023-03-021-3/+8
|/ | | | | | | | | | | | The GR code should check for topology changes only upon the receipt of Router-LSAs and Network-LSAs. Other LSAs types don't affect the topology as far as a restarting router is concerned. This optimization reduces unnecessary computations when the restarting router receives thousands of inter-area LSAs or external LSAs while coming back up. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* Merge pull request #12751 from Pdoijode/pdoijode/ospf-vrf-neighbor-detail-1Donatas Abraitis2023-02-241-171/+241
|\ | | | | ospfd: Added missing fields and option to query specific neighbor in VRF