Donald Sharp [Fri, 14 Jan 2022 17:50:51 +0000 (12:50 -0500)]
zebra: Modify route_notify_internal to use a route_node
Pass in the route_node that is under consideration
into route_notify_internal to allow calling functions
to reduce stack size as well as looking up data.
Donald Sharp [Tue, 4 Jan 2022 18:11:35 +0000 (13:11 -0500)]
tests: Add ospf_instance_redistribute testing
Redistribution for ospf with instance id's using instance id's
was incorrect. Add some small tests to make sure it catches the
issues and we don't regress.
This cannot be correct behavior. When redistributing in the absense
of an instance number the default instance of 0 should be used and should
be the only route redistributed. Here is the correct behavior:
eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:00:28
D>* 4.5.6.7/32 [150/0] via 192.168.100.1, virbr1, weight 1, 00:00:02
D[3]>* 4.5.6.8/32 [150/0] via 192.168.100.1, virbr1, weight 1, 00:00:02
D[4]>* 4.5.6.9/32 [150/0] via 192.168.100.1, virbr1, weight 1, 00:00:02
C>* 192.168.100.0/24 is directly connected, virbr1, 00:00:28
C>* 192.168.110.0/24 is directly connected, virbr2, 00:00:28
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:00:28
C>* 192.168.122.0/24 is directly connected, virbr0, 00:00:28
eva# show ip ospf data
OSPF Instance: 3
OSPF Router with ID (192.168.122.1)
AS External Link States
Link ID ADV Router Age Seq# CkSum Route
4.5.6.7 192.168.122.1 6 0x80000001 0x477c E2 4.5.6.7/32 [0x0]
Donald Sharp [Mon, 3 Jan 2022 17:15:02 +0000 (12:15 -0500)]
ospfd: Get `default-information originate` working for ospf instances
The ospf instance code is not properly handling the default route
when using default-information originate. This is because
the code is looking for the default route to be saved with an
instance of <ospf instance id> but we always save it as a instance
id of 0. In fact OSPF asks zebra for the default route as a special
case in instance 0, always.
Here is the correct behavior:
eva# show ip ospf data
OSPF Instance: 3
OSPF Router with ID (192.168.122.1)
AS External Link States
Link ID ADV Router Age Seq# CkSum Route
0.0.0.0 192.168.122.1 8 0x80000001 0xdb08 E2 0.0.0.0/0 [0x0]
eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR, f - OpenFabric,
> - selected route, * - FIB route, q - queued, r - rejected, b - backup
t - trapped, o - offload failure
K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:02:03
Fixes: #10251 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Donald Sharp [Mon, 3 Jan 2022 17:11:37 +0000 (12:11 -0500)]
zebra: Add hint to what instance we are looking at
FRR allows redistribution to a client with a specific
instance in mind. The code was not allowing you to figure
out what instance was being looked at. So let's clarify this
in the debugs.
sarita patra [Tue, 4 Jan 2022 11:26:06 +0000 (03:26 -0800)]
pim: Keeping list of address-family under gmp container
Renamed frr-igmp.yang to frr-gmp.yang, igmp to gmp container.
to support IGMP and MLD protocol.
frr-gmp.yang, created a list of address family under mgmd
container. For PIMV4 the key is IPV4, where as for PIMV6
the key is IPV6. This is done for PIMV6 development.
This commit will have all the northbound changes to support
IPV4 address family.
Trey Aspelund [Fri, 14 Jan 2022 21:57:32 +0000 (21:57 +0000)]
bgpd: fix advertisedRoutes json key
'show bgp ... neighbor [routes|received-routes]' both incorrectly
used a json key of 'advertisedRoutes'.
This corrects the key to be 'receivedRoutes' for commands where
the displayed routes were received, not advertised.
before:
unet> r3 show ip bgp neigh 10.2.30.2 received-routes json | include Routes
"advertisedRoutes":{
after:
ub18# show ip bgp neighbors enp1s0 received-routes json | include Routes
"receivedRoutes":{
ub18# show ip bgp neighbors enp1s0 advertised-routes json | include Routes
"advertisedRoutes":{
David Lamparter [Wed, 5 Jan 2022 15:23:23 +0000 (16:23 +0100)]
lib: add `s` option to `pI4`/`pI6`/`pIA` printfrr
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>
David Lamparter [Wed, 5 Jan 2022 18:51:19 +0000 (19:51 +0100)]
tools: disable printf ext checks in checkpatch
checkpatch.pl has a hardcoded list of printf extensions supported... by
the Linux kernel. This happens to have covered the ones we have in FRR
so far, but `%pPA` isn't on the list and others may not be either.
Since we have the frr-format GCC plugin (and CI runs that on Debian 11)
we don't really need these checks in checkpatch.pl.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Sarita Patra [Mon, 14 Jun 2021 01:48:35 +0000 (18:48 -0700)]
zebra: Fix for route node having no tracking NHT
Topology:
IXIA-----(ens192)FRR(ens224)------iXIA
Configuration:
1. Create 8 sub-interfaces on ens192 under Default VRF and configure 8
EBGP session between FRR and IXIA.
2. Create 1000 sub-interfaces on ens224 under Default VRF and configure
1000 EBGP session between FRR and IXIA.
3. 2M prefixes distributed from Left side Ixia each with 8 ECMP path.
4. So in total, there are 2M prefixes * 8 ECMP = 16M prefixes entries
in RIB and FIB.
Issue:
Shut ens192 and ens224, this is taking 1hr 15 mins to clean up the routes.
Root Cause:
In the case of route deletion, if the particular route node is having
nht count = 0, we are going to the parent and doing nht evaluation,
which is not needed.
Fix:
If the deleted the route node is having nht count > 0, then do a nht
evaluation on the parent node.
Shut ens192 and ens224, it is taking 1 min to clean up the routes
with the fix.
David Lamparter [Thu, 13 Jan 2022 13:18:29 +0000 (14:18 +0100)]
python: pass conditionals through clippy for DEFPY
Track what conditionals apply when a DEFPY is encountered, and stack
them around the autogenerated clippy wrapper. Otherwise conditional
DEFPYs result in undefined function warnings.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
sarita patra [Wed, 15 Dec 2021 13:24:51 +0000 (05:24 -0800)]
pim: Northbound changes accomodating IPV4 address family
frr-pim.yang, created a list of address family under pim
container. For PIMV4 the key is IPV4, where as for PIMV6
the key is IPV6. This is done for PIMV6 development.
This commit will have all the northbound changes to support
IPV4 address family.
Donatas Abraitis [Thu, 13 Jan 2022 08:39:15 +0000 (10:39 +0200)]
bgpd: Show Long-lived Graceful Restart timer remaining per prefix
```
exit1-debian-11# sh ip bgp 100.100.100.100/32
BGP routing table entry for 100.100.100.100/32, version 7
Paths: (2 available, best #2, table default)
Advertised to non peer-group peers:
home-spine1.donatas.net(192.168.0.2)
65002, (stale)
192.168.10.17 from donatas-pc(192.168.10.17) (0.0.0.0)
Origin incomplete, valid, external
Community: llgr-stale
Last update: Thu Jan 13 08:58:08 2022
Time until Long-lived stale route deleted: 18
65001
192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (2.2.2.2)
Origin incomplete, metric 0, valid, external, best (First path received)
Last update: Thu Jan 13 08:57:56 2022
```
pimd: IGMPv2 leave msg may be longer than 8 octets
Fix the code as per RFC 2236 section 2.5:
Note that IGMP messages may be longer than 8 octets, especially
future backwards-compatible versions of IGMP. As long as the Type is
one that is recognized, an IGMPv2 implementation MUST ignore anything
past the first 8 octets while processing the packet. However, the
IGMP checksum is always computed over the whole IP payload, not just
over the first 8 octets.
pimd: IGMPv2 report msg may be longer than 8 octets
As per test case IGMP Conformance test case 5.6, report
messages longer than 8 octets should be accepted to support
future-backward compatibilty.
Fix the code as per RFC 2236 section 2.5:
Note that IGMP messages may be longer than 8 octets, especially
future backwards-compatible versions of IGMP. As long as the Type is
one that is recognized, an IGMPv2 implementation MUST ignore anything
past the first 8 octets while processing the packet. However, the
IGMP checksum is always computed over the whole IP payload, not just
over the first 8 octets.
David Lamparter [Mon, 10 Jan 2022 08:40:50 +0000 (09:40 +0100)]
pimd: temporarily disable IPv6 types
Just putting the infrastructure in place and having it disabled is
actually good progress here; have the compiler make itself useful and
tell us what we have to do to get the basics right.
(The next commit will cause a *lot* of compile errors as soon as
`PIM_V6_TEMP_BREAK` is set; but there is no reason to force everything
into a single step here.)
To enable `pim_addr = in6_addr`, run `make PIM_V6_TEMP_BREAK=1` (remove
previous compile results with `rm pimd/pim6d-*.o`)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter [Thu, 11 Nov 2021 16:34:00 +0000 (17:34 +0100)]
pim6d: add skeleton for IPv6 PIM daemon
This newborn pim6d is essentially an empty husk, but it does build
without warnings or errors and has the build system integration prepared
and working.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Donald Sharp [Wed, 12 Jan 2022 14:49:59 +0000 (09:49 -0500)]
bgpd: Remove unneeded loop over all peers
The bgp_notify_conditional_adv_scanner function was/is looping
over all peers. And only matching on the passed in peer,
based upon the subgroup. As such we do not need to loop
over everything and just cut-to-the chase and just modify
the peer structure.
```
*** CID 1510737: Null pointer dereferences (REVERSE_INULL)
/bgpd/bgpd.c: 4344 in bgp_shutdown_enable()
4338 /* continue, if peer is already in administrative shutdown. */
4339 if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN))
4340 continue;
4341
4342 /* send a RFC 4486 notification message if necessary */
4343 if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) {
>>> CID 1510737: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "msg" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
4344 if (msg)
4345 bgp_notify_send_with_data(
4346 peer, BGP_NOTIFY_CEASE,
4347 BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN, data,
4348 datalen + 1);
4349 else
```
anlan_cs [Tue, 11 Jan 2022 09:21:05 +0000 (04:21 -0500)]
ospf6d: give error information for commands with non-exist vrfs
Currently the ospf6d's commands with non-exist vrfs can't give the error
informations to users.
This commit adds a macro "OSPF6_CMD_CHECK_VRF" to give error information
if with non-exist vrfs. As usual, skip the checking process in the case
of json.
So one command can call this macro to do the checking process in its
end. At that time it need know json style or not, so add "json" parameter for
several related functions.
BTW, suppress the build warning of the macro `OSPF6_FIND_VRF_ARGS`:
"Macros starting with if should be enclosed by a do - while loop to avoid
possible if/else logic defects."
sarita patra [Tue, 14 Dec 2021 12:25:40 +0000 (04:25 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_neighbor and gm_sock
Changed struct in_addr source_addr to struct PIM_ADDR source_addr
which is to be used in both IPv4 and IPv6(Both MLD and IGMP). Reviewed-by: Mobashshera Rasool <mrasool@vmware.com> Signed-off-by: sarita patra <saritap@vmware.com>
sarita patra [Tue, 14 Dec 2021 12:22:28 +0000 (04:22 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_upstream for IPv6.
Changed struct in_addr upstream_addr and struct in_addr upstream_register
to struct PIM_ADDR upstream_addr and struct PIM_ADDR upstream_register
which are to be used in both IPv4 and IPv6(Both MLD and IGMP).
pimd: Modifying in_addr to pim_addr in struct pim_jp_agg_group for IPv6
Changed struct in_addr group to struct pim_addr group
which is to be used in both IPv4 and IPv6(Both MLD and IGMP). Reviewed-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
pimd: Modifying in_addr to pim_addr in igmp_join for IPv6.
Changed struct in_addr source_addr to pim_addr source_addr
in struct igmp_join which is to be used in
both IPv4 and IPv6(Both MLD and IGMP). Reviewed-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
pimd: Modifying in_addr to pim_addr in struct pim_interface for IPv6
Based on compiler option, pim_addr will be changed to in_addr
or in6_addr for pimd and pim6d respectively. Reviewed-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
pimd: Modify in_addr to pim_addr in pim_assert_metric
This change is to accomodate IPv6 and IPv4 in the same code.
Based on pimd or pim6d, this will be compiled. Reviewed-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
pimd: Modifying in_addr to pim_addr in struct pim_ifchannel for IPv6.
Changed struct in_addr ifassert_winner to pim_addr
which will be used in both IPv4 and IPv6(Both MLD and IGMP). Reviewed-by: Sarita Patra <saritap@vmware.com> Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>