Commit Graph

30807 Commits

Author SHA1 Message Date
Donatas Abraitis
2247bec839
Merge pull request #12883 from FRRouting/mergify/bp/dev/8.5/pr-12878
pimd: bughunting improvements (backport #12878)
2023-02-24 11:40:13 +02:00
Christian Hopps
ffbea18bb3
Merge pull request #12886 from FRRouting/mergify/bp/dev/8.5/pr-12876
bgpd: Align `show bgp ...` output with the header for wide option (backport #12876)
2023-02-24 02:51:57 -05:00
Donatas Abraitis
76c1f1c4ee bgpd: Align show bgp ... output with the header for wide option
Before:

```
r1# sh ip bgp wide
BGP table version is 1, local router ID is 192.168.2.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

   Network                                      Next Hop                                  Metric LocPrf Weight Path
 *  172.16.255.254/32                            192.168.2.2                                    0             0 (65003) i
 *>                                              192.168.1.2                                    0             0 (65002) i

Displayed  1 routes and 2 total paths
r1#
```

After:

```
r1# sh ip bgp wide
BGP table version is 1, local router ID is 192.168.2.1, vrf id 0
Default local pref 100, local AS 65001
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network                                      Next Hop                                  Metric LocPrf Weight Path
 *  172.16.255.254/32                            192.168.2.2                                    0             0 (65003) i
 *>                                              192.168.1.2                                    0             0 (65002) i

Displayed  1 routes and 2 total paths
r1#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit fccd7e53db)
2023-02-23 20:48:55 +00:00
David Lamparter
94c2ec42c4 pimd: try to reinstall MFC when we get NOCACHE
Whether due to a pimd bug, some expiry, or someone just deleting MFC
entries, when we're in NOCACHE we *know* there's no MFC entry.  Add an
install call to make sure pimd's MFC view aligns with the actual kernel
MFC.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-23 20:49:22 +01:00
David Lamparter
48477d5802 pimd: make logs useful for input drops
This path here is pretty far on top of the list of issues that operators
will run into and have to debug when setting up PIM.  Make the log
messages actually tell what's going on.  Also escalate some from
`debug mroute detail` to `debug mroute`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-23 20:49:22 +01:00
Jafar Al-Gharaibeh
14b045053f
Merge pull request #12877 from FRRouting/mergify/bp/dev/8.5/pr-12869
bgpd: Give better debug message when configuration is being read in (backport #12869)
2023-02-22 22:50:23 -06:00
Jafar Al-Gharaibeh
a5ec14cdef
Merge pull request #12875 from FRRouting/mergify/bp/dev/8.5/pr-12865
bgpd: free rfapi callback object always (backport #12865)
2023-02-22 22:49:56 -06:00
Donatas Abraitis
02f10c3ee7
Merge pull request #12873 from FRRouting/mergify/bp/dev/8.5/pr-12861
bgpd: Confederation fixes with remote-as external/internal (backport #12861)
2023-02-22 22:55:17 +02:00
Donald Sharp
2b9d03a797 bgpd: Give better debug message when configuration is being read in
Sometimes bgp connections can be rejected for a variety of reasons.  Give
a bit more context about what is going wrong so that the operator can
make better decisions about their network.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7c5062fb27)
2023-02-22 20:30:47 +00:00
Donatas Abraitis
edf9bec2d1
Merge pull request #12871 from FRRouting/mergify/bp/dev/8.5/pr-12850
ospfd client api bugfix and refinements (backport #12850)
2023-02-22 22:28:18 +02:00
Mark Stapp
5d05de671f bgpd: free rfapi callback object always
An rfapi timer callback is responsible for the memory in a
context object, even in special-case exit paths. Always
free that object.

Signed-off-by: Mark Stapp <mjs@labn.net>
(cherry picked from commit 870d3d2cb8)
2023-02-22 19:50:29 +00:00
Donatas Abraitis
55189a8d91 tests: Check if BGP confederation works with AS_EXTERNAL (!AS_SPECIFIED)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit caf65e4a27)
2023-02-22 17:25:36 +00:00
Donatas Abraitis
ef6f76144b bgpd: Pass global ASN for confederation peers if not AS_SPECIFIED
When we specify remote-as as external/internal, we need to set local_as to
bgp->as, instead of bgp->confed_id. Before this patch, (bgp->as != *as) is
always valid for such a case because *as is always 0.

Also, append peer->local_as as CONFED_SEQ to avoid other side withdrawing
the routes due to confederation own AS received and/or malformed as-path.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit db5a5ee6e4)
2023-02-22 17:25:35 +00:00
Christian Hopps
1869d3ab6e tests: improve the ospfapi test (move to square topology)
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 663a0c96d9)
2023-02-22 16:55:12 +00:00
Christian Hopps
49d5d11c3e ospfclient: remove register "READY" requirement
- also add ability of the apibin to process commands on stdin

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 6efa8fd5c1)
2023-02-22 16:55:12 +00:00
Christian Hopps
8d81aeaf19 ospfclient: bugfix and no implicit register
- dont delete the callback on opaque data delete
- require explicit registration

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 703d2c0a3e)
2023-02-22 16:55:11 +00:00
Christian Hopps
2b2061e274 ospfd: compare prefix values in host order
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 156a904cae)
2023-02-22 16:55:11 +00:00
Christian Hopps
5a51609d84 ospfd: small bugfix for miscounting A[S]BRs
- improve the debug for the second add router call.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 1eea62bb1c)
2023-02-22 16:55:11 +00:00
Christian Hopps
7f8f9aaee6 ospfd: inc. opaque data in show opaque info detail json output
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 1794afe010)
2023-02-22 16:55:10 +00:00
Donatas Abraitis
a640b4a390
Merge pull request #12856 from FRRouting/mergify/bp/dev/8.5/pr-12795
Vpnv6 nexthop encoding (backport #12795)
2023-02-22 10:57:40 +02:00
Donatas Abraitis
ff4d2ac569
Merge pull request #12859 from FRRouting/mergify/bp/dev/8.5/pr-12818
zebra: Fix other table inactive when ip import-table is on (backport #12818)
2023-02-21 21:18:04 +02:00
zyxwvu Shi
682a1fea98 zebra: Fix other table inactive when ip import-table is on
In `rib_link`, if is_zebra_import_table_enabled returns
true, `rib_queue_add` will not called, resulting in other
table route node never processed. This actually should not
be dependent on whether the route is imported.

In `rib_delnode`, if is_zebra_import_table_enabled returns
true, it will use `rib_unlink` instead of enqueuing the
route node for process. There is no reason that imported
route nodes should not be reprocessed. Long ago, the
behaviour was dependent on whether the route_entry comes
from a table other than main.

Signed-off-by: zyxwvu Shi <i@shiyc.cn>
(cherry picked from commit 207207c0c0)
2023-02-21 16:38:22 +00:00
Philippe Guibert
fd5dcbacfa bgpd: clarify when the vpnv6 nexthop length must be modified
Using a route-map to update the local ipv6 address has to be
better clarified. Actually, when a VPN SAFI is used, the nexthop
length must be changed to 48 bytes. Other cases, the length will
be 32 bytes.

Fixes: 9795e9f234 ("bgpd: fix when route-map changes the link local
nexthop for vpnv6")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 5bbcc78202)
2023-02-21 13:16:28 +00:00
Philippe Guibert
bea6f612ae bgpd: factorise ipv6 vpn nexthop encoding
Because mp_nexthop_len attribute value stands for the length
to encode in the stream, simplify the way the nexthop is
forged.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 558e8f5801)
2023-02-21 13:16:28 +00:00
Donatas Abraitis
6deccd5995
Merge pull request #12826 from FRRouting/mergify/bp/dev/8.5/pr-12817
some missed upstream commits (backport #12817)
2023-02-17 14:27:56 +02:00
Igor Ryzhov
6af8095c42
Merge pull request #12828 from FRRouting/mergify/bp/dev/8.5/pr-12734
lib: Fix non-use of option (backport #12734)
2023-02-17 12:10:18 +02:00
Donald Sharp
6df8da715b lib: Fix non-use of option
Commit d7c6467ba2 added the
ability to specify non pretty printing but unfortunately
forgot to use the option variable to make the whole
thing work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 00b0bb99ae)
2023-02-16 20:07:41 +00:00
vivek
6e755acdd7 zebra: Add debug for bridge capability
Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>

Ticket: #2609944
(cherry picked from commit f88889ba7a)
2023-02-16 19:46:39 +00:00
vivek
e4186fe3c9 bgpd: Prevent multipathing among EVPN and non-EVPN paths
Ensure that a multipath set is fully comprised of EVPN paths (i.e.,
paths imported into the VRF from EVPN address-family) or non-EVPN
paths. This is actually a condition that existed already in the code
but was not properly enforced.

This change, as a side effect, eliminates the known trigger condition
for bad or missing RMAC programming in an EVPN deployment, described
in tickets CM-29043 and CM-31222. Routes (actually, paths) in a VRF
routing table that require VXLAN tunneling to the next hop currently
need some special handling in zebra to deal with the nexthop (neigh)
and RMAC programming, and this is implemented for the entire route
(prefix), not per-path. This can lead to the bad or missing RMAC
situation, which is now eliminated by ensuring all paths in the route
are 'similar'.

The longer-term solution in CL 5.x will be to deal with the special
programming by means of explicit communication between bgpd and zebra.
This is already implemented for EVPN-MH via CM-31398. These changes
will be extended to non-MH also and the special code in zebra removed
or refined.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
Acked-by:      Trey Aspelund <taspelund@nvidia.com>
Acked-by:      Anuradha Karuppiah <anuradhak@nvidia.com>
Acked-by:      Chirag Shah <chirag@nvidia.com>

Ticket: CM-29043
Testing Done:
1. Manual testing
2. precommit on both MLX and BCM platforms
3. evpn-smoke - BCM and VX

Results described in the ticket

(cherry picked from commit d2d71b042e)
2023-02-16 19:46:38 +00:00
vivek
6e04956aed bgpd: Fix deterministic-med check for stale paths
When performing deterministic MED processing, ensure that the peer
status is not checked when we encounter a stale path. Otherwise, this
path will be skipped from the DMED consideration leading to it potentially
not being installed.

Test scenario: Consider a prefix with 2 (multi)paths. The peer that
announces the path with the winning DMED undergoes a graceful-restart.
Before it comes back up, the other path goes away. Prior to the fix, a
third router that receives both these paths would have ended up not
having any path installed to the prefix after the above events.

Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>

For internal use:
Ticket: CM-32032
Testing done: Multiple manual testing

(cherry picked from commit de692a4ebe)
2023-02-16 19:46:38 +00:00
Donald Sharp
68c8001d41
Merge pull request #12803 from FRRouting/mergify/bp/dev/8.5/pr-12790
vrrpd: give null when using null ifp to lookup vr (backport #12790)
2023-02-14 15:19:28 -05:00
Quentin Young
ae830bc355 vrrpd: give null when using null ifp to lookup vr
This is still causing crashes somehow.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
(cherry picked from commit ed331629de)
2023-02-14 14:30:22 +00:00
Jafar Al-Gharaibeh
a5ee9bf40c
Merge pull request #12788 from FRRouting/mergify/bp/dev/8.5/pr-12776
pim6d: Modify "show ipv6 mld join json" o/p (backport #12776)
2023-02-10 10:59:19 -06:00
Sarita Patra
f6e48df868 pim6d: Modify "show ipv6 mld join json" o/p
Currently "show ipv6 mld join json" o/p is
frr# show ipv6 mld joins json
{
  "default":{
    "ens192":{
      "ff02:2":{
        "::":{
          "state":"JOIN",
          "created":"00:01:50.595",
          "lastSeen":"00:00:38.403",
        }
      }
    }
  }
}

Here, I modified the o/p as below for better understanding.
frr# show ipv6 mld joins json
{
  "default":{
    "vrf":"default",
    "ens192":{
      "ff02::2":{
        "*":{
          "state":"JOIN",
          "created":"00:00:42.766",
          "lastSeen":"00:00:05.266"
        }
      }
    }
  }
}

Issue: #12755

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 58971e1574)
2023-02-10 13:08:16 +00:00
Donatas Abraitis
badd2b2647
Merge pull request #12784 from FRRouting/mergify/bp/dev/8.5/pr-12781
lib: Release memory of YANG translation module on error (backport #12781)
2023-02-10 10:41:11 +02:00
Donatas Abraitis
6ba732890d
Merge pull request #12786 from FRRouting/mergify/bp/dev/8.5/pr-12782
bgpd: Intern default-originate attributes to avoid use-after-free (backport #12782)
2023-02-10 06:42:06 +02:00
Donatas Abraitis
350fdbe2fb tests: Check if BGP default-originate withdraw works correctly
And also do not crash when we do `clear ip bgp ...`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 35b7ce08a8)
2023-02-10 00:26:28 +00:00
Donatas Abraitis
474555e15c bgpd: Intern default-originate attributes to avoid use-after-free
When we receive a default route from a peer and we originate default route
using `neighbor default-originate`, we do not track of struct attr we use,
and when we do `no neighbor default-originate` we withdraw our generated
default route, but we announce default-route from the peer.

After we do this, we unintern aspath (which was used for default-originate),
BUT it was used also for peer's default route we received.

And here we have a use-after-free crash, because bgp_process_main_one()
reaps old paths that are marked as BGP_PATH_REMOVED with aspath->refcnt > 0,
but here it's 0.

```
0 0x55c24bbcd022 in aspath_key_make bgpd/bgp_aspath.c:2070
1 0x55c24b8f1140 in attrhash_key_make bgpd/bgp_attr.c:777
2 0x7f52322e66c9 in hash_release lib/hash.c:220
3 0x55c24b8f6017 in bgp_attr_unintern bgpd/bgp_attr.c:1271
4 0x55c24ba0acaa in bgp_path_info_free_with_caller bgpd/bgp_route.c:283
5 0x55c24ba0a7de in bgp_path_info_unlock bgpd/bgp_route.c:309
6 0x55c24ba0af6d in bgp_path_info_reap bgpd/bgp_route.c:426
7 0x55c24ba17b9a in bgp_process_main_one bgpd/bgp_route.c:3333
8 0x55c24ba18a1d in bgp_process_wq bgpd/bgp_route.c:3425
9 0x7f52323c2cd5 in work_queue_run lib/workqueue.c:282
10 0x7f52323aab92 in thread_call lib/thread.c:2006
11 0x7f5232300dc7 in frr_run lib/libfrr.c:1198
12 0x55c24b8ea792 in main bgpd/bgp_main.c:520
13 0x7f5231c3a082 in __libc_start_main ../csu/libc-start.c:308
14 0x55c24b8ef0bd in _start (/usr/lib/frr/bgpd+0x2c90bd)
    ```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e9340ff429)
2023-02-10 00:26:28 +00:00
Donatas Abraitis
14f5d3478f lib: Free dnode before returning if YANG translator model is already loaded
Seems just a missed one because at `goto error` we release dnode.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ecf82aa41e)
2023-02-10 00:26:00 +00:00
Donatas Abraitis
21f0622727 lib: Release memory of YANG translation module on error
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b9941b3fec)
2023-02-10 00:25:59 +00:00
Donatas Abraitis
818d7301b0
Merge pull request #12778 from FRRouting/mergify/bp/dev/8.5/pr-12773
pbrd: fix large tableids displayed as negative (backport #12773)
2023-02-09 15:19:28 +02:00
Wesley Coakley
504dff06ea pbrd: fix large tableids displayed as negative
Ticket: 2699411
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
(cherry picked from commit 8dc2001c91)
2023-02-09 10:48:36 +00:00
Donatas Abraitis
a769fe4b29
Merge pull request #12770 from FRRouting/mergify/bp/dev/8.5/pr-12768
tests: do not use exclude grep (backport #12768)
2023-02-09 09:47:20 +02:00
Donald Sharp
b2b7efda8f
Merge pull request #12771 from FRRouting/mergify/bp/dev/8.5/pr-12769
tools: Fix missing pbrd in rsyslog.d 45-frr.conf file (backport #12769)
2023-02-08 20:15:49 -05:00
Donald Sharp
28ce07f909 tools: Fix missing pbrd in rsyslog.d 45-frr.conf file
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7386031781)
2023-02-08 20:41:16 +00:00
Louis Scalbert
ac6bb62c99 tests: do not use exclude grep
Filter out keys in JSON output with "grep -v" does not work when JSON
does not use the pretty format.

Use native python code to filter out keys.

Fixes: 6c13bd5744 ("topotests: fix bgp_vpnv4_noretain")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit a8d6faa986)
2023-02-08 19:54:01 +00:00
Donatas Abraitis
fb2c52d15d
Merge pull request #12765 from FRRouting/mergify/bp/dev/8.5/pr-12761
bgpd: fix use-after-free crash for evpn (backport #12761)
2023-02-08 13:54:29 +02:00
anlan_cs
b3b3a910a6 bgpd: fix use-after-free crash for evpn
```
anlan(config-router-af)# vni 33
anlan(config-router-af-vni)# route-target both 44:55
anlan(config-router-af-vni)# no route-target both 44:55
vtysh: error reading from bgpd: Resource temporarily unavailable (11)Warning: closing connection to bgpd because of an I/O error!
```

When `bgp_evpn_vni_rt_cmd` deals with "both" type, it wrongly created
only one node ( should be two nodes ) for lists of both `vpn->import_rtl` and
`vpn->export_rtl`.  At this time, the two lists are already wrong.

In `no route-target both RT`, it will free the single node from lists of both
`vpn->import_rtl` and `vpn->export_rtl`.  After freed from `vpn->import_rtl`,
it is "use-after-free" at the time of freeing it from `vpn->export_rtl`.
It causes crash sometimes, or other unexpected behaviours.

This issue is introduced by commit `3b7e8d`, which have adjusted both
`bgp_evpn_vni_rt_cmd` and `bgp_evpn_vrf_rt_cmd`.

Since `bgp_evpn_vrf_rt_cmd/no_bgp_evpn_vrf_rt_cmd` works well again
unintentionally with commit `7022da`, only `bgp_evpn_vni_rt_cmd` needs to
modify - add two nodes for "both" type and some explicit comments for this
special case of "both" type.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit 432ff4b036)
2023-02-08 08:07:50 +00:00
Jafar Al-Gharaibeh
2285f5aca8
Merge pull request #12722 from opensourcerouting/vim-xref
tools: add `GotoXref` vim script
2023-02-07 10:43:27 -06:00
Jafar Al-Gharaibeh
6e1ae0137d
Merge pull request #12715 from opensourcerouting/fix/contribution_guid_squash_random_commits
Commits hygiene
2023-02-07 10:42:53 -06:00