summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2022-01-27vrrpd: use ipaddr_is_zero when neededIgor Ryzhov
Replace custom implementation or call to ipaddr_isset with a call to ipaddr_is_zero. ipaddr_isset is not fully correct, because it's fine to have some non-zero bytes at the end of the struct in case of IPv4 and the function doesn't allow that. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-25Merge pull request #10411 from idryzhov/if-config-vrf-nameRuss White
*: do not print vrf name for interface config when using vrf-lite
2022-01-24Merge pull request #10381 from idryzhov/drop-gw-addrRuss White
BGP EVPN overlay index fixes and improvements
2022-01-24*: do not print vrf name for interface config when using vrf-liteIgor Ryzhov
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>
2022-01-20lib, zebra: Add ability to tell thread system to ignore late timersDonald Sharp
Add a thread_ignore_late_timer(struct thread *thread) function that allows thread.c to ignore when timers are late to the party. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-20lib: Figure out if we are being starved for cpuDonald Sharp
If a thread timer should have popped CPU_CONSUMED_CHECK seconds in the past, and we are only handling it now. Consider the thread starved and notice it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-19bgpd: replace custom union gw_addr with struct ipaddrIgor Ryzhov
BGP EVPN custom `union gw_addr` is basically the same thing as a common `struct ipaddr` but it lacks the address family which is needed in some cases. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-19Merge pull request #10360 from opensourcerouting/clippy-rel-endianMark Stapp
lib/clippy: don't endian-convert twice
2022-01-18Merge pull request #10355 from opensourcerouting/noisy-startupRuss White
lib, zebra: make startup less noisy
2022-01-18Merge pull request #9938 from Orange-OpenSource/isis_lsRuss White
isisd: Add Link State Traffic Engineering support
2022-01-18Merge pull request #9644 from opensourcerouting/ospf-opaque-attrsRuss White
OSPF opaque route attributes
2022-01-18lib/clippy: don't endian-convert twiceDavid Lamparter
elf_getdata_rawchunk() already endian-converts; doing it again is, uh, counterproductive. Fixes: #10051 Reported-by: Lucian Cristian <lucian.cristian@gmail.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-17Merge pull request #10183 from idryzhov/rework-vrf-renameRafael Zalamena
*: rework renaming the default VRF
2022-01-17lib: avoid pointless search for built-in IETF YANGDavid Lamparter
This causes confusing/annoying log messages at startup otherwise: `YANG model "ietf-inet-types@*" "*@*"not embedded, trying external file` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-15lib, ospfd, ospf6d, zebra: add OSPF opaque route attributesRenato Westphal
Update ospfd and ospf6d to send opaque route attributes to zebra. Those attributes are stored in the RIB and can be viewed using the "show ip[v6] route" commands (other than that, they are completely ignored by zebra). Example: ``` debian# show ip route 192.168.1.0/24 Routing entry for 192.168.1.0/24 Known via "ospf", distance 110, metric 20, best Last update 01:57:08 ago * 10.0.1.2, via eth-rt2, weight 1 OSPF path type : External-2 OSPF tag : 0 debian# debian# show ip route 192.168.1.0/24 json { "192.168.1.0\/24":[ { "prefix":"192.168.1.0\/24", "prefixLen":24, "protocol":"ospf", "vrfId":0, "vrfName":"default", "selected":true, [snip] "ospfPathType":"External-2", "ospfTag":"0" } ] } ``` Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2022-01-14*: use semicolon after printfrr_ext_autoreg_{p,d}David Lamparter
Mostly to make clang-format not format these to peak ugly. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14lib: add `%pTH` / `%pTHD` for printing thread infoDavid Lamparter
Refer to docs in doc/developer for details. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14lib: add time formatting printfrr extsDavid Lamparter
Refer to docs in doc/developer for details. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-14lib: add `s` option to `pI4`/`pI6`/`pIA` printfrrDavid Lamparter
Adding an `s` after these printfrr specifiers replaces 0.0.0.0 / :: in the output with a star (`*`). This is primarily intended for use with multicast, e.g. to print `(*,G)`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-13Merge pull request #10327 from ton31337/fix/reduce_nested_loopsIgor Ryzhov
*: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nesting
2022-01-13Merge pull request #10324 from anlancs/fix-ospf-streamDonald Sharp
lib: fix the right value is returned for fail cases
2022-01-13*: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nestingDonatas Abraitis
Used for graceful-restart mostly. Especially for bgp_show_neighbor_graceful_restart_capability_per_afi_safi() Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-12Merge pull request #10282 from opensourcerouting/pim6-addr-replaceDonald Sharp
pimd: `prefix_sg` => `pim_sgaddr`
2022-01-12pimd: move `%pSG4` to `%pPSG4`David Lamparter
Since this is only used in very few places, moving it out of the way is reasonable. (`%pSG` will be pim_sgaddr) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-01-12lib: fix the right value is returned for fail casesanlan_cs
Currently `bfd_get_peer_info` should return invalid sp->family and dp->family during fail cases. Before this fix, in those fail cases `bfd_get_peer_info` maybe return valid sp->family and dp->family. This fix ensures all fail cases return invalid sp->family and dp->family for outside callers. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2022-01-10lib: rename one bfd parameter name to reflect real meaninganlan_cs
As to "struct bfd_session_arg", just rename parameter "ttl" to "hops", in order to reflect real meaning. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2022-01-08lib: small debug adjustment for bfdanlan_cs
Just use `__func__` to display function name. Signed-off-by: anlan_cs <anlan_cs@tom.com>
2021-12-21*: rework renaming the default VRFIgor Ryzhov
Currently, it is possible to rename the default VRF either by passing `-o` option to zebra or by creating a file in `/var/run/netns` and binding it to `/proc/self/ns/net`. In both cases, only zebra knows about the rename and other daemons learn about it only after they connect to zebra. This is a problem, because daemons may read their config before they connect to zebra. To handle this rename after the config is read, we have some special code in every single daemon, which is not very bad but not desirable in my opinion. But things are getting worse when we need to handle this in northbound layer as we have to manually rewrite the config nodes. This approach is already hacky, but still works as every daemon handles its own NB structures. But it is completely incompatible with the central management daemon architecture we are aiming for, as mgmtd doesn't even have a connection with zebra to learn from it. And it shouldn't have it, because operational state changes should never affect configuration. To solve the problem and simplify the code, I propose to expand the `-o` option to all daemons. By using the startup option, we let daemons know about the rename before they read their configs so we don't need any special code to deal with it. There's an easy way to pass the option to all daemons by using `frr_global_options` variable. Unfortunately, the second way of renaming by creating a file in `/var/run/netns` is incompatible with the new mgmtd architecture. Theoretically, we could force daemons to read their configs only after they connect to zebra, but it means adding even more code to handle a very specific use-case. And anyway this won't work for mgmtd as it doesn't have a connection with zebra. So I had to remove this option. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
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-30lib: Update Link State functions to handle IPv6Olivier Dugeon
In order to add Link State Traffic Engineering to IS-IS, Link State library should have been updated: - Correct Node and Edge RB Tree comparison functions to support key > 32 bits - Change Subnet RB Tree comparison function to take into account host part of the prefix i.e. 10.0.0.1/24 and 10.0.0.2/24 are considered as different - Add new function to convert IS-IS ISO system ID into Vertex or Edge key that take into account Endianness architecture - Correct Vertex and Edge creation and search function accordingly - Add extra Adjacency entries in Link State Attributes for IPv6 Segment Routing - Update send/received and show TED functions accordingly Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
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: do not include bgpd headers in route_opaque.hRenato Westphal
Duplicate a couple of definitions in order to remove the bgpd includes from this libfrr header. This is necessary to fix some name collisions like PREFIX_LIST_IN being defined differently on multiple daemons (as soon as other daemons start including route_opaque.h). Including daemon headers on libfrr headers is a bad practice and should be avoided whenever possible. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
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>