summaryrefslogtreecommitdiffstats
path: root/eigrpd (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: explicitly print "exit" at the end of every node configIgor Ryzhov2021-08-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a possibility that the same line can be matched as a command in some node and its parent node. In this case, when reading the config, this line is always executed as a command of the child node. For example, with the following config: ``` router ospf network 193.168.0.0/16 area 0 ! mpls ldp discovery hello interval 111 ! ``` Line `mpls ldp` is processed as command `mpls ldp-sync` inside the `router ospf` node. This leads to a complete loss of `mpls ldp` node configuration. To eliminate this issue and all possible similar issues, let's print an explicit "exit" at the end of every node config. This commit also changes indentation for a couple of existing exit commands so that all existing commands are on the same level as their corresponding node-entering commands. Fixes #9206. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: cleanup interface node installationIgor Ryzhov2021-07-291-12/+1
| | | | | | | | | The only difference in daemons' interface node definition is the config write function. No need to define the node in every daemon, just pass the callback as an argument to a library function and define the node there. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: unify prefix copyingIgor Ryzhov2021-06-291-1/+1
| | | | | | | | | There are a few places in the code where we use PREFIX_COPY(_IPV4/IPV6) macro to copy a prefix. Let's always use prefix_copy function for this. This should fix CID 1482142 and 1504610. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* lib: remove vrf-interface config when removing the VRFIgor Ryzhov2021-06-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | If we have the following configuration: ``` vrf red smth exit-vrf ! interface red vrf red smth ``` And we delete the VRF using "no vrf red" command, we end up with: ``` interface red smth ``` Interface config is preserved but moved to the default VRF. This is not an expected behavior. We should remove the interface config when the VRF is deleted. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* northbound: KISS always batch yang config (file read), it's fasterChristian Hopps2021-06-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The backoff code assumed that yang operations always completed quickly. It checked for > 100 YANG modeled commands happening in under 1 second to enable batching. If 100 yang modeled commands always take longer than 1 second batching is never enabled. This is the exact opposite of what we want to happen since batching speeds the operations up. Here are the results for libyang2 code without and with batching. | action | 1K rts | 2K rts | 1K rts | 2K rts | 20k rts | | | nobatch | nobatch | batch | batch | batch | | Add IPv4 | .881 | 1.28 | .703 | 1.04 | 8.16 | | Add Same IPv4 | 28.7 | 113 | .590 | .860 | 6.09 | | Rem 1/2 IPv4 | .376 | .442 | .379 | .435 | 1.44 | | Add Same IPv4 | 28.7 | 113 | .576 | .841 | 6.02 | | Rem All IPv4 | 17.4 | 71.8 | .559 | .813 | 5.57 | (IPv6 numbers are basically the same as iPv4, a couple percent slower) Clearly we need this. Please note the growth (1K to 2K) w/o batching is non-linear and 100 times slower than batched. Notes on code: The use of the new `nb_cli_apply_changes_clear_pending` is to commit any pending changes (including the current one). This is done when the code would not correctly handle a single diff that included the current changes with possible following changes. For example, a "no" command followed by a new value to replace it would be merged into a change, and the code would not deal well with that. A good example of this is BGP neighbor peer-group changing. The other use is after entering a router level (e.g., "router bgp") where the follow-on command handlers expect that router object to now exists. The code eventually needs to be cleaned up to not fail in these cases, but that is for future NB cleanup. Signed-off-by: Christian Hopps <chopps@labn.net>
* lib: adapt to version 2 of libyangChristian Hopps2021-05-131-1/+1
| | | | | | | | | Compile with v2.0.0 tag of `libyang2` branch of: https://github.com/CESNET/libyang staticd init load time of 10k routes now 6s vs ly1 time of 150s Signed-off-by: Christian Hopps <chopps@labn.net>
* eigrpd: fix `distribute-list...` command for EIGRPDonald Sharp2021-05-042-2/+45
| | | | | | | The distribute-list command was being registered but never setup properly in EIGRP. Put it into place. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* eigrpd: Test for EIGRP AS number and ensure it's the sameDon Slice2021-05-031-3/+8
| | | | | | | When receiving a packet, ensure that the AS number is the same. Fixes: 8515 Signed-off-by: Don Slice <dslice@nvidia.com>
* Merge pull request #8545 from opensourcerouting/assert-our-ownMark Stapp2021-05-031-0/+2
|\ | | | | *: make our own assert() actually work
| * *: make sure `config.h` or `zebra.h` is firstDavid Lamparter2021-04-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | `config.h` has all the defines from autoconf, which may include things that switch behavior of other included headers (e.g. _GNU_SOURCE enabling prototypes for additional functions.) So, the first include in any `.c` file must be either `config.h` (with the appropriate guard) or `zebra.h` (which includes `config.h` first thing.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | eigrpd: validate TLV lengthsMark Stapp2021-04-261-2/+27
|/ | | | | | | Check that incoming TLVS a) don't overrun the incoming packet, b) don't underrun the required size for the type of TLV. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* *: remove *.conf.sample filesQuentin Young2021-04-092-14/+0
| | | | | | | | | | Most of these are many, many years out of date. All of them vary randomly in quality. They show up by default in packages where they aren't really useful now that we use integrated config. Remove them. The useful ones have been moved to the docs. Signed-off-by: Quentin Young <qlyoung@nvidia.com>
* lib, bgpd: add a specific oid_copy function for IPv6 addrsPat Ruddy2021-03-251-2/+1
| | | | | | | Do not overload the v4 oid_copy_addr function for ipv6 coverity does not like this kind of thing. Signed-off-by: Pat Ruddy <pat@voltanet.io>
* eigrpd: kill eigrp_memory.h, use MTYPE_STATICDavid Lamparter2021-03-2216-98/+26
| | | | | | | Same as previous commit -- convert most DEFINE_MTYPE into the _STATIC variant, and move the remaining non-static ones to appropriate places. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: require semicolon after FRR_DAEMON_INFO & co.David Lamparter2021-03-171-1/+2
| | | | | | ... again ... Signed-off-by: David Lamparter <equinox@diac24.net>
* *: require semicolon after DEFINE_QOBJ & co.David Lamparter2021-03-172-3/+3
| | | | | | Again, see previous commits. Signed-off-by: David Lamparter <equinox@diac24.net>
* *: require semicolon after DEFINE_MTYPE & coDavid Lamparter2021-03-172-30/+30
| | | | | | | | | | | | | | | | | Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
* eigrpd: fix dependency on operational state in cliIgor Ryzhov2021-03-161-12/+11
| | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* eigrpd: fix xpathsIgor Ryzhov2021-03-161-2/+2
| | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* *: fix printf extension typesDavid Lamparter2021-03-141-2/+2
| | | | | | Some mistakes have crept in again. Signed-off-by: David Lamparter <equinox@diac24.net>
* eigrpd: Convert to using our builtin printf stuffDonald Sharp2021-03-142-12/+4
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #7987 from donaldsharp/eigrp_mtu_correctRuss White2021-02-022-4/+16
|\ | | | | eigrpd: Correctly set the mtu for eigrp packets sent
| * eigrpd: Correctly set the mtu for eigrp packets sentDonald Sharp2021-01-312-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This version of eigrp pre-calculated the eigrp metric to be a default of 1500 bytes, but unfortunately it had entered the byte order wrong. Modify the code to properly set the byte order according to the eigrp rfc as well as actually read in and transmit the mtu of the interface instead of hard coding it to 1500 bytes. Fixes: #7986 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | eigrpd: Prevent uninitialized value from being usedDonald Sharp2021-01-301-0/+1
|/ | | | | | | | | | | | | | | | | | | | | valgrind is finding: 2141982-==2141982== Conditional jump or move depends on uninitialised value(s) 2141982:==2141982== at 0x11A7A6: eigrp_metrics_is_same (eigrp_metric.c:134) 2141982-==2141982== by 0x120360: eigrp_topology_update_distance (eigrp_topology.c:374) 2141982-==2141982== by 0x124F01: eigrp_get_fsm_event (eigrp_fsm.c:284) 2141982-==2141982== by 0x12519E: eigrp_fsm_event (eigrp_fsm.c:419) 2141982-==2141982== by 0x1206A1: eigrp_topology_neighbor_down (eigrp_topology.c:518) 2141982-==2141982== by 0x11AB3A: eigrp_nbr_delete (eigrp_neighbor.c:178) 2141982-==2141982== by 0x124494: eigrp_finish_final (eigrpd.c:271) 2141982-==2141982== by 0x1245A8: eigrp_finish (eigrpd.c:247) 2141982-==2141982== by 0x124630: eigrp_terminate (eigrpd.c:240) 2141982-==2141982== by 0x11344B: sigint (eigrp_main.c:112) 2141982-==2141982== by 0x48F5F32: quagga_sigevent_process (sigevent.c:130) Prevent this from happening. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* eigrpd: Remove #if 0 dead codeDonald Sharp2021-01-281-63/+0
| | | | | | There is some dead code in eigrpd Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* eigrpd: Cleanup eigrp_packet.h to our proper formattingDonald Sharp2021-01-121-76/+85
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* eigrpd: Introduce eigrp_metric.[ch] and eigrp_types.hDonnie Savage2021-01-1212-110/+258
| | | | | | | Add these file and introduce some new fundamental types Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Donnie Savage <diivious@hotmail.com>
* eigrpd: Rename nexthop_entry and prefix_entry to better namesDonnie Savage2021-01-1224-226/+253
| | | | | | | | | | Rename struct eigrp_nexthop_entry to struct eigrp_route_descriptor Rename struct eigrp_prefix_entry to struct eigrp_prefix_descriptor Fix all the associated function names as well. Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Donnie SAvage <diivious@hotmail.com>
* eigrpd: Create eigrp_yang.h and move stuff aroundDonnie Savage2021-01-124-3/+34
| | | | | | | | Move the prototypes for eigrp_yang that are in eigrpd.h into eigrp_yang.h. Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Donnie Savage <diivious@hotmail.com>
* eigrpd: Create eigrp_cli.h and move forward declarationsDonnie Savage2021-01-126-44/+74
| | | | | | | | Move the forward declarations for eigrp_cli.c from eigrpd.h into eigrp_cli.h. Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Donnie Savage <diivious@hotmail.com>
* eigrpd: Move `struct eigrp_master` to eigrpd.hDonnie Savage2021-01-122-23/+27
| | | | | | | | | | The `struct eigrp_master` data structure belongs in the eigrpd.h file. Move it over, in addition start forward thinking about the different TLV versions so we can track them better in the future. Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Donnie Savage <diivious@hotmail.com>
* *: Replace s_addr check agains 0 with INADDR_ANYDonatas Abraitis2020-12-141-1/+1
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* eigrpd: Remove unneeeded if state typesDonald Sharp2020-11-282-10/+2
| | | | | | There are some unused/unneeded if state types in eigrp, remove them Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* bgpd: Advertise FIB installed routes to bgp peers (Part 1)Soman K S2020-11-061-1/+2
| | | | | | | | | | | | | | | | | | Issue: The bgp routes learnt from peers which are not installed in kernel are advertised to peers. This can cause routers to send traffic to these destinations only to get dropped. The fix is to provide a configurable option "bgp suppress-fib-pending". When the option is enabled, bgp will advertise routes only if it these are successfully installed in kernel. Fix (Part1) : * Added message ZEBRA_ROUTE_NOTIFY_REQUEST used by client to request FIB install status for routes * Added AFI/SAFI to ZAPI messages * Modified the functions zapi_route_notify_decode(), zsend_route_notify_owner() and route_notify_internal() to include AFI, SAFI as parameters Signed-off-by: kssoman <somanks@gmail.com>
* *: unify thread/event cancel macrosMark Stapp2020-10-232-4/+4
| | | | | | | | | Replace all lib/thread cancel macros, use thread_cancel() everywhere. Only the THREAD_OFF macro and thread_cancel() api are supported. Also adjust thread_cancel_async() to NULL caller's pointer (if present). Signed-off-by: Mark Stapp <mjs@voltanet.io>
* * : update signature of thread_cancel apiMark Stapp2020-10-232-12/+6
| | | | | | | | Change thread_cancel to take a ** to an event, NULL-check before dereferencing, and NULL the caller's pointer. Update many callers to use the new signature. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* eigrpd: Tone down warning when command is not implemented yetDonald Sharp2020-10-221-13/+26
| | | | | | | | | Currently eigrp has a bunch of commands that are not fully implemented yet. Tone down the yang code change of making these in your face errors to zlog_warns, so the end-user can not be freaked out by the message. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #7343 from ton31337/fix/prefix2str_to_pFXDonald Sharp2020-10-225-40/+19
|\ | | | | :* Convert prefix2str to %pFX
| * :* Convert prefix2str to %pFXDonatas Abraitis2020-10-225-40/+19
| | | | | | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | eigrpd: Replace inet_ntoa with %pI4Donald Sharp2020-10-2210-132/+104
|/ | | | | | Search and destroy the inet_ntoa usage in eigrp Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Use proper semantics for turning off threadDonald Sharp2020-10-121-2/+1
| | | | | | | | | | | | | We have this pattern in the code base: if (thread) THREAD_OFF(thread); If we look at THREAD_OFF we check to see if thread is non-null too. So we have a double check. This is unnecessary. Convert to just using THREAD_OFF Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* vtysh: dynamically generate the list of daemons for commandsIgor Ryzhov2020-10-021-0/+1
| | | | | | | Some daemons were actually missing from the static definitions: nhrpd, babeld, eigrpd and bfdd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* eigrpd: make `show ip eigrp vrf all neighbor` work correctlyDonald Sharp2020-08-311-16/+37
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Make `show ip eigrp vrf all interfaces` work correctlyDonald Sharp2020-08-311-14/+36
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Fix `show ip eigrp vrf all topology` to actually workDonald Sharp2020-08-311-15/+40
| | | | | | | Fix multiple forms of this command to behave appropriately when `vrf all` is specified. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* eigrpd: Cleanup eigrp interface display to respect 16 charactersDonald Sharp2020-08-291-2/+2
| | | | | | | Interface length is 16 characters add some spaces to make everything line up right. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: introduce DEFPY_YANG & friendsRenato Westphal2020-08-031-30/+30
| | | | | | | | | | DEFPY_YANG will allow the CLI to identify which commands are YANG-modeled or not before executing them. This is going to be useful for the upcoming configuration back-off timer work that needs to commit pending configuration changes before executing a command that isn't YANG-modeled. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: un-split strings across linesDavid Lamparter2020-07-143-17/+8
| | | | | | | | | | | | | | | | | Remove mid-string line breaks, cf. workflow doc: .. [#tool_style_conflicts] For example, lines over 80 characters are allowed for text strings to make it possible to search the code for them: please see `Linux kernel style (breaking long lines and strings) <https://www.kernel.org/doc/html/v4.10/process/coding-style.html#breaking-long-lines-and-strings>`_ and `Issue #1794 <https://github.com/FRRouting/frr/issues/1794>`_. Scripted commit, idempotent to running: ``` python3 tools/stringmangle.py --unwrap `git ls-files | egrep '\.[ch]$'` ``` Signed-off-by: David Lamparter <equinox@diac24.net>
* *: add filter northbound supportRafael Zalamena2020-06-051-0/+1
| | | | | | Allow all daemons to work with filter northbound. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* build: make clippy Makefile rules nicerDavid Lamparter2020-04-271-5/+4
| | | | | | | These are easy to get subtly wrong, and doing so can cause nondeterministic failures when racing in parallel builds. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>