summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_asbr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ospfd: External LSA lookup in LSDB failed in a specific scenariorgirada2020-05-291-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Description: OSPF uses an algo to generate unique LSIDs when route updates exists with same adrress and different masklens. It genearates the unique LSIDs by masking its hostbits. Ex : Rt1 : 10.0.0.0/32 - LSID : 10.0.0.0 Rt2 : 10.0.0.0/16 - LSID : 10.0.255.255 Rt3 : 10.0.0.0/24 - LSID : 10.0.0.255 Observed an issue with external LSAs when such routes originated. If the first route (with actual address as LSID) is got deleted, the routes with same addresss(different msaks) are failed to get LSA pointers from LSDB due to current fetching API design. api : ospf_external_info_find_lsa Here , it is allowing to look up the LSA with address specific unique LSID (address with host bits set ex: 10.0.255.255) only if the LSA exists where LSID as actual address of the route (ex: 10.0.0.0 ) which is not expected and cauing for other issues. Fix: Corrected this logic, by looking up the LSA with unique LSID first if it doesn’t exist then It is allowing to look up the LSDB with LSID as address of the route. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* ospfd: Restoring the original tag in external lsasrgirada2020-05-181-0/+1
| | | | | | | | | | | | Description: When a routemap applied to set a tag, all the permitted routes are refreshed with new tag, but when a different route map applied with a different action still the same tag persits in the external route. The actual tag received from zebra is expected to be set back to the routes here. Corrected this behaviour by restoring a original tag received from zebra. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
* *: don't null after XFREE; XFREE does this itselfQuentin Young2020-02-031-1/+0
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospfd: Add/fix some debugs to handle vrfDonald Sharp2019-11-191-3/+6
| | | | | | | | | | | | | 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>
* *: remove casts of XMALLOC / XCALLOCQuentin Young2019-02-261-2/+1
| | | | | | No cast necessary for void * Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: style for flog_warn conversionsQuentin Young2018-09-061-5/+5
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* ospfd: Convert ospf_asbr.c to use error-codes subsystemDonald Sharp2018-09-061-5/+6
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* ospfd: Remove unused functionDonald Sharp2018-08-211-20/+0
| | | | | | | | | | | | | The ospf_external_route_lookup function was not being used so let's just remove it. Unfortunately the removal was not quite so simple as that ospf_asbr.h was being used to generate a reference for the `struct ospf_route` data structure, so we need to fix up the compile by fixing up header inclusions so that ospf_route.h is actually included Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-9/+10
| | | | | | | | | | | | | | | | | | | | | | 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>
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-11/+8
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* ospfd: Make external routes in ospf VRF awareChirag Shah2017-11-211-13/+16
| | | | | | | | | | | | | | | | | | | Currently, ospf external routers are part of struct ospf_master which is not vrf aware ospf instance. All ospf external routes are injected/leaked into all vrfs. Moved ospf external routes db to struct ospf to make vrf aware, such one external routes learnt in one vrf is not leaked into another vrf. Ticket:CM-18855 Testing Done: Inject external route in non-default vrf x, validated ospf database across the vrf x, validated ospf routes for vrf x. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* ospfd: OSPFv2 VRF SupportChirag Shah2017-10-031-1/+2
| | | | Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-223/+211
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | 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>
* *: Consistently support 32-bit route tagsChristian Franke2016-10-081-1/+1
| | | | | | | | | | | | | | | | | | | This patch improves zebra,ripd,ripngd,ospfd and bgpd so that they can make use of 32-bit route tags in the case of zebra,ospf,bgp or 16-bit route-tags in the case of ripd,ripngd. It is based on the following patch: commit d25764028829a3a30cdbabe85f32408a63cccadf Author: Paul Jakma <paul.jakma@hpe.com> Date: Fri Jul 1 14:23:45 2016 +0100 *: Widen width of Zserv routing tag field. But also contains the changes which make this actually useful for all the daemons. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-08-181-1/+1
| | | | (cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
* ospfd: Some small tweaks to the SPF execution reason patchPaul Jakma2016-05-261-2/+1
| | | | | | | | | | | | | | | * ospf_spf.h: use an enum for the reason, and have it as a new argument to ospf_spf_calculate_schedule, no need for additional call, and let compiler do the checking. * ospf_spf.c: format changes - Quagga coding style places function names at the start of a new line, for easy grepping for definition. (ospf_spf_calculate_timer) Change the log format of SPF execution time to avoid ginormous line, and make logging conditional, as is the norm. (cherry picked from commit b6eef003e1a79471addea0b01853b08aed812cc8) Conflicts: ospfd/ospf_spf.c
* Zebra: Make redistribute do replace instead of del/add for better convergencevivek2015-10-211-8/+21
| | | | | | | | | | | | | | | | | | | Ticket: CM-6768 Reviewed By: CCR-3207 Testing Done: bgpsmoke, smoke, topo to create failure Redistributing routes goes through a del/add cycle whenever a redistributed is updated. This del/add cycle causes disruption by causing traffic loss for brief/long periods of time(6-8 s in case of OSPF). The modifications in this patch remove the del/add cycle to ensure that this disruption doesn't happen. Also fixed sending no forwarding address when announcing IPv4 routes with IPv6 nexthops, and sending nexthop only when there is a single path. Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
* Multi-Instance OSPF SummaryDonald Sharp2015-05-201-16/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ——————————————------------- - etc/init.d/quagga is modified to support creating separate ospf daemon process for each instance. Each individual instance is monitored by watchquagga just like any protocol daemons.(requires initd-mi.patch). - Vtysh is modified to able to connect to multiple daemons of the same protocol (supported for OSPF only for now). - ospfd is modified to remember the Instance-ID that its invoked with. For the entire life of the process it caters to any command request that matches that instance-ID (unless its a non instance specific command). Routes/messages to zebra are tagged with instance-ID. - zebra route/redistribute mechanisms are modified to work with [protocol type + instance-id] - bgpd now has ability to have multiple instance specific redistribution for a protocol (OSPF only supported/tested for now). - zlog ability to display instance-id besides the protocol/daemon name. - Changes in other daemons are to because of the needed integration with some of the modified APIs/routines. (Didn’t prefer replicating too many separate instance specific APIs.) - config/show/debug commands are modified to take instance-id argument as appropriate. Guidelines to start using multi-instance ospf --------------------------------------------- The patch is backward compatible, i.e for any previous way of single ospf deamon(router ospf <cr>) will continue to work as is, including all the show commands etc. To enable multiple instances, do the following: 1. service quagga stop 2. Modify /etc/quagga/daemons to add instance-ids of each desired instance in the following format: ospfd=“yes" ospfd_instances="1,2,3" assuming you want to enable 3 instances with those instance ids. 3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf and ospfd-3.conf. 4. service quagga start/restart 5. Verify that the deamons are started as expected. You should see ospfd started with -n <instance-id> option. ps –ef | grep quagga With that /var/run/quagga/ should have ospfd-<instance-id>.pid and ospfd-<instance-id>/vty to each instance. 6. vtysh to work with instances as you would with any other deamons. 7. Overall most quagga semantics are the same working with the instance deamon, like it is for any other daemon. NOTE: To safeguard against errors leading to too many processes getting invoked, a hard limit on number of instance-ids is in place, currently its 5. Allowed instance-id range is <1-65535> Once daemons are up, show running from vtysh should show the instance-id of each daemon as 'router ospf <instance-id>’ (without needing explicit configuration) Instance-id can not be changed via vtysh, other router ospf configuration is allowed as before. Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
* Add support for route tagsDonald Sharp2015-05-201-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Credit ------ A huge amount of credit for this patch goes to Piotr Chytla for their 'route tags support' patch that was submitted to quagga-dev in June 2007. Documentation ------------- All ipv4 and ipv6 static route commands now have a "tag" option which allows the user to set a tag between 1 and 65535. quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag ? <1-65535> Tag value quagga(config)# ip route 1.1.1.1/32 10.1.1.1 tag 40 quagga(config)# quagga# show ip route 1.1.1.1/32 Routing entry for 1.1.1.1/32 Known via "static", distance 1, metric 0, tag 40, best * 10.1.1.1, via swp1 quagga# The route-map parser supports matching on tags and setting tags ! route-map MATCH_TAG_18 permit 10 match tag 18 ! ! route-map SET_TAG_22 permit 10 set tag 22 ! BGP and OSPF support: - matching on tags when redistribing routes from the RIB into BGP/OSPF. - setting tags when redistribing routes from the RIB into BGP/OSPF. BGP also supports setting a tag via a table-map, when installing BGP routes into the RIB. Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
* ospfd-spf-stats.patchDonald Sharp2015-05-201-0/+1
| | | | | | | | | | | | | | | | | Compute and display SPF execution statistics Detailed SPF statistics, all around time spent executing various pieces of SPF such as the SPF algorithm itself, installing routes, pruning unreachable networks etc. Reason codes for firing up SPF are: R - Router LSA, N - Network LSA, S - Summary LSA, ABR - ABR status change, ASBR - ASBR Status Change, AS - ASBR Summary, M - MaxAge Signed-off-by: Dinesh G Dutt <ddutt@cumulusnetworks.com> Reviewed-by: JR Rivers <jrrivers@cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma@cumulusnetworks.com> Reviewed-by: Ayan Banerjee <ayan@cumulusnetworks.com>
* *: nuke ^L (page feed)David Lamparter2014-06-041-3/+3
| | | | | | | | | | | | | | Quagga sources have inherited a slew of Page Feed (^L, \xC) characters from ancient history. Among other things, these break patchwork's XML-RPC API because \xC is not a valid character in XML documents. Nuke them from high orbit. Patches can be adapted simply by: sed -e 's%^L%%' -i filename.patch (you can type page feeds in some environments with Ctrl-V Ctrl-L) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* security: Fix some typos and potential NULL-derefRemi Gacogne2014-02-111-1/+2
| | | | | | | | | This patch against the git tree fixes minor typos, some of them possibily leading to NULL-pointer dereference in rare conditions. Signed-off-by: Remi Gacogne <rgacogne-github@coredump.fr> Signed-off-by: Joachim Nilsson <troglobit@gmail.com> Acked-by: Feng Lu <lu.feng@6wind.com>
* ospfd: avoid redundant lookup in ospf_redistribute_withdrawStephen Hemminger2011-12-061-1/+4
| | | | | | | | | | The old algorithim looked up every node twice as it withdrew the entry. It looks up entry once in redistribute_withdraw, then looks it up again info_delete. Use result of first lookup to do the free directly. This may explain the slow performance observed in https://bugzilla.vyatta.com/show_bug.cgi?id=4421
* ospfd: Unify router and network LSA refresh logic with general refresherPaul Jakma2010-12-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | * (general) Get rid of the router and network LSA specific refresh timers and make the general refresher do this instead. Get rid of the twiddling of timers for router/network LSA that was spread across the code. This lays the foundations for future, general LSA refresh improvements, such as making sequence rollover work, and having generic LSA delays. * ospfd.h: (struct ospf) Bye bye to the router-lsa update timer thread pointer. (struct ospf_area) and to the router-lsa refresh timer. * ospf_interface.h: Remove the network_lsa_self timer thread pointer * ospf_lsa.h: (struct ospf_lsa) oi field should always be there, for benefit of type-2/network LSA processing. (ospf_{router,network}_lsa_{update_timer,timer_add}) no timers for these more (ospf_{router,network}_lsa_update) more generic functions to indicate that some router/network LSAs need updating (ospf_router_lsa_update_area) update router lsa in a particular area alone. (ospf_{summary,summary_asbr,network}_lsa_refresh) replaced by the general ospf_lsa_refresh function. (ospf_lsa_refresh) general LSA refresh function
* [cleanup] Convert XMALLOC/memset to XCALLOCStephen Hemminger2009-06-121-2/+1
| | | | Simple conversion of XMALLOC/memset to XCALLOC
* [ospfd] CID #28, remove another ospf_lookup call - ospf_redistribute_withdrawPaul Jakma2006-05-131-4/+1
| | | | | | | | | | | 2006-05-12 Paul Jakma <paul.jakma@sun.com> * ospf_asbr.c: (ospf_redistribute_withdraw) remove ospf_lookup call by taking the struct ospf * as argument, which the caller has, fixing CID #28. * ospf_asbr.h: (ospf_redistribute_withdraw) update declaration * ospf_zebra.c: (ospf_redistribute_unset) update call to ospf_redistribute_withdraw to match.
* 2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2005-10-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * zebra.h: Declare new functions zebra_route_string() and zebra_route_char(). * log.c: (zroute_lookup,zebra_route_string,zebra_route_char) New functions to map zebra route numbers to strings. * zebra_vty.c: (route_type_str) Remove obsolete function: use new library function zebra_route_string() instead. Note that there are a few differences: for IPv6 routes, we now get "ripng" and "ospf6" instead of the old behavior ("rip" and "ospf"). (route_type_char) Remove obsolete function: ues new library function zebra_route_char() instead. Note that there is one difference: the old function returned 'S' for a ZEBRA_ROUTE_SYSTEM route, whereas the new one returns 'X'. (vty_show_ip_route_detail,vty_show_ipv6_route_detail) Replace route_type_str() with zebra_route_string(). (vty_show_ip_route,vty_show_ipv6_route) Replace route_type_char() with zebra_route_char(). * bgp_vty.c: (bgp_config_write_redistribute) Use new library function zebra_route_string instead of a local hard-coded table. * ospf6_asbr.c: Remove local hard-coded tables zroute_name and zroute_abname. Change the ZROUTE_NAME macro to use new library function zebra_route_string(). Remove the ZROUTE_ABNAME macro. (ospf6_asbr_external_route_show): Replace ZROUTE_ABNAME() with a call to zebra_route_char(), and be sure to fix the format string, since we now have a char instead of a char *. * ospf6_zebra.c: Remove local hard-coded tables zebra_route_name and zebra_route_abname. Note that the zebra_route_name[] table contained mixed-case strings, whereas the zebra_route_string() function returns lower-case strings. (ospf6_zebra_read_ipv6): Change debug message to use new library function zebra_route_string() instead of zebra_route_name[]. (show_zebra): Use new library function zebra_route_string() instead of zebra_route_name[]. * ospf_dump.c: Remove local hard-coded table ospf_redistributed_proto. (ospf_redist_string) New function implemented using new library function zebra_route_string(). Note that there are a few differences in the output that will result: the new function returns strings that are lower-case, whereas the old table was mixed case. Also, the old table mapped ZEBRA_ROUTE_OSPF6 to "OSPFv3", whereas the new function returns "ospf6". * ospfd.h: Remove extern struct message ospf_redistributed_proto[], and add extern const char *ospf_redist_string(u_int route_type) instead. * ospf_asbr.c: (ospf_external_info_add) In two messages, use ospf_redist_string instead of LOOKUP(ospf_redistributed_proto). * ospf_vty.c: Remove local hard-coded table distribute_str. (config_write_ospf_redistribute,config_write_ospf_distribute): Use new library function zebra_route_string() instead of distribute_str[]. * ospf_zebra.c: (ospf_redistribute_set,ospf_redistribute_unset, ospf_redistribute_default_set,ospf_redistribute_check) In debug messages, use ospf_redist_string() instead of LOOKUP(ospf_redistributed_proto). * rip_zebra.c: (config_write_rip_redistribute): Remove local hard-coded table str[]. Replace str[] with calls to new library function zebra_route_string(). * ripd.c: Remove local hard-coded table route_info[]. (show_ip_rip) Replace uses of str[] with calls to new library functions zebra_route_char and zebra_route_string. * ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded table str[]. Replace str[i] with new library function zebra_route_string(i). * ripngd.c: Remove local hard-coded table route_info[]. (show_ipv6_ripng) Use new library function zebra_route_char() instead of table route_info[].
* 2005-09-19 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2005-09-191-1/+2
| | | | | | | | | | | | | | | | * ospf_lsa.h: (ospf_external_lsa_flush) Comment out the 5th argument (nexthop) since it is not used in the function (except inside some commented-out code). * ospf_lsa.c: (ospf_external_lsa_flush,ospf_external_lsa_refresh) Comment out the 5th argument to ospf_external_lsa_flush. * ospf_asbr.c: (ospf_redistribute_withdraw) Comment out 5th arg to ospf_external_lsa_flush. * ospf_vty.c: (no_ospf_default_information_originate) Eliminate 5th uninitialized nexthop arg to ospf_external_lsa_flush. * ospf_zebra.c: (ospf_zebra_read_ipv4) Comment out 5th arg to ospf_external_lsa_flush. * ospfd.c: (ospf_network_set) Comment out 5th arg to ospf_external_lsa_flush.
* 2005-05-06 Paul Jakma <paul.jakma@sun.com>paul2005-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * (general) extern and static qualifiers added. unspecified arguments in definitions fixed, typically they should be 'void'. function casts added for callbacks. Guards added to headers which lacked them. Proper headers included rather than relying on incomplete definitions. gcc noreturn function attribute where appropriate. * ospf_opaque.c: remove the private definition of ospf_lsa's ospf_lsa_refresh_delay. * ospf_lsa.h: export ospf_lsa_refresh_delay * ospf_packet.c: (ospf_make_md5_digest) make *auth_key const, correct thing to do - removes need for the casts later. * ospf_vty.c: Use vty.h's VTY_GET_INTEGER rather than ospf_vty's home-brewed versions, shuts up several warnings. * ospf_vty.h: remove VTY_GET_UINT32. VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX moved to lib/vty.h. * ospf_zebra.c: (ospf_distribute_list_update_timer) hacky overloading of the THREAD_ARG pointer should at least use uintptr_t.
* 2004-12-08 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2004-12-081-20/+26
| | | | * *.c: Change level of debug messages to LOG_DEBUG.
* Initial revisionpaul2002-12-131-0/+287