summaryrefslogtreecommitdiffstats
path: root/ospfd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: don't null after XFREE; XFREE does this itselfQuentin Young2020-02-032-2/+0
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #5666 from donaldsharp/more_nhg_fixesDonatas Abraitis2020-01-151-1/+1
|\ | | | | bgpd, ospfd, zebra: Do not use 0 as VRF_DEFAULT
| * bgpd, ospfd, zebra: Do not use 0 as VRF_DEFAULTDonald Sharp2020-01-151-1/+1
| | | | | | | | | | | | Explicitly spell out what we are trying to do. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | doc: rename man pages to frr-*David Lamparter2020-01-151-1/+1
|/ | | | | | | | The vrrpd one conflicts with the standalone vrrpd package; also we're installing daemons to /usr/lib/frr on some systems so they're not on PATH. Signed-off-by: David Lamparter <equinox@diac24.net>
* ospfd: Prevent use after free on shutdownDonald Sharp2019-12-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address Sanitizer is reporting this issue: ==26177==ERROR: AddressSanitizer: heap-use-after-free on address 0x6120000238d8 at pc 0x7f88f7c4fa93 bp 0x7fff9a641830 sp 0x7fff9a641820 READ of size 8 at 0x6120000238d8 thread T0 #0 0x7f88f7c4fa92 in if_delete lib/if.c:290 #1 0x42192e in ospf_vl_if_delete ospfd/ospf_interface.c:912 #2 0x42192e in ospf_vl_delete ospfd/ospf_interface.c:990 #3 0x4a6208 in no_ospf_area_vlink ospfd/ospf_vty.c:1227 #4 0x7f88f7c1553d in cmd_execute_command_real lib/command.c:1073 #5 0x7f88f7c19b1e in cmd_execute_command lib/command.c:1132 #6 0x7f88f7c19e8e in cmd_execute lib/command.c:1288 #7 0x7f88f7cd7523 in vty_command lib/vty.c:516 #8 0x7f88f7cd79ff in vty_execute lib/vty.c:1285 #9 0x7f88f7cde4f9 in vtysh_read lib/vty.c:2119 #10 0x7f88f7ccb845 in thread_call lib/thread.c:1549 #11 0x7f88f7c5d6a7 in frr_run lib/libfrr.c:1093 #12 0x412976 in main ospfd/ospf_main.c:221 #13 0x7f88f73b082f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) #14 0x413c78 in _start (/usr/local/master/sbin/ospfd+0x413c78) Effectively we are in a shutdown phase and as part of shutdown we delete the ospf interface pointer ( ifp->info ). The interface deletion code was modified in the past year to pass in the address of operator to allow us to NULL out the holding pointer. The catch here is that we free the oi and then delete the interface passing in the address of the oi->ifp pointer, causing a use after free. Fixes: #5555 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: tiny style fixQuentin Young2019-12-121-2/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospfd: sizeof(pointer) -> sizeof(pointed-at)Quentin Young2019-12-121-1/+1
| | | | | | 14 years old eh? Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospfd: fix misplaced trust in ip header lengthQuentin Young2019-12-121-5/+17
| | | | | | | | | | We actually don't validate the IHL field, although it certainly looks like we do at a casual glance. This patch saves us from an assert in case we actually do get an IP packet with an incorrect header length field. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Merge pull request #4765 from opensourcerouting/defaults-v2Donald Sharp2019-12-064-37/+32
|\ | | | | lib/*: new config defaults system, v2
| * ospfd: use new defaults mechanism (v2)David Lamparter2019-12-063-25/+31
| | | | | | | | | | | | | | | | | | | | Some preprocessor constants converted to enums to make the names usable in the preprocessor. v2: better isolation between core and vty code to make future northbound conversion easier. Signed-off-by: David Lamparter <equinox@diac24.net>
| * ospfd: remove minor WTF in instance creationDavid Lamparter2019-12-061-11/+1
| | | | | | | | | | | | | | | | | | Well, "obviously" this condition block is pointless, since ospf_router_id_update is called afterwards unconditionally... (And even if it were needed, it would need to go in ospf_get too.) Signed-off-by: David Lamparter <equinox@diac24.net>
| * lib: rename memory_vty.c to lib_vty.cDavid Lamparter2019-12-061-1/+0
| | | | | | | | | | | | And memory_init() to lib_cmd_init(). Signed-off-by: David Lamparter <equinox@diac24.net>
* | Merge pull request #5226 from donaldsharp/interface_fixupDavid Lamparter2019-12-063-22/+18
|\ \ | |/ |/| Interface fixup
| * eigrpd, ospfd, pimd: Fix assumption that interface may not be upDonald Sharp2019-12-042-19/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ospfd: interface name and ip address can be 32 bytesDonald Sharp2019-12-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are only saving 20 bytes of string output for ospf neighbor commands. Fixed output: act-7326-05# show ip ospf vrf vrf1012 neighbor all VRF Name: vrf1012 Neighbor ID Pri State Dead Time Address Interface RXmtL RqstL DBsmL 9.9.12.11 1 Full/DROther 39.973s 200.254.2.10 swp49s0.2:200.254.2.9 4 0 0 9.9.12.12 1 Full/DROther 39.995s 200.254.2.14 swp49s1.2:200.254.2.13 9 0 0 9.9.12.13 1 Exchange/DROthe 39.981s 200.254.2.18 swp49s2.2:200.254.2.17 157 0 0 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | ospfd: clean up SA warningMark Stapp2019-12-051-1/+1
|/ | | | | | remove an unneeded initialization to clear up an SA report. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: generously apply constDavid Lamparter2019-12-027-31/+45
| | | | | | const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
* *: make frr_yang_module_info constDavid Lamparter2019-11-301-1/+1
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: make all route_map_rule_cmd constDavid Lamparter2019-11-301-26/+52
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* ospfd: nbr->oi is never nullDonald Sharp2019-11-226-13/+8
| | | | | | | | | | We test nbr->oi in a couple of places for null, but in the majority of places of the nbr->oi data is being used we just access it. Touch up code to trust this assertion and make the code more consistent in others. Found in Coverity. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Rework ospf_read_packet into 2 functionsDonald Sharp2019-11-191-213/+228
| | | | | | | The indentation level for ospf_read was starting to be pretty extremene. Rework into 2 functions for improved readability. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Allow packet reads based upon read/write packet countsDonald Sharp2019-11-191-191/+213
| | | | | | | | | Read in up to 20(ospf write-multipler X) packets, for handling of data. This improves performance because we allow ospf to have a bit more data to work on in one go for spf calculations instead of 1 packet at a time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: The ip header dump is crazy long and uselessDonald Sharp2019-11-193-30/+0
| | | | | | | | | | | | | | | | | | | | | | | Turning on packet debugs and seeing a header dump that is 11 lines long is useless 2019/11/07 01:07:05.941798 OSPF: ip_v 4 2019/11/07 01:07:05.941806 OSPF: ip_hl 5 2019/11/07 01:07:05.941813 OSPF: ip_tos 192 2019/11/07 01:07:05.941821 OSPF: ip_len 68 2019/11/07 01:07:05.941831 OSPF: ip_id 48576 2019/11/07 01:07:05.941838 OSPF: ip_off 0 2019/11/07 01:07:05.941845 OSPF: ip_ttl 1 2019/11/07 01:07:05.941857 OSPF: ip_p 89 2019/11/07 01:07:05.941865 OSPF: ip_sum 0xcf33 2019/11/07 01:07:05.941873 OSPF: ip_src 200.254.30.14 2019/11/07 01:07:05.941882 OSPF: ip_dst 224.0.0.5 We already have this debugged, it's not going to change and the end developer can stick this back in if needed by hand to debug something that is not working properly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Add/fix some debugs to handle vrfDonald Sharp2019-11-195-36/+69
| | | | | | | | | | | | | This commit has: The received packet path in ospf, had absolutely no debugs associated with it. This makes it extremely hard to know when we receive packets for consumption. Add some breadcrumbs to this end. Large chunks of commands have no ability to debug what is happening in what vrf. With ip overlap X vrf this becomes a bit of a problem Add some breadcrumbs here. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Add a function to return the name of the vrf we are in.Donald Sharp2019-11-192-0/+9
| | | | | | | Add a helper function to return the name of the vrf we are in so it can be used as part of debug strings. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Remove ORIGINAL_CODING checkDonald Sharp2019-11-196-116/+9
| | | | | | | | | We have a bunch of places that look for ORIGINAL_CODING. There is nothing in our configure system to define this value and a quick git blame shows this code as being original to the import a very very long time ago. This is dead code, removing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Adding Debugs to dump OSPF DD SeqnumberSatheesh Kumar K2019-11-142-0/+27
| | | | | | | | | Recently Lot of issues are seen in OSPF adjacnecy establishements, sessions was tear down because of DD Sequence Number mismatch. adding Debugs to capture Master & slave generated sequence numbers. Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
* Merge pull request #5313 from mjstapp/fix_bsd_addr_of_packedDonald Sharp2019-11-121-1/+3
|\ | | | | ospfd,eigrpd: don't take address of packed struct member
| * ospfd,eigrpd: don't take address of packed struct memberMark Stapp2019-11-111-1/+3
| | | | | | | | | | | | | | | | Use a local variable to avoid trying to take the address of a packed struct member - an address from the ip header in these cases. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* | ospfd: Function order caused use after free.Donald Sharp2019-11-111-3/+3
|/ | | | | | | | | | | | The opaque lsa that we are storing is stored on various lists depending on it's type. This removal from the list was being done *after* the pointer was freed. This is not a good idea. Since the use after free was just removal from a linked list and the freeing function does not do anything other than free data, than just switching the function order should be sufficient. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib, ospfd, zebra: Convert interface_delete to take double pointerDonald Sharp2019-11-021-2/+1
| | | | | | When free'ing the interface pointer, set it to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Convert connected_free to a double pointerDonald Sharp2019-11-021-2/+2
| | | | | | Set the connected pointer to set the pointer to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospf: BFD down not tearing down OSPF adjacency for point-to-point networkRadhika Mahankali2019-10-311-2/+24
| | | | | | | | | | | | | | | | Root Cause: Lookup for the point-to-point neighbor was failing because the neighbor lookup was based on neighbor interface IP address. But, for point-to-point neighbor the key is router-id for lookup. Lookup failure was causing the BFD updates from PTM to get dropped. Fix: Added walk of the neighbor list if the network type is point-to-point to find the appropriate neighbor. The match is based on source IP address of the neighbor since that’s the address registered with BFD for monitoring. Ticket: CM-20411 Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
* Merge pull request #5197 from SumitAgarwal123/BFD_ADMIN_DOWNRafael Zalamena2019-10-291-1/+1
|\ | | | | bfdd: Handling local and remote admin-down
| * bfdd: Handling local and remote admin-downSumitAgarwal1232019-10-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scenarios where this code change is required: 1. BFD is un-configured from BGP at remote end. Neighbour BFD sends ADMIN_DOWN state, but BFD on local side will send DOWN to BGP, resulting in BGP session DOWN. Removing BFD session administratively shouldn't bring DOWN BGP session at local or remote. 2. BFD is un-configured from BGP or shutdown locally. BFD will send state DOWN to BGP resulting in BGP session DOWN. (This is akin to saying do not use BFD for BGP) Removing BFD session administratively shouldn't bring DOWN BGP session at local or remote. Signed-off-by: Sayed Mohd Saquib sayed.saquib@broadcom.com
* | *: Cleanup interface creation apisStephen Worley2019-10-101-2/+2
| | | | | | | | | | | | | | | | | | | | Cleanup the interface creation apis to make it more clear what they are doing. Make it explicit that the creation via name/ifindex will only add it to the appropriate list. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
* | *: remove redundant brackets in commandsIgor Ryzhov2019-10-081-1/+1
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | *: strip trailing whitespaceQuentin Young2019-09-302-3/+3
| | | | | | | | | | | | Some of it has snuck by CI Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* | *: Convert zapi->interface_delete to ifp callbackDonald Sharp2019-09-194-35/+18
| | | | | | | | | | | | | | Convert the callback of the interface_delete to the new ifp callback. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | *: Convert interface_down to interface down callbackDonald Sharp2019-09-192-25/+13
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | *: Convert from ->interface_up to the interface callbackDonald Sharp2019-09-192-69/+41
| | | | | | | | | | | | | | For all the places we have a zclient->interface_up convert them to use the interface ifp_up callback instead. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | *: Switch all zclient->interface_add to interface create callbackDonald Sharp2019-09-195-44/+40
| | | | | | | | | | | | | | 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>
* | *: Add infrastructure to support zapi interface callbacksDonald Sharp2019-09-191-0/+23
|/ | | | | | | | | | | | | | | | | | | | | | | | | Start the conversion to allow zapi interface callbacks to be controlled like vrf creation/destruction/change callbacks. This will allow us to consolidate control into the interface.c instead of having each daemon read the stream and react accordingly. This will hopefully reduce a bunch of cut-n-paste stuff Create 4 new callback functions that will be controlled by lib/if.c create -> A upper level protocol receives an interface creation event The ifp is brand spanking newly created in the system. up -> A upper level protocol receives a interface up event This means the interface is up and ready to go. down -> A upper level protocol receives a interface down destroy -> A upper level protocol receives a destroy event This means to delete the pointers associated with it. At this point this is just boilerplate setup for future commits. There is no new functionality. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge pull request #4564 from pguibert6WIND/misc_vrf_update_nameRuss White2019-09-172-11/+1
|\ | | | | Misc vrf update name
| * ospfd: update ospf default vrf name with vrf hookPhilippe Guibert2019-08-271-1/+1
| | | | | | | | | | | | | | | | vrf hook handler associated to updating the vrf default name is added. Then, when creating default ospf vrf instance, the vrf identifier will be associated to the correct default vrf name. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
| * ospfd: do not create default ospf instancePhilippe Guibert2019-08-271-10/+0
| | | | | | | | | | | | | | | | | | when an other name is given to default vrf, then there is case where 2 ospf instances are created, which is not wished. Also, it appears that interface learning and ospf interface configuration is not lost when not creating that default ospf instance. So removing it. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | Merge pull request #4949 from opensourcerouting/mpls-zapi-improvementsOlivier Dugeon2019-09-132-75/+23
|\ \ | | | | | | MPLS zapi improvements
| * | ospfd: avoid installing SR FTNs twiceRenato Westphal2019-09-101-51/+2
| | | | | | | | | | | | | | | | | | | | | | | | There's no need to install MPLS FTNs using the ZEBRA_ROUTE_ADD message since the ZEBRA_MPLS_LABELS_ADD message already does that (in addition to installing an MPLS LSP). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | lib, zebra: add new MPLS zapi message with route replace semanticsRenato Westphal2019-09-101-5/+8
| | | | | | | | | | | | | | | | | | | | | This new message makes it possible to install/reinstall LSPs with multiple nexthops using a single ZAPI message. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
| * | lib, zebra: enhance the MPLS zapi messagesRenato Westphal2019-09-071-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add ability to specify the nexthop type; * Add ability to install or not a FTN (in addition to an LSP). These two additions will be useful to install local SR Prefix-SIDs configured with the no-PHP option. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>