Commit Graph

29152 Commits

Author SHA1 Message Date
Donald Sharp
6bd7478989
Merge pull request #10857 from ton31337/fix/bmp_stats_crash
bgpd: Turn off thread when running `no bmp targets X`
2022-03-24 20:17:58 -04:00
Donald Sharp
0081ab91e6 zebra: When handling unprocessed messages from kernel print usable string
Add new debug output to show the string of the message type that
is currently unhandled:

2022-03-24 18:30:15.284 [DEBG] zebra: [V3NSB-BPKBD] Kernel:
2022-03-24 18:30:15.284 [DEBG] zebra: [HDTM1-ENZNM] Kernel: message seq 792
2022-03-24 18:30:15.284 [DEBG] zebra: [MJD4M-0AAAR] Kernel: pid 594488, rtm_addrs {DST,GENMASK}
2022-03-24 18:30:15.285 [DEBG] zebra: [GRDRZ-0N92S] Unprocessed RTM_type: RTM_NEWMADDR(d)

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-24 20:07:00 -04:00
Donald Sharp
b4c94f8c4d lib: Fix terminal monitor uninited memory usage on freebsd
When `terminal monitor` is issued I am seeing this for valgrind on freebsd:

2022/03/24 18:07:45 ZEBRA: [RHJDG-5FNSK][EC 100663304] can't open configuration file [/usr/local/etc/frr/zebra.conf]
==52993== Syscall param sendmsg(sendmsg.msg_control) points to uninitialised byte(s)
==52993==    at 0x4CE268A: _sendmsg (in /lib/libc.so.7)
==52993==    by 0x4B96245: ??? (in /lib/libthr.so.3)
==52993==    by 0x4CDF329: sendmsg (in /lib/libc.so.7)
==52993==    by 0x49A9994: vtysh_do_pass_fd (vty.c:2041)
==52993==    by 0x49A9994: vtysh_flush (vty.c:2070)
==52993==    by 0x499F4CE: thread_call (thread.c:2002)
==52993==    by 0x495D317: frr_run (libfrr.c:1196)
==52993==    by 0x2B4068: main (main.c:471)
==52993==  Address 0x7fc000864 is on thread 1's stack
==52993==  in frame #3, created by vtysh_flush (vty.c:2065)

Fix by initializing the memory to `0`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-24 18:08:29 -04:00
Donald Sharp
ceacdc7216 zebra: Don't send uninited data to kernel on FreeBSD
When running zebra w/ valgrind, it was noticed that there
was a bunch of passing uninitialized data to the kernel:

==38194== Syscall param ioctl(generic) points to uninitialised byte(s)
==38194==    at 0x4CDF88A: ioctl (in /lib/libc.so.7)
==38194==    by 0x49A4031: vrf_ioctl (vrf.c:860)
==38194==    by 0x2AFE29: vrf_if_ioctl (ioctl.c:91)
==38194==    by 0x2AFF39: if_get_mtu (ioctl.c:161)
==38194==    by 0x2B12C3: ifm_read (kernel_socket.c:653)
==38194==    by 0x2A7F76: interface_list (if_sysctl.c:129)
==38194==    by 0x2E9958: zebra_ns_enable (zebra_ns.c:127)
==38194==    by 0x2E9958: zebra_ns_init (zebra_ns.c:214)
==38194==    by 0x2B3F82: main (main.c:401)
==38194==  Address 0x7fc000967 is on thread 1's stack
==38194==  in frame #3, created by if_get_mtu (ioctl.c:155)
==38194==
==38194== Syscall param ioctl(generic) points to uninitialised byte(s)
==38194==    at 0x4CDF88A: ioctl (in /lib/libc.so.7)
==38194==    by 0x49A4031: vrf_ioctl (vrf.c:860)
==38194==    by 0x2AFE29: vrf_if_ioctl (ioctl.c:91)
==38194==    by 0x2AFED9: if_get_metric (ioctl.c:143)
==38194==    by 0x2B12CB: ifm_read (kernel_socket.c:655)
==38194==    by 0x2A7F76: interface_list (if_sysctl.c:129)
==38194==    by 0x2E9958: zebra_ns_enable (zebra_ns.c:127)
==38194==    by 0x2E9958: zebra_ns_init (zebra_ns.c:214)
==38194==    by 0x2B3F82: main (main.c:401)
==38194==  Address 0x7fc000967 is on thread 1's stack
==38194==  in frame #3, created by if_get_metric (ioctl.c:137)
==38194==
==38194== Syscall param ioctl(generic) points to uninitialised byte(s)
==38194==    at 0x4CDF88A: ioctl (in /lib/libc.so.7)
==38194==    by 0x49A4031: vrf_ioctl (vrf.c:860)
==38194==    by 0x2AFE29: vrf_if_ioctl (ioctl.c:91)
==38194==    by 0x2B052D: if_get_flags (ioctl.c:419)
==38194==    by 0x2B1CF1: ifam_read (kernel_socket.c:930)
==38194==    by 0x2A7F57: interface_list (if_sysctl.c:132)
==38194==    by 0x2E9958: zebra_ns_enable (zebra_ns.c:127)
==38194==    by 0x2E9958: zebra_ns_init (zebra_ns.c:214)
==38194==    by 0x2B3F82: main (main.c:401)
==38194==  Address 0x7fc000707 is on thread 1's stack
==38194==  in frame #3, created by if_get_flags (ioctl.c:411)

Valgrind is no longer reporting these issues.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-24 12:57:01 -04:00
anlan_cs
b83d220aa9 zebra: optimization on the mac addition for evpn-mh
When `zebra_evpn_mac_svi_add()` adds one found mac by
`zebra_evpn_mac_lookup()` and the found mac is without
svi flag, then call `zebra_evpn_mac_svi_add()` to create
one appropriate mac, but it will call `zebra_evpn_mac_lookup()`
the second time. So lookup twice, the procedure is redundant.

Just an optimization for it, make sure only lookup once.

Modify `zebra_evpn_mac_gw_macip_add()` to check the `macp`
parameter passed by caller, so it can distinguish whether
really need lookup or not.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-24 22:31:50 +08:00
Mark Stapp
113f966512
Merge pull request #10859 from opensourcerouting/fix/link_to_participate
doc: Fix the link that points to Slack invitation in README
2022-03-24 10:13:48 -04:00
Donatas Abraitis
3989029bc0 tools: Replace strings to tr for frrinit.sh
dc3bae68a2 added strings command, which is wrong.

It requires additional package to be installed on the system (binutils).

Let's just get use `tr`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-24 15:26:26 +02:00
David Lamparter
c8d30f4f9e pim6d: fix remaining IPv6 mroute nits
- im6_src/dst are in6_addr, not pim_addr, so `%pI6` should be used
- the sockopt is IPV6_RECVPKTINFO not IPV6_PKTINFO

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-03-24 12:32:30 +01:00
Donatas Abraitis
bd44214e74 doc: Fix the link that points to Slack invitation in README
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-24 13:13:37 +02:00
Donatas Abraitis
4008aa1a24 bgpd: Turn off thread when running no bmp targets X
Avoid use-after-free and prevent from crashing:

```
(gdb) bt
0  raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:50
1  0x00007f2a15c2c30d in core_handler (signo=11, siginfo=0x7fffb915e630, context=<optimized out>) at lib/sigevent.c:261
2  <signal handler called>
3  0x00007f2a156201e4 in bmp_stats (thread=<optimized out>) at bgpd/bgp_bmp.c:1330
4  0x00007f2a15c3d553 in thread_call (thread=thread@entry=0x7fffb915ebf0) at lib/thread.c:2001
5  0x00007f2a15bfa570 in frr_run (master=0x55c43a393ae0) at lib/libfrr.c:1196
6  0x000055c43930627c in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:519
(gdb)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-24 12:02:02 +02:00
Donatas Abraitis
511935cfa4
Merge pull request #10843 from pguibert6WIND/isis_extreme_debug
isisd: add guard debug when compiling with EXTREME_DEBUG
2022-03-24 08:59:21 +02:00
Igor Ryzhov
d270ab31a3
Merge pull request #10854 from pguibert6WIND/order_nai_ipv6
pathd: bad order of nai adjacencies for ipv6
2022-03-24 01:42:10 +03:00
Philippe Guibert
b081493527 isisd: add guard debug when compiling with EXTREME_DEBUG
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-03-23 22:29:14 +01:00
Jafar Al-Gharaibeh
627fa28a42
Merge pull request #10851 from mobash-rasool/fixes2
tests: Add the show database for ospfv3 before checking for ospf route
2022-03-23 13:44:08 -05:00
Jafar Al-Gharaibeh
c4cb7b1172
Merge pull request #10844 from mobash-rasool/fixes
pimd: correct prefix-list ssm range update for exclude mode
2022-03-23 12:17:27 -05:00
Philippe Guibert
a38d5b7af2 pathd: bad order of nai adjacencies for ipv6
The order of nai adjacencies ipv6 addresses was wrong.
The src and the destination addresses were swapped.
Change it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-03-23 17:04:55 +01:00
plsaranya
a5fa982256 pim6d: Mroute changes
Mroute and supporting changes

Signed-off-by: plsaranya <Saranya_Panjarathina@dell.com>
2022-03-23 19:34:28 +05:30
Mark Stapp
f0368a3e43 build: remove generated lib files during distclean
Remove a couple of lex/yacc output files in lib/
during 'distclean'.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-03-23 09:03:14 -04:00
Mobashshera Rasool
3649d8f86c tests: Add the show database for ospfv3 before checking for ospf route
Moved the database dump for ospfv3 before ospf route check.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-23 04:08:14 -07:00
anlan_cs
573eeb2bfb bgpd: remove unnecessary checkings for bgp_evpn_es_new()
Currently, `bgp_evpn_es_new()` always has an invald `struct bgp` pointer as
its input parameter, and it will always return valid `es`.

So two cleanup changes:
- Remove unnecessary checking for `bgp` in `bgp_evpn_es_new()`
- Remove unnecessary checkings of `bgp_evpn_es_new()`'s callers.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-23 04:15:28 -04:00
Sri Mohana Singamsetty
116f0dd905
Merge pull request #10726 from chiragshah6/fdev2
zebra: evpn revamp l3vni routermac db
2022-03-22 22:05:47 -07:00
Donatas Abraitis
a7d91a8c79 bgpd: Print hostname along with IP for most useful debug messages
Examples:

```
%ADJCHANGE: neighbor 192.168.0.1(exit1-debian-11) in vrf default Up
192.168.0.1(exit1-debian-11) graceful restart stalepath timer expired
192.168.0.1(exit1-debian-11) sending route-refresh (BoRR) for IPv4/unicast
192.168.0.1(exit1-debian-11) graceful restart timer started for 120 sec
192.168.0.1(exit1-debian-11) graceful restart stalepath timer started for 120 sec
192.168.0.1(exit1-debian-11) graceful restart timer stopped
%MAXPFXEXCEED: No. of IPv4 Unicast prefix received from 192.168.0.1(exit1-debian-11) 9 exceed, limit 1
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-22 21:59:58 +02:00
Mobashshera Rasool
6d0a6ede82 pimd: correct prefix-list ssm range update for exclude mode
Modifying the code as per RFC 4604 section 2.2.1
EXCLUDE mode does not apply to SSM addresses, and an SSM-aware router
will ignore MODE_IS_EXCLUDE and CHANGE_TO_EXCLUDE_MODE requests in
the SSM range.

Issue is observed when a group in exclude mode was in ASM range
as per the prefix-list and then prefix-list is modified to make
it fall under SSM range. The (*,G) entry remains there.

So when the group moves to ssm range and it is exclude mode,
delete the group from the IGMP table.

Co-authored-by: Vishal Dhingra <rac.vishaldhingra@gmail.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-03-22 11:05:54 -07:00
Sri Mohana Singamsetty
2d07728e79
Merge pull request #10842 from anlancs/bgpd-cleanup-1
bgpd: remove unnecessary checkings for the returned value
2022-03-22 06:30:15 -07:00
anlan_cs
49540e50a3 bgpd: remove unnecessary checkings for the returned value
Since the returned value MUST be valid, remove unnecessary checkings.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-22 05:27:19 -04:00
Donatas Abraitis
aa24a36a2d bgpd: Add BGP configuration start/end markers
Delay BGP configuration until we receive end-configuration hook to make sure
we don't send partial updates to peer which leads to broken Graceful-Restart.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-22 09:04:46 +02:00
Donatas Abraitis
fd5dbc8e48
Merge pull request #8803 from kuldeepkash/dynamic_route_leak2
tests: Adding new tests to bgp_vrf_dynamic_route_leak suite
2022-03-22 08:58:02 +02:00
Jafar Al-Gharaibeh
a51061fa50
Merge pull request #10814 from manojvn/2896483
ospf6d: observed crash in ospf6_decrement_retrans_count.
2022-03-21 22:45:01 -05:00
Jafar Al-Gharaibeh
f577fdc4e8
Merge pull request #10809 from donaldsharp/pim_igmp_query
Pim igmp query
2022-03-21 22:37:26 -05:00
Donatas Abraitis
1c18b0d672 ospfd: Use consistent JSON keys for show ip ospf neighbor and detail version
At the moment it's inconsistent, and very annoying. Let's just fix this, and
add a deprecation period to remove them after that.

```
vr_ib# show ip ospf neighbor json
{
  "neighbors":{
    "192.10.120.2":[
      {
        "priority":1,
        "state":"Full\/DROther",
        "deadTimeMsecs":36543,
        "address":"192.10.120.2",
        "ifaceName":"VLINK0",
        "retransmitCounter":0,
        "requestCounter":0,
        "dbSummaryCounter":0
      },
```

```
vr_ib# show ip ospf neighbor detail json
{
  "neighbors":{
    "192.10.120.2":[
      {
        "ifaceAddress":"192.10.120.2",
        "areaId":"0.0.0.0",
        "ifaceName":"VLINK0",
        "nbrPriority":1,
        "nbrState":"Full",
        "stateChangeCounter":5,
        "lastPrgrsvChangeMsec":53367612,
        "routerDesignatedId":"0.0.0.0",
        "routerDesignatedBackupId":"0.0.0.0",
        "optionsCounter":66,
        "optionsList":"*|O|-|-|-|-|E|-",
        "routerDeadIntervalTimerDueMsec":33126,
        "databaseSummaryListCounter":0,
        "linkStateRequestListCounter":0,
        "linkStateRetransmissionListCounter":0,
        "threadInactivityTimer":"on",
        "threadLinkStateRequestRetransmission":"on",
        "threadLinkStateUpdateRetransmission":"on",
        "grHelperStatus":"None"
      },
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-03-21 16:58:12 +02:00
Donatas Abraitis
13cd4ff4e1
Merge pull request #10815 from pguibert6WIND/pim_debug_vxlan
pimd: add 'debug pim vxlan' when 'debug pim' is used
2022-03-21 15:47:49 +02:00
Donatas Abraitis
374eefb18b
Merge pull request #10832 from patrasar/2520720
pimd: add source and group information in mroute json
2022-03-21 13:38:14 +02:00
rgirada
ab31275cf6 ospfd: Default route becomes stale route in nbrs even after flush from originator.
Description:
	Default route is not getting flushed from neighbours though originator
        triggered flush and deleted LSA from its database. It become as stale
        LSA in  neighbours databse forever. This could seen in the following
        sequence of configurations with less than a second interval b/w configs.
        And this could happen only when originator shouldnt have default route
        in its rib so it originates default route only when configure with 'always'
        option.

        step-1:default-information originate always
        step-2:no default-information originate always
        step-3:default-information originate

        In step-1, default route will be originated to AS.
        In step-2, default route will be flushed to AS, but neighbours will be
                   discarding this update due to minlsainterval condition.
                   And it is expected that DUT need to keep send this update
                   until it receives the ack from neighbours by adding each
                   neighbour's retransmission list.
        In Step-3: It is deleting the lsas from nbr's retransmission list
                   by assuming it initiated the flush. This is cuasing to not
                   send the lsa update anymore to neighbours which makes
                   stale lsa in nbrs forever.

Fix:
        Allowed to delete the lsa from retransmission list only when lsa is
        not in maxage during flushing procedure.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-03-21 02:55:29 -07:00
Donatas Abraitis
25d7130380
Merge pull request #8967 from anlancs/fix-startup-error-info
tools: suppress unuseful warnings during restarting frr
2022-03-21 09:52:52 +02:00
sarita patra
f37cbaea86 pimd: source/group information now added for pruned entry
show ip mroute json command displays the source, group info
per oil, so for pruned group since the OIL is empty, it is not
showing.

Fix: Added the above information per source.

Signed-off-by: sarita patra <saritap@vmware.com>
2022-03-20 23:43:55 -07:00
Kuldeep Kashyap
98ae5f4f35 tests: Adding bgp_vrf_dynamic_route_leak_topo4 suite
1. Added 3 test cases to veirfy bgp vrf dynamic route leak functionality
Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-03-21 07:42:35 +05:30
Kuldeep Kashyap
133fd9edbe tests: Adding bgp_vrf_dynamic_route_leak_topo3 test suite
1. Added 4 test cases to verify bgp vrf dynamic route leak functionlality

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-03-21 07:42:35 +05:30
Kuldeep Kashyap
39c661a063 tests: Framework changes to support bgp vrf dynamic route leak automation
1. Enhance framework to support bgp vrf dynamic route leak automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2022-03-21 07:42:20 +05:30
Donatas Abraitis
ecf0ea4b00
Merge pull request #9953 from donaldsharp/system_route_replace
zebra: Better handle replacing our route by a system route
2022-03-20 23:25:52 +02:00
Donatas Abraitis
2efc3acd9e
Merge pull request #9476 from SaiGomathiN/pim-nht
pimd: Added new option "detail" in the "debug pim nht" CLI
2022-03-20 23:14:08 +02:00
Russ White
e3e6510b87
Merge pull request #10820 from donaldsharp/evpn_route_frag
Evpn route frag
2022-03-20 15:49:16 -04:00
Donald Sharp
0399a608e0
Merge pull request #10830 from anlancs/zebra-rb-remove
zebra, bgpd: remove check returning value of RB_INSERT()
2022-03-20 14:32:49 -04:00
anlan_cs
928095589a bgpd: remove check returning value of RB_INSERT()
Since the `RB_INSERT()` is called after not found in RB tree, it MUST be ok and
and return zero. The check of returning value of `RB_INSERT()` is redundant,
just remove them.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-20 17:13:29 +08:00
Russ White
d5a58008dc
Merge pull request #10816 from anlancs/fix-bgdp-local-es-rt
bgpd: fix wrong check on local es routes
2022-03-19 15:04:58 -04:00
Russ White
d590d0183f
Merge pull request #10829 from donaldsharp/rtm_delete
zebra: Do not complain if deletion fails
2022-03-19 15:03:25 -04:00
Donald Sharp
f2f2a16af4 zebra: Do not complain if deletion fails
When issuing a RTM_DELETE operation and the kernel tells
us that the route is already deleted, let's not complain
about the situation:

2022/03/19 02:40:34 ZEBRA: [EC 100663303] kernel_rtm: 2a10:cc42:1d51::/48: rtm_write() unexpectedly returned -4 for command RTM_DELETE

I can recreate this issue on freebsd by doing this:
a) create a route using sharpd
b) shutdown the nexthop's interface
c) remove the route using sharpd

This would also be true of pretty much any routing protocol's behavior.
Let's just not complain about the situation if a RTM_DELETE
operation is issued and FRR is told that the route does not
exist to delete.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-03-19 07:44:54 -04:00
anlan_cs
2a778afe9d zebra: remove check returning value of RB_INSERT()
Since the `RB_INSERT()` is called after not found in RB tree, it MUST be ok and
and return zero. The check of returning value of `RB_INSERT()` is redundant,
just remove them.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-03-19 13:45:14 +08:00
Christian Hopps
3e771d60be
Merge pull request #10817 from kuldeepkash/micronet_fixes
tests: Fix topotests crash when KeyError found
2022-03-18 12:21:02 -04:00
Anuradha Karuppiah
9239606859 doc: add notes for ead-es-frag fragmentation
Config for -
1. Preventing fragmentation via user configured EAD RTs
2. Limiting the number of EVIs per-fragment if EAD fragmentation is needed

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2022-03-18 07:37:07 -04:00
Anuradha Karuppiah
bb37eabe24 bgpd: add cli for configuring the EVI limit per-ES-frag
The EAD-per-ES route can be fragmented to fit the EVIs on the switch. This
command allows the EVI limit to be configured -

!
router bgp 5556
 !
 address-family l2vpn evpn
  ead-es-frag evi-limit 200
 exit-address-family
 !
!

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
2022-03-18 07:37:07 -04:00