summaryrefslogtreecommitdiff
path: root/ospfd
AgeCommit message (Collapse)Author
2020-03-06*: Finish off the __PRETTY_FUNCTION__ to __func__Donald Sharp
FINISH IT Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-05*: Replace __PRETTY_FUNCTION__/__FUNCTION__ to __func__Donatas Abraitis
Just keep the code cool. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-04ospfd: Fix 4 levels of unnecessary indentationDonald Sharp
Optimize display of code a tiny bit so that we can actually have readable code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-27ospfd: Cleanup set but unused variablesDonald Sharp
There existed some variables set but never used. Clean this up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-18Merge pull request #5813 from mjstapp/zapi_labels_use_nhDonald Sharp
*: encode zapi labels message using nexthops
2020-02-14*: encode zapi labels message using nexthopsMark Stapp
Use the zapi_nexthop struct with the mpls_labels zapi messages instead of the special-purpose (and more limited) nexthop struct that was being used. Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-13*: Remove break after returnDonatas Abraitis
Just a deadcode. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-10Merge pull request #5763 from ton31337/fix/return_without_parentRenato Westphal
*: Remove parenthesis on return for constants
2020-02-09*: Remove parenthesis on return for constantsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-06Merge pull request #5767 from ton31337/fix/replace_s_addr_0_to_INADDR_ANYDonald Sharp
MOAR CODE NAZI: replace s_addr 0 => INADDR_ANY
2020-02-06*: Replace s_addr 0 => INADDR_ANYDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-05OSPF: Multi instance brokenSantosh P K
Multi instance ospf support was broken due to PR #4564. Adding fix back and extra checks to support multi instance OSPF. Fixes issues #5343 & #5741 Signed-off-by: Santosh P K <sapk@vmware.com>
2020-02-05Merge pull request #5104 from opensourcerouting/route-map-nbv2Donald Sharp
lib: migrate route map to use northbound
2020-02-04*: fix route map integrationRafael Zalamena
Add the appropriated code to bootstrap route map northbound for all daemons. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2020-02-03*: don't null after XFREE; XFREE does this itselfQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-15Merge pull request #5666 from donaldsharp/more_nhg_fixesDonatas Abraitis
bgpd, ospfd, zebra: Do not use 0 as VRF_DEFAULT
2020-01-15bgpd, ospfd, zebra: Do not use 0 as VRF_DEFAULTDonald Sharp
Explicitly spell out what we are trying to do. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-15doc: rename man pages to frr-*David Lamparter
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>
2019-12-18ospfd: Prevent use after free on shutdownDonald Sharp
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>
2019-12-12ospfd: tiny style fixQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-12ospfd: sizeof(pointer) -> sizeof(pointed-at)Quentin Young
14 years old eh? Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-12-12ospfd: fix misplaced trust in ip header lengthQuentin Young
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>
2019-12-06Merge pull request #4765 from opensourcerouting/defaults-v2Donald Sharp
lib/*: new config defaults system, v2
2019-12-06Merge pull request #5226 from donaldsharp/interface_fixupDavid Lamparter
Interface fixup
2019-12-06ospfd: use new defaults mechanism (v2)David Lamparter
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>
2019-12-06ospfd: remove minor WTF in instance creationDavid Lamparter
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>
2019-12-06lib: rename memory_vty.c to lib_vty.cDavid Lamparter
And memory_init() to lib_cmd_init(). Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-05ospfd: clean up SA warningMark Stapp
remove an unneeded initialization to clear up an SA report. Signed-off-by: Mark Stapp <mjs@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-12-04ospfd: interface name and ip address can be 32 bytesDonald Sharp
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>
2019-12-02*: generously apply constDavid Lamparter
const const const your boat, merrily down the stream... Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30*: make frr_yang_module_info constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-30*: make all route_map_rule_cmd constDavid Lamparter
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-11-21ospfd: nbr->oi is never nullDonald Sharp
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>
2019-11-19ospfd: Rework ospf_read_packet into 2 functionsDonald Sharp
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>
2019-11-19ospfd: Allow packet reads based upon read/write packet countsDonald Sharp
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>
2019-11-19ospfd: The ip header dump is crazy long and uselessDonald Sharp
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>
2019-11-19ospfd: Add/fix some debugs to handle vrfDonald Sharp
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>
2019-11-19ospfd: Add a function to return the name of the vrf we are in.Donald Sharp
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>
2019-11-19ospfd: Remove ORIGINAL_CODING checkDonald Sharp
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>
2019-11-14ospfd: Adding Debugs to dump OSPF DD SeqnumberSatheesh Kumar K
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>
2019-11-12Merge pull request #5313 from mjstapp/fix_bsd_addr_of_packedDonald Sharp
ospfd,eigrpd: don't take address of packed struct member
2019-11-11ospfd,eigrpd: don't take address of packed struct memberMark Stapp
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>
2019-11-11ospfd: Function order caused use after free.Donald Sharp
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>
2019-11-02lib, ospfd, zebra: Convert interface_delete to take double pointerDonald Sharp
When free'ing the interface pointer, set it to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-02*: Convert connected_free to a double pointerDonald Sharp
Set the connected pointer to set the pointer to NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-31ospf: BFD down not tearing down OSPF adjacency for point-to-point networkRadhika Mahankali
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>
2019-10-29Merge pull request #5197 from SumitAgarwal123/BFD_ADMIN_DOWNRafael Zalamena
bfdd: Handling local and remote admin-down
2019-10-28bfdd: Handling local and remote admin-downSumitAgarwal123
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
2019-10-09*: Cleanup interface creation apisStephen Worley
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>