summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2021-12-14lib: default VRF may not exist on early exitDavid Lamparter
If we're exiting before we finished initializing, we can end up trying to shut down a NULL vrf here. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-12-14lib: shuffle around command line optionsDavid Lamparter
New `FRR_NO_SPLIT_CONFIG` flag for newly added daemons where we're just rolling without split config and always expect configs to be loaded via vtysh/integrated config. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-12-14bgpd: fix BGP ORF Prefix-length matchingMartin Winter
BGP ORF Prefix list incorrectly rejected list with a GE or LE to match the actual prefix. Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2021-12-14Merge pull request #9899 from Drumato/zebra-srv6-locator-detail-json-supportDonatas Abraitis
zebra: Add support for json output in srv6 locator detail command
2021-12-03lib: routemap config output cleanupIgor Ryzhov
Just a small cleanup to unify the code and remove duplication. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-12-02Merge pull request #10110 from idryzhov/if-yang-remove-vrfRuss White
lib, yang: remove vrf from the interface list key
2021-12-01Merge pull request #9878 from pguibert6WIND/resolver_vrfDonatas Abraitis
lib: resolver per vrf support
2021-11-30Merge pull request #9798 from abuibrahim/masterQuentin Young
fix broken northbound confd
2021-11-28zebra: Add support for json output in srv6 locator detail commandYamato Sugawara
Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
2021-11-29Merge pull request #10124 from ton31337/feature/vty_jsonIgor Ryzhov
2021-11-25lib: Convert vty_out to vty_json for JSONDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25*: Remove unused variablesDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-25lib: Replace prefix2str for JSON to %pFXDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-24bgpd: Add an ability to match ipv6 next-hop by prefix-listDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-23lib: Use autocomplete for `route-map <name> <action> <seq>`Donatas Abraitis
``` exit1-debian-11(config)# route-map ? RMAP_NAME Route map tag belekas testas ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-23Merge pull request #10024 from ton31337/feature/match_ipv6_next-hop_access-listIgor Ryzhov
bgpd: match ipv6 next-hop
2021-11-23bgpd: Add an ability to match ipv6 next-hop by access-listDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-23lib, yang: remove vrf from the interface list keyIgor Ryzhov
This is needed for the following two reasons: 1. To be able to remove the northbound HACK in if_update_to_new_vrf. It is totally wrong to rewrite the configuration datastore when some operational state changes. It is a hard blocker for storing a configuration data in a management daemon which knows nothing about the operational state. 2. To allow changing the VRF of the interface using FRR CLI or any other frontend in the future. If the VRF is a part of the key, it can't be changed. If the VRF is a simple leaf, it becomes possible to change it and thus move the interface between VRFs. For now I mark the leaf as a "config false" as it's not yet possible to control it from FRR. But we can't simply remove the VRF from the key, because it is needed to distinguish interfaces when using netns based VRFs, as it is possible to have multiple interfaces with the same name in different namespaces. To handle this, I came up with an idea to store both VRF and an interface name in the "name" leaf using the pattern "vrfname:ifname". For example, if there's an interface "eth0" in VRF "red" then its "name" leaf will be "red:eth0". Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-23lib: resolver per vrf supportPhilippe Guibert
add a parameter to resolver api that is the vrf identifier. this permits to make resolution self to each vrf. in case vrf netns backend is used, this is very practical, since resolution can happen on one netns, while it is not the case in an other one. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-11-22*: cleanup ifp->vrf_idIgor Ryzhov
Since f60a1188 we store a pointer to the VRF in the interface structure. There's no need anymore to store a separate vrf_id field. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-22Merge pull request #10076 from idryzhov/if-is-loopback-or-vrfDonald Sharp
*: unify if_is_loopback/if_is_loopback_or_vrf
2021-11-22Merge pull request #10096 from mjstapp/fix_ted_freeDonatas Abraitis
lib: use _safe iteration during link_state/ted cleanup
2021-11-19bgpd, lib: fix inconsistency of match ip/ipv6 next-hop commandsIgor Ryzhov
For IPv4 matching, we have "match ip next-hop address A.B.C.D". For IPv6 matching, we have "match ipv6 next-hop X:X::X:X". To have consistency, let's add "address" keyword to IPv6 commands. Old commands are preserved as hidden for backward compatibility. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-19Merge pull request #10074 from opensourcerouting/assorted-20211116Igor Ryzhov
lib/vtysh/ospf6d: assorted small bits
2021-11-18Merge pull request #10092 from ↵Igor Ryzhov
ton31337/feature/replace_json_object_string_add_to_json_object_string_addf_for_inet_ntop *: inet_ntop for JSON output
2021-11-18*: Remove unused variablesDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18lib: use _safe iteration during link_state/ted cleanupMark Stapp
Use the _safe iterators when cleaning up the link-state module's vertices, edges, and subnets. Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2021-11-18lib: Do not use sizeof() on `size_t errmsg_len`.zyxwvu Shi
This prevents caller from getting complete validation message. Signed-off-by: zyxwvu Shi <i@shiyc.cn>
2021-11-18lib: Replace inet_ntop to %pI4/6 for JSON outputsDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-11-18Merge pull request #10084 from opensourcerouting/json-sugarDonatas Abraitis
lib: make JSON output less painful/boilerplate-y
2021-11-17lib: use json-printf in filter codeDavid Lamparter
(This is mostly just to exercise the code, the actual replacement needs to be a cocci script.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-17lib: use vty_json()David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-17lib: add printfrr to json string helpersDavid Lamparter
... these should probably have been added ages ago. `json_object_string_addf(json, "key", "%pFX", prefix)` is super useful. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-17lib: add vty_json() helperDavid Lamparter
... this is copypasted all over the codebase & should've been a helper to begin with really. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-17Merge pull request #9852 from opensourcerouting/pim-nht-reworkDonald Sharp
pimd: make PIM NHT less weird
2021-11-17Merge pull request #10075 from myloft/fix-chdir-judgeDavid Lamparter
2021-11-17lib: fix style misalignmentDavid Lamparter
Just a line that sticks out like a sore thumb. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-17*: clean up ifp-by-local-address function(s)David Lamparter
Most users of if_lookup_address_exact only cared about whether the address is any local address. Split that off into a separate function. For the users that actually need the ifp - which I'm about to add a few of - change it to prefer returning interfaces that are UP. (Function name changed due to slight change in behavior re. UP state, to avoid possible bugs from this change.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-16vtysh: dispatch unique-id backtrace cmd properlyDavid Lamparter
i.e. to whoever cares, since some unique IDs (from libfrr) are valid everywhere but some others (from the daemons) only apply to specific daemons. (Default handling aborts on first error, so configuring any unique IDs that don't exist on the first daemon vtysh connects to just failed before this.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-16lib: rework vty_check_node_for_xpath_decrementDavid Lamparter
...by having a flag in struct cmd_node rather than hardcoding it in `lib/command.c`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-16lib: use hash for route-map set/match commandsDavid Lamparter
Why would this be in a vector to loop over with strcmp()'ing each item... that just makes no sense. Use a hash instead. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-11-16*: unify if_is_loopback/if_is_loopback_or_vrfIgor Ryzhov
We should always treat the VRF interface as a loopback. Currently, this is not the case, because in some old pre-VRF code we use if_is_loopback instead of if_is_loopback_or_vrf. To avoid any future problems, the proposal is to rename if_is_loopback_or_vrf to if_is_loopback and use it everywhere. if_is_loopback is renamed to if_is_loopback_exact in case it's ever needed, but currently it's not used anywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-16zebra: fix chdir judgment to avoid starting failed in a non-existent directorySolyn
Signed-off-by: Solyn <admin@iloft.xyz>
2021-11-15lib: rename bfd function to reflect real functionalityIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-11-14Merge pull request #9956 from idryzhov/bfd-remove-ttlRuss White
lib: remove confusing bfd TTL API
2021-11-13Merge pull request #10032 from opensourcerouting/build-fix-20211111Donald Sharp
build: assorted build system improvements, 2021-11 edition
2021-11-12Merge pull request #10036 from donaldsharp/finally_frrJafar Al-Gharaibeh
Finally frr
2021-11-11lib: confd: fix format-truncation warningsRuslan Babayev
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2021-11-11lib: confd: fix non-void return-type warningRuslan Babayev
Signed-off-by: Ruslan Babayev <ruslan@babayev.com>
2021-11-11lib: confd: fix compilation broken with libyang2Ruslan Babayev
Fixes the following compilation errors: In file included from /home/ruslan/sdk/sysroots/corei7-64-poky-linux/usr/include/libyang/tree_data.h:30, from /home/ruslan/sdk/sysroots/corei7-64-poky-linux/usr/include/libyang/context.h:22, from /home/ruslan/sdk/sysroots/corei7-64-poky-linux/usr/include/libyang/libyang.h:24, from ../../src/frr/lib/yang.h:25, from ../../src/frr/lib/northbound.h:27, from ../../src/frr/lib/vty.h:36, from ../../src/frr/lib/ferr.h:28, from ../../src/frr/lib/lib_errors.h:24, from ../../src/frr/lib/northbound_confd.c:23: ../../src/frr/lib/northbound_confd.c: In function 'frr_confd_init_cdb': ../../src/frr/lib/northbound_confd.c:533:28: error: 'const struct lys_module' has no member named 'data' 533 | LY_LIST_FOR (module->info->data, snode) { | ^~ ../../src/frr/lib/northbound_confd.c: In function 'frr_confd_data_get_next_object': ../../src/frr/lib/northbound_confd.c:921:3: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 921 | LY_LIST_FOR (lysc_node_child(nb_node->snode), child) { | ^~~~~~~~~~~ Signed-off-by: Ruslan Babayev <ruslan@babayev.com>