Commit Graph

30823 Commits

Author SHA1 Message Date
Sarita Patra
a3350c9487 pim6d: Fix missing parameters in "show ipv6 mld interface" command
Before fix:
==========
frr# show ipv6 mld interface
Interface         State  V  Querier                    Timer               Uptime
ens224            up     1  fe80::250:56ff:feb7:a7e3   query 00:00:24.219  00:00:07.031

After fix:
=========
frr(config-if)# do show ipv6 mld interface
 Interface  State  Address                   V  Querier  QuerierIp                 Query Timer   Uptime
 ens224     up     fe80::250:56ff:feb7:a7e3  1  local    fe80::250:56ff:feb7:a7e3  00:01:22.263  00:08:00.237

Issue: #11241

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit cbb1e51311)
2023-02-27 19:03:11 +00:00
Sarita Patra
43bcbda9b4 pim6d: Display primary address in "show ipv6 mld interface json" cmd
Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 3ab119a4bb)
2023-02-27 19:03:11 +00:00
Sarita Patra
aa3f3511de pim6d: Don't display MLD disabled or down interfaces in "show ipv6 mld interface" cmd
We should not display down interfaces or MLD disabled interfaces in
"show ipv6 mld interface" command.

Before fix:
==========
frr# show ipv6 mld interface
Interface         State  V  Querier                    Timer               Uptime
ens192            up     2  fe80::250:56ff:feb7:d04    query 00:00:25.432  00:00:07.038
ens224            up     1  fe80::250:56ff:feb7:a7e3   query 00:00:24.219  00:00:07.031
pim6reg            down

After fix:
=========
frr# show ipv6 mld interface
Interface         State  V  Querier                    Timer               Uptime
ens192            up     2  fe80::250:56ff:feb7:d04    query 00:00:25.432  00:00:07.038
ens224            up     1  fe80::250:56ff:feb7:a7e3   query 00:00:24.219  00:00:07.031

Issue: #11241

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit fe4db62c3d)
2023-02-27 19:03:11 +00:00
Donald Sharp
63b643d1cf
Merge pull request #12898 from FRRouting/mergify/bp/dev/8.5/pr-12888
bgpd: Flags fixes (backport #12888)
2023-02-27 13:40:06 -05:00
Donatas Abraitis
982097c360 tests: Increase flags from uint32_t to uint64_t
Missed this part when increasing in the past.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-27 16:38:49 +02:00
Donatas Abraitis
8575ad3a6a tests: Cover all enum values for unit tests
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-27 16:06:20 +02:00
Donatas Abraitis
f0b263d679
Merge pull request #12902 from FRRouting/mergify/bp/dev/8.5/pr-12900
bgpd: Avoid double aspath_dup() for confederation when remote-as != AS_SPECIFIED (backport #12900)
2023-02-26 14:22:02 +02:00
Donatas Abraitis
35b2225b90 bgpd: Avoid double aspath_dup() for confederation when remote-as != AS_SPECIFIED
Just was blind when not seing it's already dup'ed above:

```	if (peer->sort == BGP_PEER_EBGP
	    && (!CHECK_FLAG(peer->af_flags[afi][safi],
			    PEER_FLAG_AS_PATH_UNCHANGED)
		|| attr->aspath->segments == NULL)
	    && (!CHECK_FLAG(peer->af_flags[afi][safi],
			    PEER_FLAG_RSERVER_CLIENT))) {
		aspath = aspath_dup(attr->aspath); <<<<<<<<<<<<<<<
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 9930441c66)
2023-02-25 00:18:04 +00:00
Donatas Abraitis
b0d906ea15 tests: Check if peer->af_flags can be higher than uint32_t
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 5acfd822be)
2023-02-24 14:29:25 +00:00
Donatas Abraitis
c95bfed068 bgpd: Renumber peer->af_flags to be without any gaps
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 47017b846f)
2023-02-24 14:29:25 +00:00
Donatas Abraitis
f6c5c830bc bgpd: Convert missing uint32_t to uint64_t for for af_flags/flags
It was hard to catch those unless using higher values than uint32_t, but
already hit, it's time to fix completely.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit d782e3ffa2)
2023-02-24 14:29:24 +00:00
Donatas Abraitis
8587e5434e bgpd: Convert peer_af_flag_check() to bool
Since we increased peer->af_flags from uint32_t to uint64_t,
peer_af_flag_check() was historically returning integer, and not bool
as should be.

The bug was that if we have af_flags higher than uint32_t it will never
returned a right value.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 2c722516c3)
2023-02-24 14:29:24 +00:00
Donatas Abraitis
9a72aeeb04
Merge pull request #12891 from FRRouting/mergify/bp/dev/8.5/pr-12884
bgpd: Flowspec overflow issue (backport #12884)
2023-02-24 15:42:10 +02:00
Donatas Abraitis
ec7624d644
Merge pull request #12896 from FRRouting/mergify/bp/dev/8.5/pr-12885
lib, bgpd: bmp was not specifying l2vpn afi (backport #12885)
2023-02-24 15:16:12 +02:00
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
Donald Sharp
6b88d419a7 lib, bgpd: bmp was not specifying l2vpn afi
The l2vpn afi was not being properly displayed
when a show run was being issued.  Add a
afi2str_lower function and use it.

Fixes: #12867
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 0884f1644b)
2023-02-24 09:36:57 +00:00
Donald Sharp
7a23a1b9f1 bgpd: Flowspec overflow issue
According to the flowspec RFC 8955 a flowspec nlri is <length, <nlri data>>
Specifying 0 as a length makes BGP get all warm on the inside.  Which
in this case is not a good thing at all.  Prevent warmth, stay cold
on the inside.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 0b999c886e)
2023-02-24 07:53:35 +00: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