Commit Graph

29152 Commits

Author SHA1 Message Date
Donald Sharp
f4e8f5d496 pimd: Checks imply that pim is not properly configured
The call to gm_update_ll checks for null pointers and
implies to SA that things could not be configured correctly
This is not true with the code flow.  Remove the confusing code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 13:43:25 -04:00
Donald Sharp
6f55b4ae24 pimd: Let end operator know the ifindex as well in failure case
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 13:43:25 -04:00
Donald Sharp
d9529c9fb1 ospf6d: Ensure that ospf6d does not memcpy beyond end of data
Ensure that received data size can fit into temp variable
that is used to dump data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 13:43:25 -04:00
Donald Sharp
75700af602 pimd: Limit pim's ecmp to what zebra tells us is the multipath
Zebra can be setup to use a value that is less than MULTIPATH_NUM.
When pimd connects to zebra, zebra will inform pim about the MULTIPATH_NUM
used.  Let's use that value for figuring out our multipath value.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 13:29:19 -04:00
Donald Sharp
8b5153aab0 bgpd: Cleanup pointer assignment so compiler doesn't get confused
Coverity SA thinks that the `struct prefix`.u.prefix4 is limited
to actually 4 bytes of memory at that spot, but it's in a union
and it can be treated as a prefix6 as well.  Just change the
pointer assignment to something that covers both easily.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 13:29:19 -04:00
Donald Sharp
9d3de36d0d isisd: Let's use an actual NULL pointer to test for a NULL pointer
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 13:29:19 -04:00
Donald Sharp
6b1c889f29
Merge pull request #11463 from rgirada/ospf_coverity
ospfd: fixing few coverity issue in 'show_ip_ospf_neighbour_brief'
2022-06-23 13:16:48 -04:00
mobash-rasool
5b9ffc923d
Merge pull request #11182 from g-balaji1/pimv6-sock-hdrincl
pim6d: Removal of IPV6_HDRINCL option
2022-06-23 22:16:47 +05:30
Donald Sharp
fc3de981be zebra: Allow kernel routes to stick around better on interface state changes
Currently kernel routes on system bring up would be `auto-accepted`,
then if an interface went down all kernel and system routes would
be re-evaluated.  There exists situations where a kernel route can
exist but the interface itself is not exactly in a state that is
ready to create a connected route yet.  As such when any interface
goes down in the system all kernel/system routes would be re-evaluated
and then since that interfaces connected route is not in the table yet
the route is matching against a default route( or not at all ) and
is being dropped.

Modify the code such that kernel or system routes just look for interface
being in a good state (up or operative) and accept it.

Broken code:
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:05:08
K>* 1.2.3.5/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.6/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.7/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.8/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.9/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.10/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.11/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.12/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.13/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.14/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.16/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 1.2.3.17/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
C>* 4.5.6.99/32 is directly connected, dummy9, 00:05:08
K>* 4.9.10.11/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:05:08
K>* 10.11.12.13/32 [0/0] via 192.168.119.1, enp39s0, 00:05:08
C>* 192.168.10.0/24 is directly connected, dummy99, 00:05:08
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:05:08
<shutdown a non-related interface>
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:05:28
C>* 4.5.6.99/32 is directly connected, dummy9, 00:05:28
K>* 10.11.12.13/32 [0/0] via 192.168.119.1, enp39s0, 00:05:28
C>* 192.168.10.0/24 is directly connected, dummy99, 00:05:28
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:05:28

Working code:
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:04
K>* 1.2.3.5/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.6/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.7/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.8/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.9/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.10/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.11/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.12/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.13/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.14/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.16/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 1.2.3.17/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
C>* 4.5.6.99/32 is directly connected, dummy9, 00:00:04
K>* 4.9.10.11/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:04
K>* 10.11.12.13/32 [0/0] via 192.168.119.1, enp39s0, 00:00:04
C>* 192.168.10.0/24 is directly connected, dummy99, 00:00:04
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:00:04
<shutdown a non-related interface>
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:15
K>* 1.2.3.5/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.6/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.7/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.8/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.9/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.10/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.11/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.12/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.13/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.14/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.16/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 1.2.3.17/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
C>* 4.5.6.99/32 is directly connected, dummy9, 00:00:15
K>* 4.9.10.11/32 [0/0] via 172.22.0.44, br-23e378ed7fd2 linkdown, 00:00:15
K>* 10.11.12.13/32 [0/0] via 192.168.119.1, enp39s0, 00:00:15
C>* 192.168.10.0/24 is directly connected, dummy99, 00:00:15
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:00:15
eva#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 12:22:30 -04:00
Donald Sharp
3689905d32 zebra: Add interface sysctl ignore on linkdown status
Add the ability to decode the ignore on linkdown nexthop
status for an interface.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 11:23:37 -04:00
Donald Sharp
c704cb44a9 lib, zebra: Notice when a nexthop is set linkdown
When a nexthop is set RTNH_F_LINKDOWN, start noticing
that this flag is set.  Allow FRR to know about this
flag but at this point do not do anything with it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 11:23:37 -04:00
Donald Sharp
52e8a7c4f0 lib: Increase nexthop flags size to 16 bits
commit: 5609e70fb8
Added a new flag to the `struct nexthop` and
this addition of a flag caused the flags size to
be too small.  Increase the size of flags to
allow more flags to be had.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 11:23:37 -04:00
Donald Sharp
2b9dc841b7 zebra: Fix bug in netconf handling where dplane would drop the change
When reading a on the fly change of an interested netconf netlink
message. The ifindex and ns_id for the context was being set for the sub structure
but not for the main context data structure and zebra_if_dplane_result
was dropping the result on the floor because it was expecting the ns_id and
the interface id to be in a different spot.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-06-23 11:23:08 -04:00
Ricardo
63eaefa86c zebra: rtnetlink: flow attr per gateway attr in multipath updates
Signed-off-by: Ricardo <rbarroetavena@anura.com.ar>
2022-06-23 12:05:26 -03:00
plsaranya
1ce957d66d Pim6d: Mroute file duplication removal
Mroute duplicate functions removed and made us hybrid for v4 and v6

Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
2022-06-23 06:59:03 -07:00
rgirada
25804ce593 ospfd: fixing few coverity issue in 'show_ip_ospf_neighbour_brief'
Description:
	timerval data structure is being used without initialization.
	Using these uninitialized parameters can lead unexpected results
	so initializing before using it.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-06-23 06:43:22 -07:00
Russ White
98b3ab772e
Merge pull request #10629 from leonshaw/fix/mp-evpn-nh
lib, zebra, bgpd: Move route EVPN flag to nexthop
2022-06-23 07:00:33 -04:00
Christian Hopps
9495c4056f tests: add ospf api router ID topotest
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-23 05:01:40 -04:00
Christian Hopps
b059fb7f32 ospfclient: add router id support to python client
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-23 05:01:40 -04:00
Christian Hopps
44038c7ae3 ospfd: add router id support to ospf api
Signed-off-by: Christian Hopps <chopps@labn.net>
2022-06-23 05:01:40 -04:00
anlan_cs
41a8b88ce4 zebra: move the check for l3vni
The two checks for l3vni have been already done in
`lib_vrf_zebra_l3vni_id_modify()` as it should be. And it is improper that
the two checks are put after `zebra_vxlan_handle_vni_transition()`, which
will do real things.

My original fix is to remove them. But NB module can't guarantee many changes,
so we'd better keep them in `zebra_vxlan_process_vrf_vni_cmd()` in APPLY stage
for safe.

Just move them in front of `zebra_vxlan_handle_vni_transition()`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-06-23 01:33:45 -04:00
Russ White
2d088d8d53
Merge pull request #11437 from rgirada/ospf_nbr
ospfd: Fixing "show ip ospf neighbour <nbrid>" command
2022-06-22 14:54:08 -04:00
rgirada
e8a8b11610 ospfd: Fixing "show ip ospf neighbour <nbrid>" command
Description:
	"show ip ospf neighbour [nbrid] [json]" is expected to give brief output
	of the specific neighbour. But it gives the detailed output without
	the detail keyword.
	"show ip ospf neighbour [nbrid] [deatil] [json]" command is failed to
	fetch the ecpected o/p. Corrected it.

	Ex o/p:
	frr(config-if)# do show ip ospf  neighbor

	Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
	8.8.8.8           1 Full/DR         17m03s            31.192s 20.1.1.194      ens192:20.1.1.220                    0     0     0
	30.1.1.100        1 Full/DR         56.229s           32.000s 30.1.1.100      ens224:30.1.1.220                    0     0     0

	frr(config-if)#
	frr(config-if)#
	frr(config-if)# do show ip ospf  neighbor 8.8.8.8
	Neighbor 8.8.8.8, interface address 20.1.1.194
	In the area 0.0.0.0 via interface ens192
	Neighbor priority is 1, State is Full/DR, 6 state changes
	Most recent state change statistics:
	  Progressive change 17m18s ago
	DR is 20.1.1.194, BDR is 20.1.1.220
	Options 2 *|-|-|-|-|-|E|-
	Dead timer due in 35.833s
	Database Summary List 0
	Link State Request List 0
	Link State Retransmission List 0
	Thread Inactivity Timer on
	Thread Database Description Retransmision off
	Thread Link State Request Retransmission on
	Thread Link State Update Retransmission on

	Graceful restart Helper info:
	  Graceful Restart HELPER Status : None

	frr(config-if)# do show ip ospf  neighbor 8.8.8.8 detail
	No such interface.
	frr(config-if)# do show ip ospf  neighbor 8.8.8.8 detail json
	{}
	frr(config-if)#

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-06-22 08:40:24 -07:00
Eugene Bogomazov
865a7e7b3a bgpd: move to switch clause in get name function
bgp_rpki_validation2str implements a switch statement to determine the
correct string response from the validation state. So, switch to a
switch statement when getting a name by role for code consistency.

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-22 17:03:25 +03:00
Eugene Bogomazov
13896bde30 bgpd: simplify code fragment for RFC 9234
Roles cannot be applied to iBGP sessions, so we can move this check to
the top of the role configuration method. Thus, we simplify the internal
logic of branching.

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-22 16:12:28 +03:00
Eugene Bogomazov
9a38a7b055 bgpd: simplify ebgp role check for RFC 9234
BGP Role is currently defined only for eBGP session. So, we don't
need to consider which roles can be applied on iBGP session and
thus simplify code fragment.

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-22 15:09:06 +03:00
Donald Sharp
8684ca8fd5
Merge pull request #11442 from opensourcerouting/fix/rpki_cli
bgpd: RPKI fixes
2022-06-22 07:35:30 -04:00
Donald Sharp
a01887c40b
Merge pull request #11445 from opensourcerouting/fix/replace_sockunion2str
*: Replace sockunion2str => %pSU
2022-06-22 07:33:14 -04:00
Eugene Bogomazov
5a78f2bcb0 bgpd: add AFI/SAFI check for RFC 9234
RFC 9234 mandates that role rules apply only to IPv4/IPv6 unicast bgp
sessions. If the OTC attribute appears in other sessions, it will remain
untouched.

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-22 13:34:51 +03:00
Donatas Abraitis
0ba27f1cb2
Merge pull request #11427 from anlancs/fix/minor-2
zebra: remove redundant calling hook for fpm
2022-06-22 11:39:13 +03:00
Donatas Abraitis
14b27b3610
Merge pull request #11418 from mobash-rasool/fixes2
lib: pim6d: Use IPv6 global unicast address to send PIMv6 register packet
2022-06-22 11:13:28 +03:00
Mobashshera Rasool
4b603761c1 pim6d: Send register msg with IPv6 global address
Use global unicast IPv6 address to send the register
packet.

Fixes: #11235

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-06-21 20:44:10 -07:00
Mobashshera Rasool
3a0d338bc9 lib: Add an api is_ipv6_global_unicast
Add api is_ipv6_global_unicast to identify whether a given
ipv6 address is global unicast or not.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-06-21 20:44:10 -07:00
mobash-rasool
f21ba4fbae
Merge pull request #11443 from opensourcerouting/fix/duplicate_label
bgpd: Drop duplicate label assignment
2022-06-22 07:11:26 +05:30
rvaratharaj
4bf66f436e Zebra EVPN Debug: Fixing log flooding when disabling MLAG leaf configuration
When disabling MLAG leaf configuration with EVPN, logs are
getting flooded for each VNI, This is the result of each Type-2
packets. Ideally, this should be under log debugging, not a warning.

Testing: UT
Signed-off-by: Rajesh Varatharaj <rvaratharaj@nvidia.com>
2022-06-21 18:18:14 -07:00
Jafar Al-Gharaibeh
3971e02928
Merge pull request #11448 from gpnaveen/ospf_scripts_stbl
tests: Removing invalid step from OSPF tests.
2022-06-21 13:44:33 -05:00
Donald Sharp
b9e76a5f8a
Merge pull request #11449 from Jafaral/ospf-readme
ospfclient: fix help url
2022-06-21 13:08:45 -04:00
Donatas Abraitis
8f401cda58 bgpd: Do not show polling_period default value in CLI for RPKI
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-21 18:49:10 +03:00
Donatas Abraitis
01ceb8b23c
Merge pull request #11417 from donaldsharp/nhg_timer
Nhg timer
2022-06-21 18:43:45 +03:00
Donatas Abraitis
70292e9bbf
Merge pull request #11351 from kuldeepkash/uplink_mcast_tests
tests: Add multicast-pim-multi-uplink test suite
2022-06-21 18:37:40 +03:00
Russ White
e63a5c42dd
Merge pull request #11352 from ARShreenidhi/default_originate_automation
tests  : bgp default-originate test suite automation
2022-06-21 11:33:47 -04:00
Jafar Al-Gharaibeh
770e16041c ospfclient: fix help url
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-06-21 09:54:31 -05:00
Eugene Bogomazov
aee05e20fd bgpd: Update topotests for RFC 9234
In the previous version, the time.sleep function was included to wait
for the moment when the routes were sent to all routers. Changed this
function to topotest.run_and_expect for more deterministic behavior.

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-21 17:41:53 +03:00
Eugene Bogomazov
8f2d6021f8 bgpd: Add patches for RFC9234 implementation
This commit fixes some issues that were noted by the reviewer

Signed-off-by: Eugene Bogomazov <eb@qrator.net>
2022-06-21 17:41:53 +03:00
Russ White
088ec2b0a7
Merge pull request #11440 from opensourcerouting/fix/increase_flags_bgp_peer_to_uint64
bgpd: Increase peer->flags to uint64_t
2022-06-21 10:31:50 -04:00
Russ White
33d960c7ab
Merge pull request #11444 from opensourcerouting/fix/bfd_bgp_down_debug_level
bgpd: Replace zlog_info -> zlog_debug under BGP_DEBUG()
2022-06-21 10:01:46 -04:00
Donatas Abraitis
47e1288431 *: Replace sockunion2str => %pSU
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-21 13:34:56 +03:00
nguggarigoud
d5bd355430 tests: Removing invalid step from ospf tests.
1. Removed the step from hello test case with hello
timer of 65535. This test works in some platforms
and does not work in others, affecting stability.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2022-06-21 02:21:35 -07:00
Donatas Abraitis
95291f18bc bgpd: Replace zlog_info -> zlog_debug under BGP_DEBUG()
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-21 11:59:52 +03:00
Donatas Abraitis
fdfd1a6f40 bgpd: Drop duplicate label assignment
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-06-21 11:57:33 +03:00