summaryrefslogtreecommitdiffstats
path: root/isisd/isis_route.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* isisd: introduce new route update hookRenato Westphal2019-09-171-7/+16
| | | | | | | | This hook will be called whenever a route is added, updated or deleted. It will be used, for instance, by the SR code to keep Prefix-SIDs in sync with their associated routes. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* isisd: move management of route flags out of isis_zebra.cRenato Westphal2019-09-171-2/+25
| | | | | | | | For better modularity, isis_zebra.c should only contain code used to communicate with zebra. The management of route flags belongs to isis_route.c. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* isisd: unify isis_nexthop and isis_nexthop6 into a single structRenato Westphal2019-08-211-146/+92
| | | | | | | This unification allows us to write code that works for both IPv4 and IPv6, reducing duplication. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* isisd: reuse the nexthop lookup functions to avoid code duplicationRenato Westphal2019-08-211-24/+19
| | | | | | Nothing special here. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* isisd: remove unnecessary null checksRenato Westphal2019-08-211-4/+2
| | | | | | | | | These null checks don't make sense because a) these two functions are never called with a NULL IP address and b) the same pointers are dereferenced later without any protection. Remove these NULL checks to make the code less confusing. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* isisd: remove unused struct fieldsRenato Westphal2019-08-211-2/+0
| | | | | | | These fields were introduced by commit e38e0df01ad, but they were never put to any use. Remove them. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* isisd: del routes when area is unconfiguredEmanuele Di Pascale2019-05-291-1/+7
| | | | | | attempt to fix #4399 Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
* isisd: replace dict_* with DECLARE_RBTREEDavid Lamparter2019-04-271-1/+0
| | | | | | | | Historically, isisd has been carrying around its own red-black tree to manage its LSP DB in. This replaces that with the newly-added DECLARE_RBTREE_*. This allows completely removing the dict_* code. Signed-off-by: David Lamparter <equinox@diac24.net>
* bgpd isisd lib: fix return on void functionsF. Aragon2018-11-201-1/+1
| | | | | | ISO C forbids ‘return’ with expression, in function returning void. Signed-off-by: F. Aragon <paco@voltanet.io>
* *: list_delete_and_null() -> list_delete()David Lamparter2018-10-021-2/+2
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* isisd: fix refcounting in isis_route.cChristian Franke2018-08-031-26/+37
| | | | | | | This fixes multiple issues and inefficiencies regarding the usage of route_tables in isis_route.c and removes some memory leaks. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: make spf code dst-src awareChristian Franke2018-08-031-21/+44
| | | | | | | Take the source-prefix sub-TLV into consideration when running SPF and support creation/deletion of dst-src routes as result. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: fix isis_route_merge_verify logicChristian Franke2018-08-031-3/+28
| | | | | | | | | | | | | | | | | | | | | | This addresses two issues for L1L2 operation: a) If an L1 route has ROUTE_ACTIVE unset and an L2 route for the same destination has ROUTE_ACTIVE set, isisd would still put the L1 route into the merged table. This causes the route for the destination to get uninstalled from zebra until the next SPF run, which is incorrect. To fix this, look at the ROUTE_ACTIVE flag and allow L2 routes to win against L1 routes, when the L1 has ROUTE_ACTIVE unset. b) If an L1 route wins against an existing L2 route, the ZEBRA_SYNCED flag would remain on the L2 route. This leads to the problem that when the L1 route disappears again, the L2 doesn't get reinstalled, since isisd assumes it's already in the RIB because ZEBRA_SYNCED is set. Solve this by clearing ZEBRA_SYNCED on L2 routes, if they lose against an L1 route. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: move route_table into spftreeChristian Franke2018-08-031-111/+36
| | | | | | | | As isisd's route_tables are directly related to spf trees, move the route tables into the spftree instead of maintaining them alongside of the spftrees. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* isisd: remove unused debug codeChristian Franke2018-03-101-40/+0
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* *: Convert list_delete(struct list *) to ** to allow nullingDonald Sharp2017-10-051-2/+2
| | | | | | | | | | | | | | | | | | | Convert the list_delete(struct list *) function to use struct list **. This is to allow the list pointer to be nulled. I keep running into uses of this list_delete function where we forget to set the returned pointer to NULL and attempt to use it and then experience a crash, usually after the developer has long since left the building. Let's make the api explicit in it setting the list pointer to null. Cynical Prediction: This code will expose a attempt to use the NULL'ed list pointer in some obscure bit of code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: use only one IP of neighbor as nexthopChristian Franke2017-09-231-6/+2
| | | | | | | | There is no point in building a multipath route via one neighbor if there is only one link to the neighbor, but the neighbor has multiple IPs on that link. So only create one nexthop per link. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: send/receive LSPs with new parserChristian Franke2017-08-031-1/+0
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* isisd: send/receive IIHs with new parserChristian Franke2017-08-031-8/+6
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-504/+484
| | | | | | 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/+4
| | | | | | | | | | | 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>
* isisd: Clean up leaked memoryDonald Sharp2017-03-011-0/+1
| | | | | | | When in error path clean up the route table created. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* Merge remote-tracking branch 'origin/stable/2.0'Donald Sharp2017-02-241-0/+6
|\
| * isisd: address coverity findingsChristian Franke2017-02-131-4/+6
| |
* | frr: Remove HAVE_IPV6 from code baseDonald Sharp2017-01-131-23/+0
|/ | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: Segmentation fault on isis daemon fixesboris yakubov2016-09-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have a fix for 2 segmentation fault scenarios on the isis daemon: 1. When running a command "isis passive" on an interface in the following context: "end" "configure terminal " "interface dummy0" "isis passive" The trace back collected: isis_adjacency.c:521 family=2, root_sysid=0x20aee6d0 "", parent=0x20af4d68) at isis_spf.c:999 sysid=0x20aee6d0 "") at isis_spf.c:1217 isis_spf.c:1372 isis_lsp.c:416 isis_lsp.c:1660 isis_main.c:368 The fix location: file name: isisd/isis_adjacency.c routine name: isis_adj_build_up_list 2. When deleting the existing isis router instance: "end" "configure terminal " "no router isis DEAD" The fix location: isisd/isis_events.c, routine circuit_resign_level isisd/isis_lsp.c, routine lsp_destroy isisd/isis_route.c, isis_route_validate The trace back collection: "DEAD") at isisd.c:252 argc=1, argv=0xbfc39054) at isisd.c:1520 vty=0x20d6f528, cmd=0x0) at command.c:2121 cmd=0x0, vtysh=0) at command.c:2155 isis DEAD") at vty.c:433 isis_main.c:368 and "DEAD") at isisd.c:260 argc=1, argv=0xbfd6cf54) at isisd.c:1520 vty=0x208cb528, cmd=0x0) at command.c:2121 cmd=0x0, vtysh=0) at command.c:2155 isis DEAD") at vty.c:433 isis_main.c:368 The patch is included. patchwork #833: http://patchwork.quagga.net/patch/833/
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-08-181-5/+5
| | | | (cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
* isisd: remove superfluous checks after XMALLOC etc.Christian Franke2016-03-301-19/+0
| | | | Signed-off-by: Christian Franke <chris@opensourcerouting.org>
* Quagga: prefix2str fixupDonald Sharp2015-11-231-6/+6
| | | | | | | During CR for nexthop upstream it was noticed that usage of prefix2str was not consistent. This fixes this problem Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* isisd: address Coverity warningsDavid Lamparter2012-12-121-1/+5
| | | | | | | | | | | | | | | | | this fixes a bunch of issues found by Coverity SCAN and flagged as "high" impact -- although, they're all rather minute issues. * isisd/isis_adjacency.c: one superfluous check, one possible NULL deref * isisd/isis_circuit.c: two prefix memory leaks * isisd/isis_csm.c: one missing break * isisd/isis_lsp.c: one possible NULL deref * isisd/isis_pfpacket.c: one error-case fd leak * isisd/isis_route.c: one isis_route_info memory leak * isisd/isis_routemap.c: one... fnord * isisd/isis_tlv.c: one infinite loop Reported-by: Coverity SCAN Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* isisd: couple of bug fixesSubbaiah Venkata2012-04-071-5/+13
|
* isisd: add Google's changes to IS-ISJosh Bailey2012-04-071-156/+92
|
* [isisd] Fix compiler warnings and allow v4-only compilationPaul Jakma2006-12-081-1/+8
| | | | | | | | | | | 2006-12-08 Hannes Gredler <hannes@gredler.at> * isis_adjacency.c: (isis_new_adj) Allow NULL snpa argument. * isis_pdu.c: (various) Update calls to isis_new_adj() to pass NULL and use default. * (general) Add forward declarations where required. Fix up const char *'s. Allow V4-only compilation.
* [isisd] remove includes of common system headers.paul2005-11-201-2/+0
| | | | | | | | | | | 2005-11-20 Paul Jakma <paul.jakma@sun.com> * (general) remove includes of very common system headers, these are already picked up by zebra.h. Further, including them before zebra.h messes up all our lovely (sarcasm) autoconf'd detecting of platform specific things. Recent addition of stdint.h to configure.ac and zebra.h appears particularly to throw up this problem.
* * isis_adjacency.c: Stop expire timer while deleting adjacency.hasso2005-10-011-1/+2
| | | | | | | | | | * isis_events.c: Stop pseudo LSP thread while resigning circuit from level. * isis_route.c: Fix compiling with EXTREME_DEBUG. Mark route as not in sync with zebra if it's changed. * isis_spf.c: Schedule route validating etc even if tent was empty. It's probably because we just don't have any adjacencies. * isisd.c: Write minimum spf interval into configuration.
* 2005-09-30 Vincent Jardin <vincent.jardin@6wind.com>jardin2005-10-011-0/+1
| | | | * isis_route.c: fix EXTREME_DEBUG compilation
* * *.c: Massive cleanup of lists loops. Stop abusing ALL_LIST_ELEMENTS.hasso2005-09-281-22/+19
| | | | | | Replace XMALLOC + memset with XCALLOC. Fix some indentation issues. The only really significant change is simplified isis_delete_adj function in isis_adjacency.c.
* * isis_spf.c: Changing cost from uint16_t to uint32_t. Unsethasso2005-09-261-27/+135
| | | | | | | | | | | | | ISIS_ROUTE_FLAG_ACTIVE flag before running SPF. * isisd.[ch]: Separate route tables for different levels. SPF is done separately, but in case of L1L2 area they have to be merged. * isis_zebra.c: Set/unset ISIS_ROUTE_FLAG_ZEBRA_SYNC flag correctly in case of adding/removing IPv4 routes. * zebra_route.c: Rework route validating process. Merging L1 and L2 tables in case of L1L2 area. In short - many changes to make SPF work more correctly, add/remove to/from RIB also works now. It's still very far from perfect though.
* * isis_route.c: Fix output of nexthops in case of extreme debug.hasso2005-09-211-6/+16
|
* 2005-04-07 Paul Jakma <paul.jakma@sun.com>paul2005-04-071-66/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (global): Fix up list loops to match changes in lib/linklist, and some basic auditing of usage. * configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES * HACKING: Add notes about deprecating interfaces and commands. * lib/linklist.h: Add usage comments. Rename getdata macro to listgetdata. Rename nextnode to listnextnode and fix its odd behaviour to be less dangerous. Make listgetdata macro assert node is not null, NULL list entries should be bug condition. ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use with for loop, Suggested by Jim Carlson of Sun. Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the "safety" of previous macro. LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to distinguish from the similarly named functions, and reflect their effect better. Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section with the old defines which were modified above, for backwards compatibility - guarded to prevent Quagga using it.. * lib/linklist.c: fix up for linklist.h changes. * ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single scan of the area list, rather than scanning all areas first for INTER_ROUTER and then again for INTER_NETWORK. According to 16.2, the scan should be area specific anyway, and further ospf6d does not seem to implement 16.3 anyway.
* * *.c: Changed many functions to static. Some commented outhasso2005-01-181-25/+26
| | | | functions and some tiny related fixes. No functional changes.
* zlog_* cleanup. Level of debug messages to LOG_DEBUG.hasso2004-12-241-18/+18
|
* Compiler warnings fixes.hasso2004-09-261-6/+6
|
* Indentation only. No any functional changes.hasso2004-09-101-267/+301
|
* Make it compile in NetBSD and OpenBSD.hasso2004-05-191-1/+0
|
* Initial revisionjardin2003-12-231-0/+615