Donald Sharp [Fri, 6 Nov 2020 01:42:03 +0000 (20:42 -0500)]
bgpd: Actually return the group peer
The code is returning the group peer data structure, which
is what is happening but we should not have assignment statements
in this return statement for a `struct peer *` return.
Donald Sharp [Fri, 30 Oct 2020 17:34:30 +0000 (13:34 -0400)]
bgpd: Remove pointer structure from `struct bgp_dest`
The `struct listnode *rt_node` data structure is adding
8 bytes of size to the `struct bgp_dest`. This is a large
amount of data for a flag we are already setting on each
node for this. Just set the flag and use that to figure
out who we are doing graceful restart on.
Renato Westphal [Sat, 24 Oct 2020 00:05:30 +0000 (21:05 -0300)]
isisd: detect Prefix-SID collisions and handle them appropriately
isisd relies on its YANG module to prevent the same SID index
from being configured multiple times for different prefixes. It's
possible, however, to have different routers assigning the same SID
index for different prefixes. When that happens, we say we have a
Prefix-SID collision, which is ultimately a misconfiguration issue.
The problem with Prefix-SID collisions is that the Prefix-SID that
is processed later overwrites the previous ones. Then, once the
Prefix-SID collision is fixed in the configuration, the overwritten
Prefix-SID isn't reinstalled since it's already marked as installed
and it didn't change. To prevent such inconsistency from happening,
add a safeguard in the SPF code to detect Prefix-SID collisions and
handle them appropriately (i.e. log a warning + ignore the Prefix-SID
Sub-TLV since it's already in use by another prefix). That way,
once the configuration is fixed, no Prefix-SID label entry will be
missing in the LFIB.
Reported-by: Emanuele Di Pascale <emanuele@voltanet.io> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Donald Sharp [Wed, 4 Nov 2020 16:48:49 +0000 (11:48 -0500)]
zebra: Rework code to make SA happy
Clan SA was saying:
./zebra/zebra_vty_clippy.c: In function ‘show_route’:
zebra/zebra_vty.c:1775:4: warning: ‘zvrf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
do_show_ip_route_all(vty, zvrf, afi, !!fib, !!json, tag,
^
I do not see a way that zvrf could ever be uninited in the code path
but rearrange the code a tiny bit to make it happier.
Donald Sharp [Tue, 3 Nov 2020 20:24:03 +0000 (15:24 -0500)]
bgpd: Allow 1 prefix to generate statistics
When generating a config with 1 prefix:
BGP IPv4 Unicast RIB statistics
Total Advertisements : 0
Total Prefixes : 0
Average prefix length : 0.00
Unaggregateable prefixes : 0
Maximum aggregateable prefixes: 0
BGP Aggregate advertisements : 0
Address space advertised : 0
% announced : 0.00
/8 equivalent : 0.00
/24 equivalent : 0.00
Advertisements with paths : 0
Longest AS-Path (hops) : 0
Average AS-Path length (hops) : 0.00
Largest AS-Path (bytes) : 0
Average AS-Path size (bytes) : 0.00
Highest public ASN : 0
eva# show bgp ipv4 uni summ
BGP router identifier 10.10.3.11, local AS number 329 vrf-id 0
BGP table version 1
RIB entries 1, using 192 bytes of memory
Peers 1, using 23 KiB of memory
We are not displaying it in the statistics data. This is because FRR is walking the associated
table and comparing the current dest to the top of the tree. I have no idea why this is
the case as that when you have 1 prefix you only have 1 node in your tree. Looking at the
code this is the original code that was imported in 2006. I cannot think of any reason why
FRR needs to exclude this particular node.
Fixed:
eva# show bgp ipv4 uni summ
BGP router identifier 10.10.3.11, local AS number 329 vrf-id 0
BGP table version 1
RIB entries 1, using 192 bytes of memory
Peers 1, using 23 KiB of memory
Donald Sharp [Mon, 2 Nov 2020 15:14:48 +0000 (10:14 -0500)]
bgpd: Multipath is always being allocated
The multipath arrays are always being allocated, irrelevant
if we actually have multipath information for a prefix.
This is because the link bandwidth code was always adding the
data structure. We should not be allocated multipath information
unless we actually have multipath information
ospfd: OSPF external LSA summarisation show commands
Description:
The below show command introduced to diplay all configured
summary addresss information along with matching corresponding
external route information.
show ip ospf [vrf <NAME|all>] summary-address [detail] [json]
rgirada [Sat, 15 Aug 2020 08:27:40 +0000 (01:27 -0700)]
ospfd: Summarisation init/de-init.
Description:
Summarisation initilisation and de-init apis.
summary route table will be created as part of initilisation
at the time of ospf deamon init.
Description:
Added json support to ospf lsdb command and its subcommands.
Added json to the following sub commands.
show ip ospf database json
show ip ospf database router json
show ip ospf database network json
show ip ospf database external json
show ip ospf database summary json
show ip ospf database asbr-summary json
show ip ospf database nssa-external json
show ip ospf databas max-age json
show ip ospf database self-originate json
Stephen Worley [Fri, 30 Oct 2020 20:14:40 +0000 (16:14 -0400)]
bgpd: fix help for ipv6 under distance src command
We were missing the help docstring for IPV6 under the
distance src command in for bgp.
```
[root@alfred frr-2]# /usr/lib/frr/bgpd --log stdout --log-level debug
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
```
Signed-off-by: Stephen Worley <sworley@nvidia.com>
Mark Stapp [Fri, 30 Oct 2020 14:51:54 +0000 (10:51 -0400)]
zebra: add optional extra data about routes' interfaces
Add extra data about the interfaces used in route updates'
nexthops - some consumers of route updates may want additional
data, but dataplane plugins running in the dplane pthread
cannot safely access the normal zebra data structures. Capturing
this info is optional - a plugin must request it (via an api).
Donald Sharp [Thu, 15 Oct 2020 17:41:30 +0000 (13:41 -0400)]
zebra: Consolidate on 32 bits as the flag size for route flags
When we get a route for installation via any method we should
consolidate on 32 bits as the flag size, since we have
actually more than 8 bits of data to bass around.
isisd: fix segfault in the circuit p2p/bcast union
The fields in the broadcast/p2p union struct in an isis circuit are
initialized when the circuit goes up, but currently this step is
skipped if the interface is passive. This can create problems if the
circuit type (referred to as network type in the config) changes from
broadcast to point-to-point. We can end up with the p2p neighbor
pointer pointing at some garbage left by the broadcast struct in the
union, which would then cause a segfault the first time we would
dereference it - for example when building the lsp, or computing the
SPF tree.
compressed backtrace of a possible crash:
#0 0x0000555555579a9c in lsp_build at frr/isisd/isis_lsp.c:1114
#1 0x000055555557a516 in lsp_regenerate at frr/isisd/isis_lsp.c:1301
#2 0x000055555557aa25 in lsp_refresh at frr/isisd/isis_lsp.c:1381
#3 0x00007ffff7b2622c in thread_call at frr/lib/thread.c:1549
#4 0x00007ffff7ad6df4 in frr_run at frr/lib/libfrr.c:1098
#5 0x000055555556b67f in main at frr/isisd/isis_main.c:272
isis_lsp.c:
1112 case CIRCUIT_T_P2P: {
1113 struct isis_adjacency *nei = circuit->u.p2p.neighbor;
1114 if (nei && nei->adj_state == ISIS_ADJ_UP
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Mark Stapp [Mon, 21 Sep 2020 19:57:59 +0000 (15:57 -0400)]
lib: avoid signal-handling race with event loop poll call
Manage the main pthread's signal mask to avoid a signal-handling
race. Before entering poll, check for pending signals that the
application needs to handle. Use ppoll() to re-enable those
signals during the poll call.