summaryrefslogtreecommitdiffstats
path: root/ospf6d (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ospfd: use new defaults mechanism (v2)David Lamparter2019-12-062-10/+17
| | | | | | | | | | 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>
* 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>
* *: generously apply constDavid Lamparter2019-12-029-45/+47
| | | | | | 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-15/+31
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* *: Convert connected_free to a double pointerDonald Sharp2019-11-021-1/+1
| | | | | | Set the connected pointer to set the pointer to NULL. Signed-off-by: Donald Sharp <sharpd@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
* | Merge pull request #5009 from donaldsharp/interface_deletionRuss White2019-09-302-55/+54
|\ \ | | | | | | lib, zebra: Allow for interface deletion when kernel event happens
| * | *: Convert zapi->interface_delete to ifp callbackDonald Sharp2019-09-192-20/+8
| | | | | | | | | | | | | | | | | | | | | 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-20/+9
| | | | | | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
| * | *: Convert from ->interface_up to the interface callbackDonald Sharp2019-09-192-1/+9
| | | | | | | | | | | | | | | | | | | | | 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-192-14/+6
| | | | | | | | | | | | | | | | | | | | | 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/+22
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ospf6d: Prevent use after freeDonald Sharp2019-09-253-26/+64
| | | | | | | | | | | | | | | | | | the for (ALL_LSDB...) macro was iterating over lsa, when lsa had just been freed in these functions. Remove the macro and make the adjustments saving lsa_next before the free. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | Merge pull request #4995 from opensourcerouting/ospf6d-iftypeRuss White2019-09-244-25/+37
|\ \ | | | | | | ospf6d: fix interface type handling
| * | ospf6d: track explicit interface type configDavid Lamparter2019-09-172-18/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the interface doesn't exist in system, we'll default to broadcast and then later not change that when the interface comes up. Explicitly track whether the user configured the type and properly auto-set it if they didn't. Fixes: #3930 Fixes: #4873 Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * | ospf6d: fix mistaken if_is_* instead of oi->typeDavid Lamparter2019-09-173-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | If the user configured an interface to be in a particular mode, we need to be consistent about that. No looking at if_is_pointopoint() or if_is_broadcast(). Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * | ospf6d: interface state needs update even w/o areaDavid Lamparter2019-09-171-2/+0
| |/ | | | | | | | | | | | | We can't skip reading interface state if there's no area yet, we'll be missing information later when the interface is configured. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #4529 from donaldsharp/vrf_conversionsRenato Westphal2019-09-202-2/+6
|\ \ | |/ |/| Vrf conversions
| * ospf6: Add vrf_id to the ospf6 data structureDonald Sharp2019-09-102-2/+6
| | | | | | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | lib: rmap dep table is not correct in case of exact-match clausevdhingra2019-09-151-1/+0
|/ | | | | | | | | | | User pass the string match large-community 1 exact-match from CLI. Now route map lib has got the string as "1 exact-match". It passes the string to call back for compilation. BGP will parse this string and came to know that for "1" it has to do exact match. Routemap lib has to save "1" in it’s dependency table. Here routemap is saving this as a “1 exact-match” which is wrong. The solution is used the compiled data. Signed-off-by: vishaldhingra <vdhingra@vmware.com>
* *: frr_elevate_privs -> frr_with_privsDavid Lamparter2019-09-031-1/+1
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Convert some route map functions to return the enumDonald Sharp2019-09-031-8/+17
| | | | | | | | | | | | | Conver these functions: route_map_add_match route_map_delete_match route_map_add_set route_map_delete_set To return the `enum rmap_compile_rets` and ensure all functions that use this code handle all the enumerated possible returns. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: Fix spelling errors pointed out by debian packagingDonald Sharp2019-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Debian packaging when run finds a bunch of spelling errors: I: frr: spelling-error-in-binary usr/bin/vtysh occurences occurrences I: frr: spelling-error-in-binary usr/lib/frr/bfdd Amount of times Number of times I: frr: spelling-error-in-binary usr/lib/frr/bgpd occurences occurrences I: frr: spelling-error-in-binary usr/lib/frr/bgpd recieved received I: frr: spelling-error-in-binary usr/lib/frr/isisd betweeen between I: frr: spelling-error-in-binary usr/lib/frr/ospf6d Infomation Information I: frr: spelling-error-in-binary usr/lib/frr/ospfd missmatch mismatch I: frr: spelling-error-in-binary usr/lib/frr/pimd bootsrap bootstrap I: frr: spelling-error-in-binary usr/lib/frr/pimd Unknwon Unknown I: frr: spelling-error-in-binary usr/lib/frr/zebra Requsted Requested I: frr: spelling-error-in-binary usr/lib/frr/zebra uknown unknown I: frr: spelling-error-in-binary usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0 overriden overridden This commit fixes all of them except the bgp `recieved` issue due to it being part of json output. That one will need to go through a deprecation cycle. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOPLakshman Krishnamoorthy2019-07-221-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introducing a 3rd state for route_map_apply library function: RMAP_NOOP Traditionally route map MATCH rule apis were designed to return a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH. (Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR). Depending on this response, the following statemachine decided the course of action: State1: If match cmd returns RMAP_MATCH then, keep existing behaviour. If routemap type is PERMIT, execute set cmds or call cmds if applicable, otherwise PERMIT! Else If routemap type is DENY, we DENYMATCH right away State2: If match cmd returns RMAP_NOMATCH, continue on to next route-map. If there are no other rules or if all the rules return RMAP_NOMATCH, return DENYMATCH We require a 3rd state because of the following situation: The issue - what if, the rule api needs to abort or ignore a rule?: "match evpn vni xx" route-map filter can be applied to incoming routes regardless of whether the tunnel type is vxlan or mpls. This rule should be N/A for mpls based evpn route, but applicable to only vxlan based evpn route. Also, this rule should be applicable for routes with VNI label only, and not for routes without labels. For example, type 3 and type 4 EVPN routes do not have labels, so, this match cmd should let them through. Today, the filter produces either a match or nomatch response regardless of whether it is mpls/vxlan, resulting in either permitting or denying the route.. So an mpls evpn route may get filtered out incorrectly. Eg: "route-map RM1 permit 10 ; match evpn vni 20" or "route-map RM2 deny 20 ; match vni 20" With the introduction of the 3rd state, we can abort this rule check safely. How? The rules api can now return RMAP_NOOP to indicate that it encountered an invalid check, and needs to abort just that rule, but continue with other rules. As a result we have a 3rd state: State3: If match cmd returned RMAP_NOOP Then, proceed to other route-map, otherwise if there are no more rules or if all the rules return RMAP_NOOP, then, return RMAP_PERMITMATCH. Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
* Revert "Ospf missing interface handling 2"Donald Sharp2019-06-243-13/+7
|
* *: change if_lookup_by_name() api with vrfPhilippe Guibert2019-06-123-6/+11
| | | | | | | | | | the vrf_id parameter is replaced by struct vrf * parameter. this impacts most of the daemons that look for an interface based on the name and the vrf identifier. Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was ignored until now. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* ospf, ospf6d, zebra, lib: change if_get_by_name prototype with vrfPhilippe Guibert2019-06-111-1/+2
| | | | | | | | vrf pointer is used as reference when calling if_get_by_name() function. this will permit to create interfaces with an unknown vrf_id, since it is only necessary to get the vrf structure to store the interfaces. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* Revert of PR 4078 and PR 4315Lakshman Krishnamoorthy2019-06-041-12/+14
| | | | Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
* lib: Introducing a 3rd state for route-map match cmd: RMAP_NOOPLakshman Krishnamoorthy2019-05-301-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introducing a 3rd state for route_map_apply library function: RMAP_NOOP Traditionally route map MATCH rule apis were designed to return a binary response, consisting of either RMAP_MATCH or RMAP_NOMATCH. (Route-map SET rule apis return RMAP_OKAY or RMAP_ERROR). Depending on this response, the following statemachine decided the course of action: Action: Apply route-map match and return the result (RMAP_MATCH/RMAP_NOMATCH) State1: Receveived RMAP_MATCH THEN: If Routemap type is PERMIT, execute other rules if applicable, otherwise we PERMIT! Else: If Routemap type is DENY, we DENYMATCH right away State2: Received RMAP_NOMATCH, continue on to next route-map, otherwise, return DENYMATCH by default if nothing matched. With reference to PR 4078 (https://github.com/FRRouting/frr/pull/4078), we require a 3rd state because of the following situation: The issue - what if, the rule api needs to abort or ignore a rule?: "match evpn vni xx" route-map filter can be applied to incoming routes regardless of whether the tunnel type is vxlan or mpls. This rule should be N/A for mpls based evpn route, but applicable to only vxlan based evpn route. Today, the filter produces either a match or nomatch response regardless of whether it is mpls/vxlan, resulting in either permitting or denying the route.. So an mpls evpn route may get filtered out incorrectly. Eg: "route-map RM1 permit 10 ; match evpn vni 20" or "route-map RM2 deny 20 ; match vni 20" With the introduction of the 3rd state, we can abort this rule check safely. How? The rules api can now return RMAP_NOOP (or another enum) to indicate that it encountered an invalid check, and needs to abort just that rule, but continue with other rules. Question: Do we repurpose an existing enum RMAP_OKAY or RMAP_ERROR as the 3rd state (or create a new enum like RMAP_NOOP)? RMAP_OKAY and RMAP_ERROR are used to return the result of set cmd. We chose to go with RMAP_NOOP (but open to ideas), as a way to bypass the rmap filter As a result we have a 3rd state: State3: Received RMAP_NOOP Then, proceed to other route-map, otherwise return RMAP_PERMITMATCH by default. Signed-off-by:Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
* bfdd, lib, bgpd: add bfd cbit usagePhilippe Guibert2019-05-141-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | bfd cbit is a value carried out in bfd messages, that permit to keep or not, the independence between control plane and dataplane. In other words, while most of the cases plan to flush entries, when bfd goes down, there are some cases where that bfd event should be ignored. this is the case with non stop forwarding mechanisms where entries may be kept. this is the case for BGP, when graceful restart capability is used. If BFD event down happens, and bgp is in graceful restart mode, it is wished to ignore the BFD event while waiting for the remote router to restart. The changes take into account the following: - add a config flag across zebra layer so that daemon can set or not the cbit capability. - ability for daemons to read the remote bfd capability associated to a bfd notification. - in bfdd, according to the value, the cbit value is set - in bfdd, the received value is retrived and stored in the bfd session context. - by default, the local cbit announced to remote is set to 1 while preservation of the local path is not set. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* Merge pull request #4304 from donaldsharp/route_map_switchDavid Lamparter2019-05-141-1/+1
|\ | | | | Route map switch
| * bgpd, lib, ospf6d, ospfd, pimd, zebra: Rework routemap event callbackDonald Sharp2019-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | The route_map_event_hook callback was passing the `route_map_event_t` to each individual interested party. No-one is ever using this data so let's cut to the chase a bit and remove the pass through of data. This is considered ok in that the routemap.c code came this way originally and after 15+ years no-one is using this functionality. Nor do I see any `easy` way to do anything useful with this data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* | bgp, ospfd, ospf6d, pimd, lib, isisd: add bfd_client_sendmsg vrf_idPhilippe Guibert2019-05-072-2/+2
|/ | | | | | | vrf_id parameter is added to the api of bfd_client_sendmsg(). this permits being registered to bfd from a separate vrf. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* *: use ZAPI_CALLBACK_ARGS macro for zapi handlersQuentin Young2019-05-032-25/+12
| | | | | | | | | | | | This macro: - Marks ZAPI callbacks for readability - Standardizes argument names - Makes it simple to add ZAPI arguments in the future - Ensures proper types - Looks better - Shortens function declarations Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospf6d: replace pqueue_* with DECLARE_SKIPLISTDavid Lamparter2019-04-272-17/+17
| | | | | | | As the previous commit, this replaces ospf6d's pqueue_* usage in SPF calculations with a DECLARE_SKIPLIST_* skiplist. Signed-off-by: David Lamparter <equinox@diac24.net>
* ospf6d: listhead returns a listnode *Donald Sharp2019-04-171-2/+3
| | | | | | | | | | The ospf6_route_get_first_nh_index function call calls listhead which returns a (listnode *) but we are casting it to a (struct ospf6_nexthop *) and away we go. Fixes: #4142 Found By: Kwind Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd, ospf6d, ripngd: Do not allow v6 LL's to be `redist connected` inDonald Sharp2019-03-271-0/+3
| | | | | | | | | | | | The rib process of handling routes has been unified a bit more and as a result v6 LL routes are now showing up as a result of a `redistribute connected`. Doing anything with these routes is a policy decision that should be enforced by the individual routing daemons not by zebra. As such add a bit of code to isisd, ripngd and opsf6d to handle them. The bgp daemon already handles this situation. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: remove trailing newlines from zlog messagesQuentin Young2019-03-143-5/+5
| | | | | | Zlog puts its own newlines on, and doing this makes logs look nasty. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: replace XMALLOC + memset with XCALLOCQuentin Young2019-02-261-3/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove casts of XMALLOC / XCALLOCQuentin Young2019-02-264-16/+9
| | | | | | No cast necessary for void * Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: remove null check before XFREEQuentin Young2019-02-262-6/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: do not check XMALLOC / XCALLOC for null retQuentin Young2019-02-261-4/+0
| | | | | | They never return NULL Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: use array_size instead of raw divisionQuentin Young2019-02-261-14/+8
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospf6d: reset the global ospf6 pointerPhilippe Guibert2019-02-151-1/+3
| | | | | | reset the global ospf6 pointer. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* ospf6d: upon interface deletion, the area if list may be updatedPhilippe Guibert2019-02-143-0/+18
| | | | | | | | there are some events where the list of interfaces per area should be reviewed due to an interface is being removed. This fix avoids having some memory leak. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* ospf6d: closing server socket when leaving ospf6dPhilippe Guibert2019-02-143-0/+12
| | | | | | | this commit brings consistency as it closes the socket used to carry ospfv3 messages. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* ospf6d: unitialised buffer zone used by socketPhilippe Guibert2019-02-141-0/+1
| | | | | | a buffer zone is initialised, before being used by server socket. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* ospf6d: Added changes to track route-map usagergirada2019-02-041-1/+11
| | | | | | | | | | | | | | Made changes and updated the routemap applied counter in the following flows. 1.Increment the routemap applied counter when route map attached to a redistribution list. The counter will be updated if the routemap exists. 2.Decrement when route map removed / modified from a redistribution  list. 3.Increment/decrement when route map create/delete callback triggered. Signed-off-by: RajeshGirada <rgirada@vmware.com>