Commit Graph

30591 Commits

Author SHA1 Message Date
Philippe Guibert
97413ed778 topotests: add bfd_vrflite_topo1 test
This tests checks that there are no errors when receiving BFD
packets over the various linux vrf interfaces. For example, if
an incoming packet is received by the wrong socket, a VRF
mismatch error would occur, and BFD flapping would be observed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-07-22 08:49:52 +02:00
Philippe Guibert
e6d4113660 pathd: add a zebra stop handler
This handler code is used to stop zebra related contexts.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-07-22 08:39:06 +02:00
Donatas Abraitis
fcc48b4f9e
Merge pull request #11658 from Jafaral/up-rel8.3
debian, redhat: updating changelog for new release
2022-07-22 08:26:23 +03:00
Donatas Abraitis
eed5b70f94
Merge pull request #11657 from donaldsharp/why_timer
convert thread_cancel to THREAD_OFF
2022-07-22 08:26:08 +03:00
Jafar Al-Gharaibeh
4ca513bb8a debian, redhat: updating changelog for new release
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2022-07-21 18:11:04 -05:00
mobash-rasool
cb6c39645f
Merge pull request #11654 from donaldsharp/fixup_macros
*: frr_with_mutex change to follow our standard
2022-07-21 19:10:41 +05:30
Donald Sharp
2783a6921c ldpd: Convert thread_cancel to THREAD_OFF
Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:30:50 -04:00
Donald Sharp
fa935aa7e8 isisd: Convert thread_cancel to THREAD_OFF
Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:30:50 -04:00
Donald Sharp
146bcb9b92 zebra: Convert thread_cancel to THREAD_OFF
Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:30:50 -04:00
Donald Sharp
b8551584ee lib, vrrpd: Use THREAD_ARG
Don't auto set the thread->arg pointer.  It is private
and should be only accessed through the THREAD_ARG pointer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:30:50 -04:00
Donald Sharp
c3aaa89a44 bgpd: Convert thread_cancel to THREAD_OFF and use THREAD_ARG
Just convert all uses of thread_cancel to THREAD_OFF.  Additionally
use THREAD_ARG instead of t->arg to get the arguement.  Individual
files should never be accessing thread private data like this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:30:49 -04:00
Donald Sharp
fa5806c318 bgpd: Remove various macros that overlap THREAD_OFF
Let's just use THREAD_OFF consistently in the code base
instead of each daemon having a special macro that needs to
be looked at and remembered what it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:27:36 -04:00
Donald Sharp
69ec2ecbea ripngd: Convert thread_cancel to THREAD_OFF
Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:27:35 -04:00
Donald Sharp
546c8d78e7 ripngd: Remove various macros that overlap THREAD_OFF
Let's just use THREAD_OFF consistently in the code base
instead of each daemon having a special macro that needs to
be looked at and remembered what it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:27:35 -04:00
Donald Sharp
f6499a7608 ripd: Convert thread_cancel to THREAD_OFF
Just convert all uses of thread_cancel to THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:27:35 -04:00
Donald Sharp
580e37a3fa ripd: Remove various macros that overlap THREAD_OFF
Let's just use THREAD_OFF consistently in the code base
instead of each daemon having a special macro that needs to
be looked at and remembered what it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:27:35 -04:00
Donald Sharp
bc1f09de73 ospfd: Convert thread_cancel to THREAD_OFF
Just convert all uses of thread_cancel to THREAD_OFF.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:27:35 -04:00
Donald Sharp
cccd44f3b1 ospfd: Remove various macros that overlap THREAD_OFF
Let's just use THREAD_OFF consistently in the code base
instead of each daemon having a special macro that needs to
be looked at and remembered what it does.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-21 08:27:35 -04:00
Donald Sharp
87af90a765
Merge pull request #11653 from louis-6wind/fix-isis-sr-php
isisd: fix prefix-sid last-hop-behavior
2022-07-21 08:04:18 -04:00
Donald Sharp
7f74014f99
Merge pull request #11655 from opensourcerouting/fix/vtysh_end_parsing
vtysh: Ignore `end` when parsing frr.conf
2022-07-21 08:02:30 -04:00
Donatas Abraitis
ce2e1a0ed8 vtysh: Ignore end when parsing frr.conf
If we have `end` at the end of the frr.conf, then we never execute
XFRR_end_configuration command, and start/end markers do not work.

This leads to for example waiting BGP configuration parsing thread to hang,
and the peers are in shutdown state until the timer expires.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-20 22:57:33 +03:00
Donald Sharp
cb1991af8c *: frr_with_mutex change to follow our standard
convert:
	frr_with_mutex(..)

to:
	frr_with_mutex (..)

To make all our code agree with what clang-format is going to produce

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-20 15:50:32 -04:00
Louis Scalbert
4c94922c4b isisd: fix prefix-sid last-hop-behavior
The php value is defined in yang but not properly set.

Fixes: 8f6c893629 ("isisd: add segment-routing CLI commands")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-07-20 19:25:52 +02:00
mobash-rasool
efa98761d2
Merge pull request #11651 from anlancs/fix/minor-7
ospfd: correct one debug info for lsa
2022-07-20 21:48:35 +05:30
Donatas Abraitis
b6754b74ef
Merge pull request #11643 from ARShreenidhi/df_or_ntw_auto
tests: bgp default orignate behaviour on network commands
2022-07-20 11:43:10 +03:00
Donatas Abraitis
e6a380161c
Merge pull request #11648 from donaldsharp/snmp_testing
Bunch of stuff found during testing.
2022-07-20 10:08:20 +03:00
Donatas Abraitis
a484327fe1
Merge pull request #11638 from alirezaarzehgar/docfix_typo
doc: Remove extra "in" from document
2022-07-20 09:56:30 +03:00
anlan_cs
5cf2f9a7ea ospfd: correct one debug info for lsa
The index about slots should be displayed as `slot`. Additionally, adjust format.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-07-20 02:34:59 -04:00
Donald Sharp
a9b4458f61
Merge pull request #11649 from rampxxxx/bfd_cleanup_warning
BFDD: Cleanup warning
2022-07-19 20:25:26 -04:00
Philippe Guibert
edc3f63167 bfdd: allow l3vrf bfd sessions without udp leaking
Until now, when in vrf-lite mode, the BFD implementation
creates a single UDP socket and relies on the following
sysctl value to 1:

echo 1 > /proc/sys/net/ipv4/udp_l3mdev_accept

With this setting, the incoming BFD packets from a given
vrf, would leak to the default vrf, and would match the
UDP socket.

The drawback of this solution is that udp packets received
on a given vrf may leak to an other vrf. This may be a
security concern.

The commit addresses this issue by avoiding this leak
mechanism. An UDP socket is created for each vrf, and each
socket uses new setsockopt option: SO_REUSEADDR + SO_REUSEPORT.

With this option, the incoming UDP packets are distributed on
the available sockets. The impact of those options with l3mdev
devices is unknown. It has been observed that this option is not
needed, until the default vrf sockets are created.

To ensure the BFD packets are correctly routed to the appropriate
socket, a BPF filter has been put in place and attached to the
sockets : SO_ATTACH_REUSEPORT_CBPF. This option adds a criterium
to force the packet to choose a given socket. If initial criteria
from the default distribution algorithm were not good, at least
two sockets would be available, and the CBPF would force the
selection to the same socket. This would come to the situation
where an incoming packet would be processed on a different vrf.

The bpf code is the following one:

struct sock_filter code[] = {
 { BPF_RET | BPF_K, 0, 0, 0 },
};

struct sock_fprog p = {
          .len = sizeof(code)/sizeof(struct sock_filter),
          .filter = code,
};

if (setsockopt(sd, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, &p, sizeof(p))) {
        zlog_warn("unable to set SO_ATTACH_REUSEPORT_CBPF on socket: %s",
                  strerror(errno));
        return -1;
}

Some tests have been done with by creating vrf contexts, and by using
the below vtysh configuration:

ip route 2.2.2.2/32 10.126.0.2
vrf vrf2
 ip route 2.2.2.2/32 10.126.0.2
!
interface ntfp2
 ip address 10.126.0.1/24
!
interface ntfp3 vrf vrf4
 ip address 10.126.0.1/24
!
interface ntfp2 vrf vrf1
 ip address 10.126.0.1/24
!
interface ntfp2.100 vrf vrf2
 ip address 10.126.0.1/24
!
interface ntfp2.200 vrf vrf3
 ip address 10.126.0.1/24
!
line vty
!
bfd
 peer 10.126.0.2 vrf vrf2
 !
 peer 10.126.0.2 vrf vrf3
 !
 peer 10.126.0.2
 !
 peer 10.126.0.2 vrf vrf4
 !
 peer 2.2.2.2 multihop local-address 1.1.1.1
 !
 peer 2.2.2.2 multihop local-address 1.1.1.1 vrf vrf2
  transmit-interval 1500
  receive-interval 1500
 !

The results showed no issue related to packets received by
the wrong vrf. Even changing the udp_l3mdev_accept flag to
1 did not change the test results.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-07-19 21:35:23 +02:00
lynnemorrison
5609e9d791 BFDD: Cleanup warning
Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
2022-07-19 15:23:50 -04:00
Donald Sharp
a145324acf
Merge pull request #11644 from AbhishekNR/clear_cmd_interface
pim6d: Implementing "clear ipv6 pim interfaces" command.
2022-07-19 14:16:41 -04:00
Donald Sharp
a6de2db239
Merge pull request #11646 from opensourcerouting/fix/memory_show
bgpd: Show extended communities memory consumption
2022-07-19 14:13:17 -04:00
Donald Sharp
e05506b8dd zebra: Add some more data to rtadv socket failures
The creation of the rtadv socket can fail but there
is very very little data associated with this event
to let the operator know something has gone terribly
wrong.

Please note if this socket fails to create or fails
the setsockopt's rtadv is basically just really really
messed up.  I am not sure what can be done here.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-19 13:57:56 -04:00
Donald Sharp
04fd828f3f bgpd: rfapi code does not need to assert on memory allocations
cleanup memory allocations asserting that it didn't fail
as well as clean up some thread shenanigans.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-19 13:54:10 -04:00
Donald Sharp
3f22218b48 bgpd: Prevent memory leak of listener on shutdown
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-19 13:54:10 -04:00
Donald Sharp
a0d46bcd08 lib: thread pointer is already null at this point
in agentx_events_update the timeout_thr is canceled
on line 88 just above.  This already sets the pointer
to NULL.  No need to do this again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-19 13:54:10 -04:00
Donald Sharp
6ceca15dd1 tests: Make bgp_snmp_mplsl3vpn be more forgiving
I rarely get this failure:
@classname: bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn
@name: test_pe1_converge_evpn
@time: 44.875
@message: AssertionError: BGP SNMP does not seem to be running
assert False
 +  where False = <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>>('bgpVersion', '10')
 +    where <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>> = <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>.test_oid
        "Wait for protocol convergence"
        tgen = get_topogen()

        r1 = tgen.gears["r1"]
        r1_snmp = SnmpTester(r1, "10.1.1.1", "public", "2c")

        assertmsg = "BGP SNMP does not seem to be running"
>       assert r1_snmp.test_oid("bgpVersion", "10"), assertmsg
E       AssertionError: BGP SNMP does not seem to be running
E       assert False
E        +  where False = <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>>('bgpVersion', '10')
E        +    where <bound method SnmpTester.test_oid of <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>> = <lib.snmptest.SnmpTester object at 0x7fa8562eb4f0>.test_oid

Under heavy system load a quick test before BGP can fully come up can result in a failed
test.  Add some extra time for snmp to come up properly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-07-19 13:54:10 -04:00
alireza
cd899c6a6f doc: Remove extra "in" from document
On line 16 of this file following sentence has a typo.
> * once done, the updated copy is swapped in in a single

Remove unused "in" from document.

Signed-off-by: alireza <alirezaarzehgar82@gmail.com>
2022-07-19 22:12:14 +04:30
Weiguo Li
47714bd21d bgpd: Fixup some MAC address token cli syntax
MAC address token YY:YY:YY:YY:YY:YY is deprecated, use X:X:X:X:X:X instead.

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
2022-07-20 00:29:38 +08:00
Donald Sharp
a741212913
Merge pull request #11637 from opensourcerouting/fix/remaining_sec_for_null
*: thread_timer_remain_second NULL handling
2022-07-19 12:07:02 -04:00
Russ White
b40a74fc2d
Merge pull request #11613 from anlancs/fix/minor-6
zebra: correctly display one debug flag about ES Peer
2022-07-19 11:16:54 -04:00
ARShreenidhi
27d78d31e7 tests: bgp default orignate behaviour on network commands
test script covers
1. Default originate behaviour using  'network <x.x.x.x>' command
2. Default originate behaviour using aggregate summary command

Signed-off-by: ARShreenidhi <rshreenidhi@vmware.com>
2022-07-19 13:25:13 +00:00
Abhishek N R
23db4cbd3d pim6d: Implementing "clear ipv6 pim interfaces" command.
Signed-off-by: Abhishek N R <abnr@vmware.com>
2022-07-19 05:48:52 -07:00
Russ White
96575121cf
Merge pull request #11611 from fdumontet6WIND/FMJA/desc_mess
bgp:change in showing neighbor description
2022-07-19 08:38:53 -04:00
Donatas Abraitis
145f7619aa bgpd: Show extended communities memory consumption
Just fix the description because it's wrong.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-19 14:06:17 +03:00
Donald Sharp
9d56c39aee
Merge pull request #11632 from opensourcerouting/fix/address_family_bgp_str
bgpd: Add constants for some repetitive CLI strings
2022-07-18 14:26:42 -04:00
Donatas Abraitis
c1f8c2172e
Merge pull request #11633 from mobash-rasool/fixes3
pim6d: clear interface stats on interface shutdown
2022-07-18 21:20:27 +03:00
Jafar Al-Gharaibeh
13d7231039
Merge pull request #11635 from opensourcerouting/fix/memory_leak_for_mpls
zebra: Cleanup the memory from the hash for MPLS stuff
2022-07-18 12:42:36 -05:00
Donatas Abraitis
1f37d8c2d3 bgpd, ldpd: No need for an explicit NULL check for thread_timer_remain_second
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-07-18 16:44:06 +03:00