Commit Graph

29651 Commits

Author SHA1 Message Date
anlan_cs
f714e57a32 bgpd: cosmetic function address
No mistake, just to unify style for the parameter of function address - remove
ampersand.  In current code, only this one place of `hook_register()`s needs
to be made.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-10-08 06:11:52 -04:00
Mark Stapp
9daf964bc8
Merge pull request #12062 from fdumontet6WIND/hash_list
lib: hash list add function fix
2022-10-07 07:30:46 -04:00
Russ White
a00621d8b9
Merge pull request #12034 from opensourcerouting/fix/gr_hard_notification
bgpd: Do not send Deconfig/Shutdown message when restarting
2022-10-06 10:05:11 -04:00
Russ White
bfc8e5855c
Merge pull request #12038 from pguibert6WIND/show_bgp_nexthop_better
bgpd: improve 'show bgp nexthop' command
2022-10-06 10:04:49 -04:00
Russ White
a8ef436639
Merge pull request #12040 from opensourcerouting/fix/bgp_local_as_remote_as
bgpd: Allow using remote-as the same as local-as
2022-10-06 10:03:26 -04:00
David Lamparter
27a6fc4221 tests: make hash collision test collide harder
The issue fixed in the previous commit now correctly triggers a failure:
("assertion (list_add(&head, &itm[j]) == &itm[j]) failed")

Turns out the "shitty" hash function was not shitty enough.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06 15:28:26 +02:00
Francois Dumontet
5e0136c94f lib: fix typesafe hash add with hash collision
The typesafe hash data structure enforces items to be unique, but their
hash values may still collide.  To this extent, when two items have the
same hash value, the compare function is called to see if it returns 0
(aka "equal").

While the _find() function handles this correctly, the _add() function
mistakenly only checked the first item with a colliding hash value for
equality, and if it was inequal proceeded to add the new item.  There
may however be additional items with the same hash value collision, one
of which could still compare as equal.  In that case, _add() would
mistakenly add the new element, failing to notice the already added
item.  Breakage ensues.

Fix by looking for an equal element among *all* existing items with the
same hash value, not just the first.

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
[DL: rewrote commit message, fixed whitespace/formatting]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-10-06 15:09:15 +02:00
mobash-rasool
632041aec4
Merge pull request #12054 from opensourcerouting/feature/show_that_route_is_not_advertised
bgpd: Show why the prefix is inaccessible in show commands
2022-10-06 15:23:21 +05:30
Donatas Abraitis
5640afc641
Merge pull request #11983 from maduri111/bgpd-cond-adv-debug
bgpd: adding debug command for conditional advertisement
2022-10-06 12:42:28 +03:00
Madhuri Kuruganti
e85e4a8d16 bgpd: conditional advertisement code cleanup
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-06 12:43:05 +05:30
Donatas Abraitis
b022cf7352
Merge pull request #11838 from Pdoijode/v6-gua-nh-bgp-update
bgpd: BGP does not update next-hop when global V6 address is configured
2022-10-06 10:04:37 +03:00
Madhuri Kuruganti
8093d7999c bgpd: adding debug command for conditional advertisement
Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
2022-10-06 12:17:27 +05:30
Jafar Al-Gharaibeh
2a88c83620
Merge pull request #12060 from donaldsharp/tunnel_shenanigans
zebra: Allow tunneldump data to work properly on non-supported kernels
2022-10-05 17:50:48 -05:00
Donald Sharp
81552b9774
Merge pull request #12017 from patrasar/pimv6_hello
pimd, pim6d: send secondary address in PIM hello packet
2022-10-05 08:25:28 -04:00
Donald Sharp
4457132992
Merge pull request #12063 from opensourcerouting/fix/update_package_development_versions
debian, redhat: Update changelog for new release (8.5)
2022-10-05 08:10:15 -04:00
Donatas Abraitis
30098ade41
Merge pull request #12019 from devicenull/master
Configure systemd to always restart FRR, regardless of exit code
2022-10-05 14:14:58 +03:00
Donatas Abraitis
4b8a9e74a2
Merge pull request #12013 from SaiGomathiN/11895
pim6d: Adding new Debug CLI for MLD
2022-10-05 14:09:39 +03:00
Donatas Abraitis
1fa5a99d43
Merge pull request #12048 from taspelund/display_retrans_mismatch
RA logging improvements
2022-10-05 14:08:06 +03:00
Philippe Guibert
8c6a164f40 bgpd: improve 'show bgp nexthop' command
- for a given IP nexthop, dump all NH entries, including
colored entries, or entries with an ifindex.
- when a given IP nexthop is requested, the path is displayed.
For better readibility, remove the carriage return between
'Last update' and 'Paths', because ctime() function already
performs carriage return.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-10-05 11:12:59 +02:00
Donatas Abraitis
5b5f1e7df4 debian, redhat: Update changelog for new release (8.5)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-05 11:28:19 +03:00
Donald Sharp
451165eb57 zebra: Allow tunneldump data to work properly on non-supported kernels
When zebra requests tunnel data it is sending a RTM_GETTUNNEL per
interface that is a VXLAN tunnel.  If the kernel that is being
used does not support the particular request type then zebra
will get a error message per tunnel request back.  Unfortunately
netlink_parse_info *stops* reading on the first error message.
Therefor one kernels that are returning an error message
let's gather all of those errors.  This will allow things
like route reads to actually work properly

Fixes: #12056
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-04 15:05:44 -04:00
Donatas Abraitis
b81570c690 build: FRR 8.5 development version
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-04 21:33:18 +03:00
Donatas Abraitis
b023c47eab
Merge pull request #12058 from donaldsharp/fabricd_excessive_debugs
fabricd:  Turn off excessive logging when peering will not come up
2022-10-04 21:28:27 +03:00
Donatas Abraitis
d4e8e27671
Merge pull request #12061 from mruprich/show-bgp-graceful-restart-typo
bgpd: show ip bgp neighbors graceful-restart typo
2022-10-04 21:26:45 +03:00
Trey Aspelund
820a9cadb2 zebra: ignore unspec RetransTimer in RA validation
Section 6.2.7 of RFC 4861 states that a router SHOULD log
inconsistencies in RA information detected on a given link:
```
    - Cur Hop Limit values (except for the unspecified value of zero
      other inconsistencies SHOULD be logged to system network
      management).

    - Values of the M or O flags.

    - Reachable Time values (except for the unspecified value of zero).

    - Retrans Timer values (except for the unspecified value of zero).

    - Values in the MTU options.

    - Preferred and Valid Lifetimes for the same prefix.  If
      AdvPreferredLifetime and/or AdvValidLifetime decrement in real
      time as specified in Section 6.2.1 then the comparison of the
      lifetimes cannot compare the content of the fields in the Router
      Advertisement, but must instead compare the time at which the
      prefix will become deprecated and invalidated, respectively.  Due
      to link propagation delays and potentially poorly synchronized
      clocks between the routers such comparison SHOULD allow some time
      skew.
```

We were not logging inconsistencies if "the unspecified value of zero"
was used for Reachable Time but were logging them for Retrans Timer.
This updates the validation check to also skip the logging of Retrans
Timer inconsistencies if either local/rx value is 0.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-10-04 15:20:44 +00:00
Trey Aspelund
99e66e520b zebra: show local/rx values in RA mismatch debugs
When we process a received Router Advertisement we have some logic in
place to detect and log mismatches in a handful of flags/values.
However, these logs do not include what the actual values are, which
means it's up to the operator to grab a packet capture and compare that
against the local configuration...
So let's make life a little easier by including those in the log itself.

Before:
```
2022/09/30 20:37:16 ZEBRA: [KV2V1-7GM7G][EC 4043309149] enp1s0(2): Rx RA - our AdvCurHopLimit doesn't agree with fe80::5054:ff:feca:b085
2022/09/30 20:37:16 ZEBRA: [KS0BP-4GR8K][EC 4043309149] enp1s0(2): Rx RA - our AdvManagedFlag doesn't agree with fe80::5054:ff:feca:b085
2022/09/30 20:37:16 ZEBRA: [RE4EC-VYEJ2][EC 4043309149] enp1s0(2): Rx RA - our AdvOtherConfigFlag doesn't agree with fe80::5054:ff:feca:b085
2022/09/30 20:37:16 ZEBRA: [X6794-9MW18][EC 4043309149] enp1s0(2): Rx RA - our AdvReachableTime doesn't agree with fe80::5054:ff:feca:b085
2022/09/30 20:37:16 ZEBRA: [S1KXC-H8F4W][EC 4043309149] enp1s0(2): Rx RA - our AdvRetransTimer doesn't agree with fe80::5054:ff:feca:b085
```

After:
```
Sep 30 20:45:18 ub20-2 zebra[47487]: [GSW5Z-V7DZN][EC 4043309149] enp1s0(2): Rx RA - our AdvCurHopLimit (14) doesn't agree with fe80::5054:ff:fe9a:e2ca (64)
Sep 30 20:45:18 ub20-2 zebra[47487]: [RHHTS-F96DR][EC 4043309149] enp1s0(2): Rx RA - our AdvManagedFlag (0) doesn't agree with fe80::5054:ff:fe9a:e2ca (1)
Sep 30 20:45:18 ub20-2 zebra[47487]: [MNBY3-FTN6W][EC 4043309149] enp1s0(2): Rx RA - our AdvOtherConfigFlag (0) doesn't agree with fe80::5054:ff:fe9a:e2ca (1)
Sep 30 20:45:18 ub20-2 zebra[47487]: [GG62B-XXWR0][EC 4043309149] enp1s0(2): Rx RA - our AdvReachableTime (20) doesn't agree with fe80::5054:ff:fe9a:e2ca (777)
Sep 30 20:45:18 ub20-2 zebra[47487]: [YG220-D6B4H][EC 4043309149] enp1s0(2): Rx RA - our AdvRetransTimer (13) doesn't agree with fe80::5054:ff:fe9a:e2ca (0)
```

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-10-04 15:20:44 +00:00
Michal Ruprich
dcab90125f bgpd: show ip bgp neighbors graceful-restart typo
Noticed a typo in the definition of
show_ip_bgp_neighbors_graceful_restart function.

Signed-off-by: Michal Ruprich <mruprich@redhat.com>
2022-10-04 15:14:48 +02:00
Russ White
4b72a7be69
Merge pull request #12047 from donaldsharp/bgp_nexthop_individual
bgpd: Fix `show bgp nexthop A.B.C.D`
2022-10-04 07:41:58 -04:00
Donald Sharp
15d133c97e fabricd: Turn off excessive logging when peering will not come up
When fabricd is configured to use an interface and there will be
no peers out that interface, the log file is filling up with:

Oct 04 10:50:03 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Initializing to Up
Oct 04 10:50:03 host2 fabricd[1444769]: [R18GA-MS9R7] OpenFabric: Started initial synchronization with 1111.1111.1111 on enp1s0f1np1
Oct 04 10:50:06 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Up to Initializing
Oct 04 10:50:07 host2 fabricd[1444769]: [NT6J7-1RYRF] OpenFabric: Initial synchronization on enp1s0f1np1 timed out!
Oct 04 10:50:07 host2 fabricd[1444769]: [R18GA-MS9R7] OpenFabric: Started initial synchronization with 3333.3333.3333 on enp1s0f0np0
Oct 04 10:50:08 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Up to Initializing
Oct 04 10:50:11 host2 fabricd[1444769]: [NT6J7-1RYRF] OpenFabric: Initial synchronization on enp1s0f0np0 timed out!
Oct 04 10:50:11 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Initializing to Up
Oct 04 10:50:11 host2 fabricd[1444769]: [R18GA-MS9R7] OpenFabric: Started initial synchronization with 1111.1111.1111 on enp1s0f1np1
Oct 04 10:50:14 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Up to Initializing
Oct 04 10:50:15 host2 fabricd[1444769]: [NT6J7-1RYRF] OpenFabric: Initial synchronization on enp1s0f1np1 timed out!
Oct 04 10:50:16 host2 fabricd[1444769]: [R18GA-MS9R7] OpenFabric: Started initial synchronization with 1111.1111.1111 on enp1s0f1np1
Oct 04 10:50:18 host2 fabricd[1444769]: [HHXDJ-1DA93] ISIS-Adj (1): Threeway state change Initializing to Up

The `Threeway state change..` message is guarded by a debug, but the other 2 are not.
Let's guard those with debugs since the log will be filled up rather quickly
with any sort of aggressive timers.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-10-04 07:28:51 -04:00
Donatas Abraitis
95ba22d531 bgpd: Show why the prefix is inaccessible in show commands
```
donatas-pc# show ip bgp 100.100.100.0/24 longer-prefixes
BGP table version is 13, local router ID is 10.10.10.10, vrf id 0
Default local pref 100, local AS 65000
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
   100.100.100.0/24 0.0.0.0                  0         32768 i

Displayed  1 routes and 15 total paths
donatas-pc# show ip bgp 100.100.100.0/24
BGP routing table entry for 100.100.100.0/24, version 0
Paths: (1 available, no best path)
  Not advertised to any peer
  Local
    0.0.0.0 (inaccessible, import-check enabled) from 0.0.0.0 (10.10.10.10)
      Origin IGP, metric 0, weight 32768, invalid, sourced, local
      Last update: Tue Oct  4 11:31:44 2022
donatas-pc# show ip bgp 100.100.100.0/24 json
{
  "prefix":"100.100.100.0\/24",
  "version":0,
  "paths":[
    {
      "aspath":{
        "string":"Local",
        "segments":[
        ],
        "length":0
      },
      "origin":"IGP",
      "metric":0,
      "weight":32768,
      "valid":false,
      "version":0,
      "sourced":true,
      "local":true,
      "lastUpdate":{
        "epoch":1664872304,
        "string":"Tue Oct  4 11:31:44 2022\n"
      },
      "nexthops":[
        {
          "ip":"0.0.0.0",
          "hostname":"donatas-pc",
          "afi":"ipv4",
          "accessible":false,
          "importCheckEnabled":true,
          "used":true
        }
      ],
      "peer":{
        "peerId":"0.0.0.0",
        "routerId":"10.10.10.10"
      }
    }
  ]
}
donatas-pc#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-10-04 11:32:39 +03:00
Donatas Abraitis
5cb79bd567
Merge pull request #12043 from donaldsharp/bgp_hate
Bgp hate
2022-10-01 20:40:15 +03:00
Donald Sharp
a8cc325f59 bgpd: Fix show bgp nexthop A.B.C.D
The issuing of `show bgp nexthop A.B.C.D` fails even if that
nexthop exists:

eva# show bgp nexthop 192.168.119.120
specified nexthop does not have entry

Fixed:

eva# show bgp nexthop 192.168.119.120
 192.168.119.120 valid [IGP metric 0], #paths 0, peer 192.168.119.120
  if enp39s0
  Last update: Fri Sep 30 14:55:13 2022

  Paths:

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-30 14:58:21 -04:00
Donald Sharp
1117baca3c bgpd: Ensure FRR has enough data to read 2 bytes in bgp_open_option_parse
In bgp_open_option_parse the code is checking that the
stream has at least 2 bytes to read ( the opt_type and
the opt_length).  However if BGP_OPEN_EXT_OPT_PARAMS_CAPABLE(peer)
is configured then FRR is reading 3 bytes.  Which is not good
since the packet could be badly formateed.  Ensure that
FRR has the appropriate data length to read the data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-30 09:00:02 -04:00
Donald Sharp
3e46b43e37 bgpd: Ensure FRR has enough data to read 2 bytes in peek_for_as4_capability
In peek_for_as4_capability the code is checking that the
stream has at least 2 bytes to read ( the opt_type and the
opt_length ).  However if BGP_OPEN_EXT_OPT_PARAMS_CAPABLE(peer)
is configured then FRR is reading 3 bytes.  Which is not good
since the packet could be badly formated.  Ensure that
FRR has the appropriate data length to read the data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-30 08:59:52 -04:00
Sarita Patra
6ea2a7fb4f pimd, pim6d: send secondary address in PIM hello packet
Fixed as per rfc7761 section 4.3.1.
"""
Sending Hello Messages
The Address List option advertises all the secondary addresses
associated with the source interface of the router originating the
message.  The option MUST be included in all Hello messages if there
are secondary addresses associated with the source interface and MAY
be omitted if no secondary addresses exist.
"""

Issue: #12015

Signed-off-by: Sarita Patra <saritap@vmware.com>
2022-09-30 03:35:49 -07:00
Donatas Abraitis
18e427bc59 tests: Check if the routes in the kernel are retained for GR as well
Not only in BGP table.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-30 09:51:07 +03:00
Donatas Abraitis
95098d9611 bgpd: Do not send Deconfig/Shutdown message when restarting
We might disable sending unconfig/shutdown notifications when
Graceful-Restart is enabled and negotiated.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-30 09:50:21 +03:00
Pdoijode
bc6d1b151f bgpd: BGP does not update next-hop when global V6 address is configured
When primary global v6 unicast address is configured on an
unnumbered interface, BGP does not re-advertise updates out
with the new global v6 address as the nexthop

Signed-off-by: Pdoijode <pdoijode@nvidia.com>
2022-09-29 15:28:38 -07:00
Donatas Abraitis
f3bc47b735 tests: Check if BGP works correctly when using local-as == remote-as
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-29 21:17:44 +03:00
Donatas Abraitis
d6b0327c35 bgpd: Allow using remote-as the same as local-as
As an example, Arista EOS allows this behavior.

Configuration something like:

```
 neighbor PG peer-group
 neighbor PG remote-as 65001
 neighbor PG local-as 65001
 neighbor 192.168.10.124 peer-group PG
```

Or without peer-group.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-29 21:13:40 +03:00
Donatas Abraitis
5ae96447d7
Merge pull request #12035 from donaldsharp/pim6_write_non_integrated
pimd: Allow v6 to do non-integrated configuration
2022-09-29 14:47:10 +03:00
Donald Sharp
9f8df438e8 pimd: Remove some unused defines in pimd.h
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-28 08:27:02 -04:00
Donald Sharp
8a86ada12d pimd: Assign a vty port value for v6
Let's use 2620

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-28 08:27:02 -04:00
Donald Sharp
8ad5293270
Merge pull request #12036 from opensourcerouting/fix/show_single_allow-reserved-ranges
vtysh: Show allow-reserved-ranges once in config
2022-09-28 08:24:52 -04:00
Donald Sharp
d8a1b6a8bd
Merge pull request #12028 from mobash-rasool/igmp-querier
pimd: IGMP Querier election is not correct in LAN scenario
2022-09-27 15:45:27 -04:00
Donatas Abraitis
ac67c0e4c7 vtysh: Show allow-reserved-ranges once in config
Before:

```
donatas-pc# sh run | include allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
allow-reserved-ranges
donatas-pc#
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-09-27 21:41:24 +03:00
Donald Sharp
b408121b33
Merge pull request #11990 from spk-hebbar/patch-1
Update setup.rst
2022-09-27 12:40:37 -04:00
Donald Sharp
661798c670 pimd: Allow v6 to do non-integrated configuration
Proof:
eva# conf
eva(config)# no service integrated-vtysh-config
eva(config)# end
eva# wr mem
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Configuration saved to /etc/frr/zebra.conf
Configuration saved to /etc/frr/ripd.conf
Configuration saved to /etc/frr/ripngd.conf
Configuration saved to /etc/frr/ospfd.conf
Configuration saved to /etc/frr/ospf6d.conf
Configuration saved to /etc/frr/bgpd.conf
Configuration saved to /etc/frr/isisd.conf
Configuration saved to /etc/frr/pimd.conf
Configuration saved to /etc/frr/nhrpd.conf
Configuration saved to /etc/frr/eigrpd.conf
Configuration saved to /etc/frr/babeld.conf
Configuration saved to /etc/frr/sharpd.conf
Configuration saved to /etc/frr/fabricd.conf
Configuration saved to /etc/frr/pbrd.conf
Configuration saved to /etc/frr/staticd.conf
Configuration saved to /etc/frr/bfdd.conf
Configuration saved to /etc/frr/vrrpd.conf
Configuration saved to /etc/frr/pim6d.conf
eva#

Fixes: #12011
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-09-27 12:24:16 -04:00
Donald Sharp
bb4aca817a
Merge pull request #12018 from pguibert6WIND/pathd_warning_noted
pathd: change the vty output, when no ted is enabled on pathd
2022-09-27 11:39:46 -04:00
Donatas Abraitis
470fd9dd9f
Merge pull request #12029 from donaldsharp/cputime_stats
Cputime stats
2022-09-27 18:39:06 +03:00