Ospf segfault when Router Information is enabled in a non default VRF,
see issue #13144.
This patch forces vrf_id to default VRF for Opaque LSA and extension based
on Opaque LSA: Router Information, Traffic Engineering, Extended Prefix,
Extended Link and Segment Routing. Indeed, non default VRF is not yet
supported for Opaque LSA & co.
Christian Hopps [Mon, 17 Apr 2023 05:36:46 +0000 (01:36 -0400)]
tests: use a more specific xpath for finding the route JSON data
Rather than requesting the data for the entire model, just request the route
data for the specific prefix. This also tests the xpath code (which was
previously broken).
Christian Hopps [Mon, 17 Apr 2023 05:34:46 +0000 (01:34 -0400)]
tests: quick fix for --gdb-daemons=DAEMONLIST not working
When launching the daemons under gdb it takes a bit for them to come up, the
currently code only looks for pid files to determine if the daemon is running.
This test is no good as these files are left around by previous runs.
For now do a simple sleep when debugging with gdb to get things working.
Christian Hopps [Mon, 17 Apr 2023 05:16:32 +0000 (01:16 -0400)]
lib: fix broken "show yang operational-data" functionality
Previously was using an API that returned the root of the data tree given the
users input xpath value, and then used it like it was the leaf node (last not
first). So basically this CLI command only worked when one requested the root
node of the model.
Christian Hopps [Mon, 17 Apr 2023 05:09:05 +0000 (01:09 -0400)]
lib: add and use new yang function for finding schema nodes
Add a wrapper around lys_find_xpath which has an unfortunate API
returning an allocated set of schema nodes when we only ever expect and
want one.
Another libyang function `lys_find_path` returns a single node; however,
that function can assert/abort on invalid path values so is unsuitable
for user input.
Replace previous uses of `lys_find_path` with new API when dealing with
possible invalid path values (i.e., from a user).
bgpd:add correct value into dfAlgorithm json output
FRR "show bgp l2 evpn es <esi-id> json" output shows 'dfAlgorithm'
same as 'dfPreference' value instead of algorithm.
Modified the code to set the correct DF algorithm value into
'dfAlgorithm' field.
torm-11# show bgp l2 evpn es
ES Flags: B - bypass, L local, R remote, I inconsistent
VTEP Flags: E ESR/Type-4, A active nexthop
ESI Flags RD #VNIs
VTEPs
03:44:38:39:ff:ff:01:00:00:01 LR 27.0.0.15:15 10
27.0.0.16(EA),27.0.0.17(EA)
03:44:38:39:ff:ff:01:00:00:02 LR 27.0.0.15:16 10
27.0.0.16(EA),27.0.0.17(EA)
03:44:38:39:ff:ff:01:00:00:03 LR 27.0.0.15:17 10
27.0.0.16(EA),27.0.0.17(EA)
03:44:38:39:ff:ff:02:00:00:01 R - 10
27.0.0.18(A),27.0.0.19(A),27.0.0.20(A)
03:44:38:39:ff:ff:02:00:00:02 R - 10
27.0.0.18(A),27.0.0.19(A),27.0.0.20(A)
03:44:38:39:ff:ff:02:00:00:03 R - 10
27.0.0.18(A),27.0.0.19(A),27.0.0.20(A)
torm-11#
Before Fix:-
```
torm-11# show bgp l2 evpn es 03:44:38:39:ff:ff:01:00:00:01 json
{
"esi":"03:44:38:39:ff:ff:01:00:00:01",
"rd":"27.0.0.15:15",
"type":[
"local",
"remote"
],
"vteps":[
{
"vtep_ip":"27.0.0.16",
"flags":[
"esr",
"active"
],
"dfPreference":32767,
"dfAlgorithm":32767 =====> dfAlgorithm is same as dfPreference
},
{
"vtep_ip":"27.0.0.17",
"flags":[
"esr",
"active"
],
"dfPreference":32767,
"dfAlgorithm":32767 =====> dfAlgorithm is same as dfPreference
}
],
"flags":[
"up",
"advertiseEVI"
],
"originator_ip":"27.0.0.15",
"remoteVniCount":10,
"vrfCount":3,
"macipPathCount":33,
"macipGlobalPathCount":264,
"inconsistentVniVtepCount":0,
"localEsDfPreference":50000,
"fragments":[
{
"rd":"27.0.0.15:15",
"eviCount":10
}
]
}
torm-11#
```
Christian Hopps [Sat, 15 Apr 2023 13:37:30 +0000 (09:37 -0400)]
tests: restart bgpd to avoid warnings in follow on tests
The tests are killing bgpd and then ending, the next test is checking for all
daemons running and spewing warnings to stderr. Restart the daemons before
ending the test (like other tests in this same module) to avoid this.
tools: fix missing remote-as configuration when reload
From commit `411d1a2`, `bgp_delete_nbr_remote_as_line()` is added to
remove some specific bgp neighbors. But, when reloading the following
configuration, it will wrongly remove some good ones:
`neighbor 66.66.66.6 remote-as internal`:
tor-11# bridge -d fdb show | grep 00:65:00:00:00:01
00:65:00:00:00:01 dev hostbond1 vlan 1000 notify master bridge static
tor-12 receives sync MAC route:
Before fix:
----------
tor-12:/# bridge -d fdb show | grep 00:65:00:00:00:01
00:65:00:00:00:01 dev hostbond1 vlan 1000 notify master bridge static
After fix: inactive is set to MAC entry
----------
tor-12:/#bridge -d fdb show | grep 00:65:00:00:00:01
00:65:00:00:00:01 dev hostbond1 vlan 1000 notify inactive master bridge
static
Notice the difference in `inactive` post notify on tor-12
with the fix.
Signed-off-by: Trey Aspelund <taspelund@nvidia.com> Signed-off-by: Chirag Shah <chirag@nvidia.com>
Philippe Guibert [Fri, 14 Apr 2023 08:44:41 +0000 (10:44 +0200)]
lib: fix handle seg6local routes on default vrf
An L3VPN network can be configured on the main BGP instance,
with an SRv6 SID. By declaring a network, a seg6local route
is created but remains invalid.
The below BGP VPN configuration the default VRF has been
used:
> router bgp 1
> address-family ipv6 unicast
> sid vpn export auto
> rd vpn export 1:30
> rt vpn both 77:77
> import vpn
> export vpn
> network 2001:7::/64
> exit-address-family
The below seg6local route has been added:
> # show ipv6 route
> [..]
> B 2001:db8:2:2:300::/128 [20/0] is directly connected, unknown inactive, seg6local End.DT6 table 254, seg6 ::, weight 1, 00:00:07
>
When creating the seg6local route, an interface is used as nexthop.
The interface index is obtained from the vrf identifier. This is
true when using VRF interfaces, but is wrong when using the lo
interface which usually has the '1' ifindex whereas the vrf id for
the default VRF is 0.
Get the appropriate index from the vrf identifier.
The below seg6local route is visible:
lynne [Wed, 23 Jun 2021 17:15:17 +0000 (13:15 -0400)]
ospf6d: missing ECMP NHs in certain topologies
When ospf6 is started up and SPF is run depending on which route is
selected as the parent route we could miss adding a NH. If one
possible parent route has two equal cost paths and the second possible
parent route has only one depending on which one is selected first
determines if we have have one or two NHs.
In the network below when creating a route 2001:db8:3:4::/64 in R2.
When SPF is run there are two possible parent routes R3 and R4.
The problem was if we first created the route to 2001:db8:3:4::/64 with R3
as the parent route all is fine. The code was merging the NH from the parent
route and R3 has 2 NH, one pointing to R1 and one to R5. But if route
2001:db8:3:4::/64 was first created with parent as R4, it has only one NH
pointing to R1, and then later a new vertex was created pointing to R3 the
code would only copy the nhs from the vertex not from the parent route. The
vertex always has just one NH. But the parent route could have more. So
when we would bringup this setup one time we would see one NH for
2001:db8:3:4::/64 and the next time we would see two NHs. The code has been
modified so that it behaves the same when the route is first created, or when
a vertex is created, it selects the NHs from the parent route.
Philippe Guibert [Wed, 12 Apr 2023 13:51:25 +0000 (15:51 +0200)]
bgpd: fix bgp label value when static route used
The BGP local label value is not re-set when the prefix
is either a network or an aggregate prefix. Ensure to
get the appropriate label value each time the 'need_imp_null_label()'
function has to return true.
Fixes: 7ee70320d370 ("bgpd: add cli command to control explicit-null label usage") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Christian Hopps [Sun, 9 Apr 2023 09:02:51 +0000 (05:02 -0400)]
lib: convert if_rmap to YANG northbound
- nice correspondence between new YANG grouping and shared library code.
- fixes bug with RIPNG use, certainly didn't work before.
- removes rip header from shared library code
- still has uses RIP_NODE/RIPNG_NODE as required by CLI foo.
pimd: Option to get IGMP groups and sources for a particular interface
1. Added interface name, group address and detail option to existing
"show ip igmp groups" so that user can retrieve all the groups
or a particular group for an interface. Detail option shows the source
information for the group. With that, the show command
looks like:
"show ip igmp [vrf NAME$vrf_name] groups [INTERFACE$ifname [GROUP$grp_str]] [detail$detail] [json$json]"
2. Changed pim_cmd_lookup_vrf() to return empty JSON if VRF is not present
3. Changed "detail" option to print non pretty JSON
4. Added interface name and group address to existing
"show ip igmp sources" so that user can retrieve all the sources for
all the groups or, all the sorces for a particular group for an
interface. With that, the show command looks like:
"show ip igmp [vrf NAME$vrf_name] sourcess [INTERFACE$ifname [GROUP$grp_str]] [json$json]"
Donald Sharp [Tue, 11 Apr 2023 14:49:34 +0000 (10:49 -0400)]
tests: Ensure that the scale_up.py script tests for actual sharp installed routes first
The scale_up.py script used by several tests installs 50k routes into the rib from
sharpd. It is first looking for the results in the bgp database. Let's ensure
that the routes are actually installed into the rib first before looking in
the bgp tables. This should help situations where the system is under extreme
load.
Mark Stapp [Wed, 29 Mar 2023 20:58:25 +0000 (16:58 -0400)]
ospfd: support write socket per interface
Add support for a write socket per interface, enabled by
default at the ospf instance level. An ospf instance-level
config allows this to be disabled, reverting to the older
behavior where a single per-instance socket is used for
sending and receiving packets.
Philippe Guibert [Fri, 17 Mar 2023 13:46:13 +0000 (14:46 +0100)]
bgpd: add cli command to control explicit-null label usage
In BGP labeled unicast address-family, it is not possible to
send explicit-null label values with redistributed or network
declared prefixes.
A new CLI command is introduced:
> [no] bgp labeled-unicast explicit-null
When used, the explicit-null value for IPv4 ('0' value) or
IPv6 ('2' value) will be used.
It is necessary to reconfigure the networks or the
redistribution in order to inherit this new behaviour.
Add the documentation.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Donald Sharp [Tue, 11 Apr 2023 13:15:13 +0000 (09:15 -0400)]
tests: Fix evpn tests to ensure mac addresses will show up
Locally, the bgp_evpn_vxlan_svd_topo1 and bgp_evpn_vxlan_topo1
tests are failing for me. Upon inspection the test is looking
for the mac addresses of the interfaces participating in the
evpn bridging on the hosts. For some reason on my machine
these mac addresses are not in the l2 tables at all on
PE1 or PE2. Adding quick pings solves the problems.
mgmtd: remove the frr_startup.json related documentation.
Since mgmtd no longer supports the frr_startup.json, removing the
documentation related to that. Proper documentation will be added
when/if the frr_startup.json is ever supported.
zebra: Install directly connected route after interface flap
Issue:
After vlan flap, zebra was not marking the selected/best route as installed.
As a result, when a static route was configured with nexthop as directly
connected interface's(vlan) IP, the static route was not being installed
in the kernel since its nexthop was unresolved. The nexthop was marked
unresolved because zebra failed to mark the best route as installed after
interface flap.
This was happening because, in dplane_route_update_internal() if the old and
new context type, and nexthop group id are the same, then zebra doesn't send
down a route replace request to kernel. But, the installed (ROUTE_ENTRY_INSTALLED)
flag is set when zebra receives a response from kernel. Since the
request to kernel was being skipped for the route entry, installed flag
was not being set
Fix:
In dplane_route_update_internal() if the old and new context type, and
nexthop group id are the same, then before returning, installed flag will
be set on the route-entry if it's not set already.