Donatas Abraitis [Wed, 19 Jan 2022 17:02:01 +0000 (19:02 +0200)]
bgpd: Show Graceful Restart seconds remaining per prefix
```
exit1-debian-11# sh ip bgp 10.10.10.10/32
BGP routing table entry for 10.10.10.10/32, version 14
Paths: (1 available, best #1, table default)
Not advertised to any peer
65000, (stale)
192.168.0.2 from 192.168.0.2 (0.0.0.0)
Origin incomplete, metric 0, valid, external, best (First path received)
Last update: Wed Jan 19 17:13:51 2022
Time until Graceful Restart stale route deleted: 117
```
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.
tests: Fix random failure in test_PIM_hello_tx_rx_p1
The test case test_PIM_hello_tx_rx_p1 is failing randomly because
sometimes the hello packet is received and sometimes not received while getting
the stats data.
When the hello packet is received HelloRx gets incremented to 1 and then
shutdown of the interface is executed which resets the stats to 0
and again when "no shutdown" of the interface is done, the stats get incremented to 1.
The test case checks after "no shutdown" of the interface whether the stats is incremented
but in this case although the stats got incremented the before and after value is same.
Hence the test case failed.
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
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>