summaryrefslogtreecommitdiffstats
path: root/babeld (follow)
Commit message (Collapse)AuthorAgeFilesLines
* babeld: fix #11808 to avoid infinite loopsharryreps2023-03-041-3/+3
| | | | | | | Replacing continue in loops to goto done so that index of packet buffer increases. Signed-off-by: harryreps <harryreps@gmail.com>
* Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp2023-02-1731-551/+30
|\ | | | | *: convert to SPDX License identifiers
| * *: auto-convert to SPDX License IDsDavid Lamparter2023-02-0930-532/+30
| | | | | | | | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
| * *: sort out & explain licenses used in FRRDavid Lamparter2023-02-091-19/+0
| | | | | | | | | | | | | | New "introduction" note in `COPYING`, and all the licenses moved into `doc/licenses/`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | Merge pull request #12802 from sri-mohan1/sri-bableDonald Sharp2023-02-154-15/+17
|\ \ | | | | | | babeld: changes for code maintainability
| * | babeld: changes for code maintainabilitysri-mohan12023-02-144-15/+17
| | | | | | | | | | | | | | | | | | These changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* | | Merge pull request #12762 from sri-mohan1/sri-bableDonald Sharp2023-02-101-12/+14
|\| | | |/ |/| babeld: changes for code maintainability
| * babeld: changes for code maintainabilitysri-mohan12023-02-071-12/+14
| | | | | | | | | | | | these changes are for improving the code maintainability and readability Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
* | babeld: Fix filtering against all interfacesYuxiang Zhu2023-02-061-2/+5
|/ | | | | | | The first argument of `access_list_lookup` and `prefix_list_lookup` should be `AFI_` constants instead of `AF_` constants. Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
* babeld: During intf startup, ignore address already in useDonald Sharp2023-01-281-9/+9
| | | | | | | | | | | | | | When listening on a multicast group. No need to actually fail the operation when it's already being used. Let's not treat the Address already in use error message as one that is stopping everything from working. Especially since multiple interface events cause this to happen. Without this, if config is read in before full connection to zebra, babel will never establish neighbors. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* babeld: The function is already a pointerDonald Sharp2023-01-281-1/+1
| | | | | | Don't send the address of in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #12640 from vfreex/babel-no-commandsRuss White2023-01-244-154/+98
|\ | | | | babeld: Add missing `no` commands
| * babeld: Add missing `no` commandsYuxiang Zhu2023-01-204-154/+98
| | | | | | | | | | | | | | | | | | Some babeld commands doesn't have the corresponding negative commands defined, so those commands doesn't work with frr-reload.py. This PR adds those missing commands. Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
* | babeld: Fix --terminal optionYuxiang Zhu2023-01-201-29/+0
|/ | | | | | | | babeld's `--terminal` option doesn't work because it replaces `stdin` with `/dev/null`. It seems to me this function can be removed as `frr_run` handles that in daemon mode. Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
* build, vtysh: extract vtysh commands from .xrefDavid Lamparter2022-10-261-5/+0
| | | | | | | | | | | | | | | | | | | Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: Create and use infrastructure to show debugs in libDonald Sharp2022-10-071-0/+2
| | | | | | | | | There are lib debugs being set but never show up in `show debug` commands because there was no way to show that they were being used. Add a bit of infrastructure to allow this and then use it for `debug route-map` Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* babeld: Remove return value for gettime()Donald Sharp2022-08-242-3/+3
| | | | Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* babeld: Install route to RIB if parse_update_subtlv() is falseDonatas Abraitis2022-07-111-1/+1
| | | | | | We installed the route only if the type was SUBTLV_MANDATORY. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* babeld: Ignore sub-tlv's with mandatory bit setDonald Sharp2022-06-092-52/+82
| | | | | | | | | | | | RFC 8966 4.4 If the mandatory bit is set, then the whole enclosing TLV MUST be silently ignored (except for updating the parser state by a Router-Id, Next Hop, or Update TLV, as described in the next section). Fixes: #11349 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* babeld: Update to ignore unicast hellosDonald Sharp2022-06-091-21/+63
| | | | | | | | | | | | | RFC 8966 requires a bit of work to make FRR forward compabitble with it for the moment. tl;dr -> Flags of hellos should be 0 except the main bit and The Unicast Hello bit if set should cause the packet to be ignored. Additionally FRR needs to ignore Hello packets with the interval field set to 0. Fixes: #11349 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* babeld: Check that bodylen is within some bounds of usableDonald Sharp2022-05-121-4/+4
| | | | | | | | | | | Coverity believed that the bodylen value was read directly from the incoming packet and then used as a loop variable. Unfortunately it missed the fact that in babel_packet_examin the bodylen was actually checked to ensure that it was long enough. So instead of checking it 2 times, generate it one time and let coverity figure it out from that. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: use FRR interface name definition everywhereRafael Zalamena2022-05-021-1/+2
| | | | | | | Don't rely on the OS interface name length definition and use the FRR definition instead. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* babeld: Rehook up interface up eventsDonald Sharp2022-03-271-17/+1
| | | | | | | | | When babeld was switched over to the zapi interface up/down callbacks the interface up event was not properly put back in. Fixes: #10893 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* *: Change thread->func to return void instead of intDonald Sharp2022-02-241-14/+8
| | | | | | | The int return value is never used. Modify the code base to just return a void instead. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #10504 from qingkaishi/masterDonald Sharp2022-02-081-10/+10
|\ | | | | babeld: fix the checks for truncated packets
| * babeld: fix #10502 #10503 by repairing the checks on lengthqingkaishi2022-02-041-10/+10
| | | | | | | | | | | | | | This patch repairs the checking conditions on length in four functions: babel_packet_examin, parse_hello_subtlv, parse_ihu_subtlv, and parse_update_subtlv Signed-off-by: qingkaishi <qingkaishi@gmail.com>
* | babeld: fix #10487 by adding a check on packet lengthwhichbug2022-02-041-7/+6
|/ | | | | | | The body length of a packet should satisfy the condition: packetlen >= bodylen + 4. Otherwise, heap overflows may happen. Signed-off-by: whichbug <whichbug@github.com>
* *: do not print vrf name for interface config when using vrf-liteIgor Ryzhov2022-01-241-2/+2
| | | | | | | VRF name should not be printed in the config since 574445ec. The update was done for NB config output but I missed it for regular vty output. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* babeld: C-style commentsAdriano Marto Reis2021-12-221-6/+4
| | | | | | Replacing C++-style comments with C-style comments. Signed-off-by: "Adriano Marto Reis" <adrianomarto@gmail.com>
* babeld: Presenting interface configuration parametersAdriano Marto Reis2021-12-222-7/+39
| | | | | | | | | | | * Presenting the configuration parameters enable-timestamps, max-rtt-penalty, rtt-min, and rtt-max. * Using #defines for the default configuration values instead of magic numbers. * rtt-max and rtt-min are entered and presented in milliseconds, but stored and internally used in microseconds. Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
* Merge pull request #10032 from opensourcerouting/build-fix-20211111Donald Sharp2021-11-131-4/+3
|\ | | | | build: assorted build system improvements, 2021-11 edition
| * build: remove some useless intermediate librariesDavid Lamparter2021-11-111-4/+3
| | | | | | | | | | | | | | These really serve no purpose other than slowing our build down. If there's a benefit to any of these, they can be readded. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | *: Convert quagga_signal_X to frr_signal_XDonald Sharp2021-11-111-1/+1
| | | | | | | | | | | | | | Naming functions/data structures more appropriately for the project we are actually in. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | lib: Add autocomplete for access-listsDonatas Abraitis2021-10-311-4/+4
|/ | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* *: convert zclient callbacks to tableDavid Lamparter2021-10-201-5/+9
| | | | | | | | | | | | | This removes a giant `switch { }` block from lib/zclient.c and harmonizes all zclient callback function types to be the same (some had a subset of the args, some had a void return, now they all have ZAPI_CALLBACK_ARGS and int return.) Apart from getting rid of the giant switch, this is a minor security benefit since the function pointers are now in a `const` array, so they can't be overwritten by e.g. heap overflows for code execution anymore. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* babeld: Prevent compiler warning about uninited value for nDonald Sharp2021-10-131-1/+1
| | | | | | | | | the variable n, when used must have been set via the find_route_slot but the compiler in question is probably getting confused with the multiple levels of indention. Just get around the whole problem by setting n = 0 and being done with it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #9496 from idryzhov/vrf-cmd-init-unused-argDavid Lamparter2021-08-271-1/+1
|\ | | | | lib: remove unused argument from vrf_cmd_init
| * lib: remove unused argument from vrf_cmd_initIgor Ryzhov2021-08-261-1/+1
| | | | | | | | Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* | Merge pull request #9331 from idryzhov/explicit-exitChristian Hopps2021-08-262-1/+3
|\ \ | |/ |/| *: explicitly print "exit" at the end of every node config
| * *: explicitly print "exit" at the end of every node configIgor Ryzhov2021-08-232-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | *: Drop `break` after using frr_help_exit() in switch/caseDonatas Abraitis2021-08-251-2/+1
|/ | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* *: cleanup interface node installationIgor Ryzhov2021-07-291-11/+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>
* *: Replace 4/16 integers to IPV4_MAX_BYTELEN/IPV6_MAX_BYTELENDonatas Abraitis2021-07-012-46/+54
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* *: Convert numeric 32 into IPV4_MAX_BITLEN for prefixlenDonatas Abraitis2021-07-011-5/+5
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* babeld: Drop in_prefix() functionDonatas Abraitis2021-07-012-23/+0
| | | | | | Not used. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.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>
* babeld: Allow babeld to actually register to use distribute-listDonald Sharp2021-05-041-3/+91
| | | | | | | The `distribute-list` commands were registered but never setup properly to work. Put the commands in place. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* build: make builddir include path consistentDavid Lamparter2021-04-211-1/+1
| | | | | | | ... by referencing all autogenerated headers relative to the root directory. (90% of the changes here is `version.h`.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: remove *.conf.sample filesQuentin Young2021-04-093-32/+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>
* *: require semicolon after FRR_DAEMON_INFO & co.David Lamparter2021-03-171-1/+1
| | | | | | ... again ... Signed-off-by: David Lamparter <equinox@diac24.net>