summaryrefslogtreecommitdiff
path: root/ospfd/ospf_interface.h
AgeCommit message (Collapse)Author
2024-07-06ospfd: Fix several problems with direct acknowledgments and improved delay acks.Acee Lindem
1. On P2MP interfaces, direct ack would include the same LSA multiple times multiple packets are processed before the OSPF interfae direct LSA acknowledgment event is processed. Now duplicates LSA in the same event are suppressed. 2. On non-broadcast interfaces, direct acks for multiple neighbors would be unicast to the same neighbor due to the multiple OSPF LS Update packets being process prior to the OSPF interface direct ack event. Now, separate direct acks are unicast to the neighbors requiring them. 3. The interface delayed acknowledgment timer runs would run continously (every second as long as the interace is up). Now, the timer is set when delayed acknowledgments are queued and all queued delayed acknowledges are sent when it fires. 4. For non-broadcast interface delayed acknowledgments, the logic to send to multiple neighbors wasn't working because the list was emptied while building the packet for the first neighbor. Signed-off-by: Acee Lindem <acee@lindem.com>
2024-06-20ospfd: Improve OSPF neighbor retransmission list granularity and precisionAcee Lindem
The current OSPF neighbor retransmission operates on a single per-neighbor periodic timer that sends all LSAs on the list when it expires. Additionally, since it skips the first retransmission of received LSAs so that at least the retransmission interval (resulting in a delay of between the retransmission interval and twice the interval. In environments where the links are lossy on P2MP networks with "delay-reflood" configured (which relies on neighbor retransmission in partial meshs), the implementation is sub-optimal (to say the least). This commit reimplements OSPF neighbor retransmission as follows: 1. A new data structure making use the application managed typesafe.h doubly linked list implements an OSPF LSA list where each node includes a timestamp. 2. The existing neighbor LS retransmission LSDB data structure is augmented with a pointer to the list node on the LSA list to faciliate O(1) removal when the LSA is acknowledged. 3. The neighbor LS retransmission timer is set to the expiration timer of the LSA at the top of the list. 4. When the timer expires, LSAs are retransmitted that within the window of the current time and a small delta (50 milli-secs default). The LSAs that are retransmited are given an updated retransmission time and moved to the end of the LSA list. 5. Configuration is added to set the "retransmission-window" to a value other than 50 milliseconds. 6. Neighbor and interface LSA retransmission counters are added to provide insight into the lossiness of the links. However, these will increment quickly on non-fully meshed P2MP networks with "delay-reflood" configured. 7. Added a topotest to exercise the implementation on a non-fully meshed P2MP network with "delay-reflood" configured. The alternative was to use existing mechanisms to instroduce loss but these seem less determistic in a topotest. Signed-off-by: Acee Lindem <acee@lindem.com>
2024-04-29Merge pull request #15824 from opensourcerouting/fix/ospf_show_non_defaultDonald Sharp
vtysh: Show `ip ospf network ...` even if it's not the same as the interface type
2024-04-23vtysh: Show `ip ospf network ...` even if it's not the same as the interface ↵Donatas Abraitis
type ospfv3 shows this unconditionally, and ospfv2 does not show `ip ospf network ...` if the type of the interface matches the specified network. Fixes: https://github.com/FRRouting/frr/issues/15817 Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-18ospfd: Add prefix-list filtering of OSPF neighbors on OSPF interfaceAcee Lindem
This commit adds the capabiity to filter OSPF neighbors using a prefix-list with rules matching the neighbor's IP source address. Configuration, filtering, immediate neighbor pruning, topo-tests, and documentation are included. The command is: ip ospf neighbor-filter <prefix-list> [A.B.C.D] Signed-off-by: Acee Lindem <acee@lindem.com>
2024-04-02ospfd: Implement non-broadcast support for point-to-multipoint networksAcee Lindem
This extends non-broadcast support to point-to-multipoint networks. Neighbors will be explicitly configured and polled in lieu of multicast dicovery. Toptotests and documentation updates are included. Additionally, the ospf neighbor commands have been greatly simplified taking advantage of DEFPY() capabilities. The AllOSPFRouters (224.0.0.5) is still joined for non-broadcast networks since it is joined for NBMA networks. It seems this could be removed but it should done be in a separate commit. Signed-off-by: Acee Lindem <acee@lindem.com>
2023-11-28ospfd: Fix OSPF link-local opaque LSA crash and opaque memory corruptionAcee
1. When an OSPF interface is deleted, remove the references in link-local LSA. Delete the LSA from the LSDB so that the callback has accessibily to the interface prior to deletion. 2. Fix a double free for the opaque function table data structure. 3. Assure that the opaque per-type information and opaque function table structures are removed at the same time since they have back pointers to one another. 4. Add a topotest variation for the link-local opaque LSA crash. Signed-off-by: Acee <aceelindem@gmail.com>
2023-09-16[ospfd]: add support for RFC 5709 HMAC-SHA AuthMahdi Varasteh
This patch includes: * Implementation of RFC 5709 support in OSPF. Using openssl library and FRR key-chain, one can use SHA1, SHA256, SHA384, SHA512 and keyed-MD5( backward compatibility with RFC 2328) HMAC algs. * Updating documentation of OSPF * add topotests for new HMAC algorithms Signed-off-by: Mahdi Varasteh <varasteh@amnesh.ir>
2023-07-20ospfd: Implement OSPF prefix-suppression as specified in RFC 6860Acee
Signed-off-by: Acee <aceelindem@gmail.com>
2023-06-28 ospfd: Configurable interface-level 'capability opaque' supportAcee
Add support for "[no] ip ospf capbility opaque" at the interface level with the default being capability opaque enabled. The command "no ip ospf capability opaque" will disable opaque LSA database exchange and flooding on the interface. A change in configuration will result in the interface being flapped to update our options for neighbors but no attempt will be made to purge existing LSAs as in dense topologies, these may received by neighbors through different interfaces. Topotests are added to test both the configuration and the LSA opaque flooding suppression. Signed-off-by: Acee <aceelindem@gmail.com>
2023-05-22ospfd: OSPF P2MP Delayed Reflooding configurationAcee
Currently, delayed reflooding on P2MP interfaces for LSAs received from neighbors on the interface is unconditionally (see commit c706f0e32ba8aa8780a0618b6fbba364c383ae05). In some cases, this change wasn't desirable and this feature makes delayed reflooding configurable for P2MP interfaces via the CLI command: "ip ospf network point-to-multipoint delay-reflood" in interface submode. Signed-off-by: Acee <aceelindem@gmail.com>
2023-05-08ospfd, ospf6d: introduce the "graceful-restart hello-delay" commandRenato Westphal
This command makes unplanned GR more reliable by manipulating the sending of Grace-LSAs and Hello packets for a certain amount of time, increasing the chance that the neighboring routers are aware of the ongoing graceful restart before resuming normal OSPF operation. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-04-11ospfd: support write socket per interfaceMark Stapp
Add support for a write socket per interface, enabled by default at the ospf instance level. An ospf instance-level config allows this to be disabled, reverting to the older behavior where a single per-instance socket is used for sending and receiving packets. Signed-off-by: Mark Stapp <mjs@labn.net>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
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>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-08-11ospfd: Refactor fifo_flush for the interfaceDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-08-06ospfd: Cleanup ospf_interface.h to work with our standardsDonald Sharp
When declaring functions we must name the variables as part of our standard. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-22ospfd: OSPF hello packets not sent with configured hello timerrgirada
Description : ospf hello timer is not getting refelcted upon changing the hello interval. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2021-04-06ospfd: Support use of ospf with DMVPNAmol Lad
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-03-30ospfd: fix counting of "ip ospf area" commandsIgor Ryzhov
Instead of trying to maintain if_ospf_cli_count, let's directly count the number of configured interfaces when it is needed. Current approach sometimes leads to an incorrect counter. Fixes #8321. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-03-23ospfd: fix checkpatch warningsRafael Zalamena
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-23ospfd: rework BFD integrationRafael Zalamena
Use new BFD API to integrate with OSPFv2. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-03-17*: require semicolon after DEFINE_QOBJ & co.David Lamparter
Again, see previous commits. Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17*: require semicolon after DEFINE_HOOK & co.David Lamparter
See previous commit. Signed-off-by: David Lamparter <equinox@diac24.net>
2020-09-19ospfd : Fix for ospf dead interval and hello due.Kaushik
1. Ospf dead-interval will be set as 4 times of hello-interval, incase if it is not set by using "ip ospf dead-interval <dead-val>". 2. On resetting hello-interval using "no ip ospf hello-interval" the dead interval and hello due will be changed accordingly. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
2020-09-09ospfd: ldp-igp-sync feature: adding ospf supportlynne
Signed-off-by: Lynne Morrison <lynne@voltanet.io> Signed-off-by: Karen Schoener <karen@voltanet.io>
2019-12-04eigrpd, ospfd, pimd: Fix assumption that interface may not be upDonald Sharp
Commit: ddbf3e60604019d4b38d51226700e2244cc531b6 This commit modified the interface up handling code in ZAPI such that the zclient handled the decoding for you. Prior to this commit ospf assumed that it could use the old ifp pointer to know state before reading the stream. This lead to a situation where ospf would `smartly` track and do the right thing in this situation. This commit changed this assumption and in certain scenarios, say a interface was changed after it was already up would lead to situations where ospf would not properly handle the new interface up. Modify ospf to track data that is important to it in it's interface->info pointer. This code pattern was followed in both eigrp and pim. In eigrp's case it was just behaving weirdly in any event so fixing this pattern is not a big deal. In pim's case it was not properly using this so it's a no-op to fix. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Convert zapi->interface_delete to ifp callbackDonald Sharp
Convert the callback of the interface_delete to the new ifp callback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19*: Switch all zclient->interface_add to interface create callbackDonald Sharp
Switch the zclient->interface_add functionality to have everyone use the interface create callback in lib/if.c Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-08-30ospfd: Cleanup oi->obuf to always be createdDonald Sharp
This looks like a finish up of the partial cleanup that ocurred at some point in time in the past. When we alloc oi also always alloc the oi->obuf. When we delete oi always delete the oi->obuf right before. This cleans up a bunch of code to be simpler and hopefully easier to follow. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-10-25ospfd: do not remove area structure, while vls are configuredPhilippe Guibert
when adding/removing virtual links per interface, sometimes, the ospf virtual link can not be removed, whereas the associated area is already removed. Do not remove the area while a virtual link is yet configured. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-03-27*: use C99 standard fixed-width integer typesQuentin Young
The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-06*: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger
Signed-off-by: Lou Berger <lberger@labn.net>
2018-01-20ospfd: show ip ospf neighbor json output formatChirag Shah
Current json output does not differentiate start of neighbor ip object. Adding "neighbors" keyword at the beginning of neighbor list. This is useful when displaying vrf level output along with neighbors list. Ticket:CM-19097 Testing Done: show ip ospf neighbor json show ip ospf vrf all neighbor json Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-08-16ospfd: remember area-id format for ifacesQuentin Young
Display dotted quad or decimal back in the config depending on what the user enters. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-28ospfd: Bring in some OSPF useful changes that were lost during Quagga forkJafar Al-Gharaibeh
Several changes were made from the original patch to resolve conflicts and also to fix various issues that were discovered during testing. Below is the original commit message minus a few parts that correspond to code that was dropped during bug fixing. Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com> ospfd: Extend 'ip ospf area' to take address argument + rationalise ospf enable * ospfd.c: (general) Clean up the whole running of OSPF on interfaces. (add_ospf_interface) taking (struct interface *) arg is pointless here. (ospf_is_ready) new helper. (ospf_network_run_subnet) Put all the code for choosing whether to enable OSPF on a subnet, and if so which area configuration to use, here. If a subnet should not be enabled, ensure an existing oi is freed. (ospf_network_run_interface) Just call run_subnet for all subnets on an interface. (ospf_network_run) Just call run_interface for all interfaces. (ospf_if_update) Just call run_interface for the given interface. (ospf_network_unset) Just call run_subnet for existing ois. (ospf_update_interface_area) helper: update area on an oi, or create it. (ospf_interface_set) renamed to ospf_interface_area_set for clarity. Ensures OSPF is created, then into if_update. (ospf_interface_unset) renamed to ospf_interface_area_unset and collapses down to simple loop to call run_subnet for all ois. * ospf_interface.h: add a more general OSPF_IF_PARAM_IS_SET, which does the right thing and takes default config into account. * doc/ospfd.texi: add 'ip ospf area' command. Acked-by: Donald Sharp <sharpd@cumulusnetworks.com> This patch has been part of Quagga since October 2015 Orignial Author: Paul Jakma <paul@quagga.net> Date: Thu Aug 27 16:51:42 2009 +0100
2017-05-24Merge remote-tracking branch 'origin/stable/3.0'Donald Sharp
2017-05-19ospfd: remember format for ospf area idQuentin Young
If the user enters a decimal, display a decimal. If the user enters a dotted quad, display a dotted quad. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-25*: use hooks for sending SNMP trapsDavid Lamparter
This means there are no ties into the SNMP code anymore other than the init call at startup. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-12-09ospfd, ospf6d: add qobj registrationsDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-08-18ospfd: Impl. per interface 'ip ospf area' commandJoakim Tjernlund
Use with interface command: interface ppp0 ip ospf area 0.0.0.0 This will enable OSPF on ppp0 with area 0.0.0.0 Remove with "no ip ospf area" * ospf_vty.c: add "ip ospf area (A.B.C.D|<0-4294967295>)" interface command * ospfd.c: (ospf_interface_{un,}set) new helper function to enable/disable OSPF on a specific interface. (ospf_if_update) 2 possible paths now to deal with interface updates. Acked-by: Donald Sharp <sharpd@cumulusnetworks.com> [DL: this restores the tree to deccaf9...]
2016-08-18Revert "per-interface ospf enable and area set command."David Lamparter
This reverts commit e723861da171fd811f499665e5432dce4e364ee6. The code is from Joakim Tjernlund; this is just to fix the history (and attribution) of it. The last commit will restore the exact same tree state. THIS COMMIT WILL PROBABLY NOT COMPILE. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-08-16ospfd: Remove HAVE_OPAQUE_LSADonald Sharp
HAVE_OPAQUE_LSA is used by default and you have to actively turn it off except that OPAQUE_LSA is an industry standard and used pretty much everywhere. There is no need to have special #defines for this anymore. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> (cherry picked from commit 36fef5708d074a3ef41f34d324c309c45bae119b)
2015-07-25Fixup of a few missed warnings after --enable-werror turned onDonald Sharp
Ticket: Trivial Reviewed by: Trivial Testing: Compilation
2015-07-22This patch changes ospfd from only listening mode for BFD status updates to ↵Donald Sharp
interactive mode of dynamically registering/deregistering neighbors discovered on BFD enabled interfaces with PTM/BFD through zebra. Neighbor is registered with BFD when 2-way adjacency is established and deregistered when adjacency goes down if the BFD is enabled on the interface through which the neighbor was discovered. OSPF BFD command enhancement to configure BFD parameters (detect multiplier, min rx and min tx). interface <if-name> ip ospf bfd <detect mult> <min rx> <min tx> This patch also adds BFD support for IPv6 OSPF. ospf6d will dynamically register/deregister IPv6 neighbors with BFD for monitoring the connectivity of the neighbor. Neighbor is registered with BFD when 2-way adjacency is established and deregistered when adjacency goes down if the BFD is enabled on the interface through which the neighbor was discovered. OSPF6 BFD command added to configure BFD and parameters (detect multiplier, min rx and min tx). interface <if-name> ipv6 ospf6 bfd <detect mult> <min rx> <min tx> Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Kanna Rajagopal <kanna@cumulusnetworks.com>
2015-05-19per-interface ospf enable and area set command.Donald Sharp
2015-05-19This patch adds support for a new BFD session down message from zebra toDonald Sharp
protocols. BGP and OSPF are integrated to respond this BFD session down message originated in Zebra via ptmd. BGP and OSPF now have a bfd command, which tells OSPF/BGP to respond to the BFD session down message. OSPF: interface <> ip ospf bfd BGP: router bgp <> neighbor <> bfd Please note that these commands don't enable BFD as a protocol. BFD configuration and paramter tuning are via BFD applicable UI. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Shrijeet Mukherjee <shm@cumulusnetworks.com>
2013-11-07ospf6d: add p2p interface supportDinesh Dutt
Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Signed-off-by: Ayan Banerjee <ayabaner at gmail.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> Reviewed-by: James Li <jli at cumulusnetworks.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>