]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
3 years agoospf6d: actually print prefix options
David Lamparter [Mon, 28 Jun 2021 14:12:49 +0000 (16:12 +0200)]
ospf6d: actually print prefix options

Well at least I had a good laugh at the "xxx".

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoospf6d: move prefix_options from _path to _route
David Lamparter [Mon, 28 Jun 2021 13:18:29 +0000 (15:18 +0200)]
ospf6d: move prefix_options from _path to _route

Prefix options are per-prefix, not per-path.  As evident by the fact
that the field is never used on ECMP paths.  Move it where it belongs.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoMerge pull request #8554 from mjstapp/evpn_workqueue
Stephen Worley [Mon, 19 Jul 2021 20:21:20 +0000 (16:21 -0400)]
Merge pull request #8554 from mjstapp/evpn_workqueue

lib,zebra: move some evpn dplane installation to the zebra workqueue

3 years agozebra: replace ipaddr2str in dplane module 8554/head
Mark Stapp [Thu, 22 Apr 2021 18:59:29 +0000 (14:59 -0400)]
zebra: replace ipaddr2str in dplane module

Replace a couple of ipaddr2str calls with pIA in the dplane
module.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agotests: skip tests after errors in bgp-evpn-vxlan
Mark Stapp [Thu, 22 Apr 2021 18:32:57 +0000 (14:32 -0400)]
tests: skip tests after errors in bgp-evpn-vxlan

In bgp-evpn-vxlan, skip test cases if there's been a failure;
a couple of cases were missing this.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: process EVPN remote VTEP updates from the workqueue
Mark Stapp [Tue, 20 Apr 2021 13:14:46 +0000 (09:14 -0400)]
zebra: process EVPN remote VTEP updates from the workqueue

Move remote VTEP updates from immediate, inline processing
in their ZAPI message handlers to the main workqueue.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: use workqueue for vxlan remote macip updates
Mark Stapp [Mon, 19 Apr 2021 19:25:27 +0000 (15:25 -0400)]
zebra: use workqueue for vxlan remote macip updates

Enqueue incoming vxlan remote macip updates on the main
workqueue, instead of performing the updates immediately,
in-line.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: use more const
Mark Stapp [Mon, 19 Apr 2021 18:26:57 +0000 (14:26 -0400)]
zebra: use more const

Use const in many more evpn apis, especially for macaddr,
ipaddr arguments.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: add workqueue support for EVPN updates
Mark Stapp [Mon, 19 Apr 2021 15:12:51 +0000 (11:12 -0400)]
zebra: add workqueue support for EVPN updates

Add workqueue subqueue for EVPN/VxLAN updates; migrate the
evpn route and remote ES processing from their ZAPI handlers
to the workqueue.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agolib: remove quagga from route_types.txt
Mark Stapp [Fri, 16 Apr 2021 19:28:14 +0000 (15:28 -0400)]
lib: remove quagga from route_types.txt

Remove the q-word.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: give some evpn apis better names
Mark Stapp [Fri, 16 Apr 2021 16:17:11 +0000 (12:17 -0400)]
zebra: give some evpn apis better names

Use more useful names for a few evpn apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #9080 from ton31337/fix/reason_bgpd
Donald Sharp [Sun, 18 Jul 2021 19:33:19 +0000 (15:33 -0400)]
Merge pull request #9080 from ton31337/fix/reason_bgpd

bgpd: Drop unnecessary chars for filtered reason

3 years agoMerge pull request #9075 from donaldsharp/alias_auto_completion
Donatas Abraitis [Sun, 18 Jul 2021 17:30:41 +0000 (20:30 +0300)]
Merge pull request #9075 from donaldsharp/alias_auto_completion

bgpd: Allow for auto-completion of community alias's created

3 years agobgpd: Drop unnecessary chars for filtered reason 9080/head
Donatas Abraitis [Sun, 18 Jul 2021 15:03:25 +0000 (18:03 +0300)]
bgpd: Drop unnecessary chars for filtered reason

Seems missed grammarly review for the reason "as-path contains our own AS;"

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9061 from donaldsharp/bgp_max_path_doc
Donatas Abraitis [Sun, 18 Jul 2021 08:46:35 +0000 (11:46 +0300)]
Merge pull request #9061 from donaldsharp/bgp_max_path_doc

doc: Document the maximum-paths command for bgp

3 years agoMerge pull request #9062 from ton31337/fix/bgp_dampening_json_crash
Donald Sharp [Fri, 16 Jul 2021 18:41:32 +0000 (14:41 -0400)]
Merge pull request #9062 from ton31337/fix/bgp_dampening_json_crash

bgpd: BGP dampening JSON fixes

3 years agobgpd: Allow for auto-completion of community alias's created 9075/head
Donald Sharp [Fri, 16 Jul 2021 13:52:53 +0000 (09:52 -0400)]
bgpd: Allow for auto-completion of community alias's created

Add a bit of code to allow for auto-completion of the community
alias command when attempting to use it for show commands.

example:
eva(config)# bgp community alias 11:22 FOO
eva(config)# end
eva# show bgp ipv4 uni alias
  ALIAS_NAME  BGP community alias
     FOO

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9063 from sworleys/Fix-IFP-NHG
Mark Stapp [Fri, 16 Jul 2021 13:33:52 +0000 (09:33 -0400)]
Merge pull request #9063 from sworleys/Fix-IFP-NHG

zebra: fix ifp pointer for groups/recursives

3 years agoMerge pull request #9001 from donaldsharp/pim_mrib_lookup_do_all
Rafael Zalamena [Fri, 16 Jul 2021 13:24:27 +0000 (10:24 -0300)]
Merge pull request #9001 from donaldsharp/pim_mrib_lookup_do_all

pimd: When passing lookup information back pass the fully resolved

3 years agoMerge pull request #8946 from gpnaveen/bgp_lib_changes
Donald Sharp [Fri, 16 Jul 2021 13:15:36 +0000 (09:15 -0400)]
Merge pull request #8946 from gpnaveen/bgp_lib_changes

tests: Adding lib changes for bgp peer type verification.

3 years agoMerge pull request #9068 from ton31337/fix/reduce_converge_time
Donald Sharp [Fri, 16 Jul 2021 12:34:46 +0000 (08:34 -0400)]
Merge pull request #9068 from ton31337/fix/reduce_converge_time

tests: Reduce bgp_conditional_advertisement converge time 10x

3 years agoMerge pull request #9049 from LabNConsulting/chopps/improve-frr-reload-delta
Mark Stapp [Fri, 16 Jul 2021 12:21:57 +0000 (08:21 -0400)]
Merge pull request #9049 from LabNConsulting/chopps/improve-frr-reload-delta

tools: improve frr-reload.py delta file creation

3 years agoMerge pull request #9038 from donaldsharp/realloc_bgp
Igor Ryzhov [Fri, 16 Jul 2021 10:17:47 +0000 (13:17 +0300)]
Merge pull request #9038 from donaldsharp/realloc_bgp

bgpd: XREALLOC handles NULL properly

3 years agoMerge pull request #9053 from opensourcerouting/ospfv3-debug-guard
Igor Ryzhov [Fri, 16 Jul 2021 10:09:59 +0000 (13:09 +0300)]
Merge pull request #9053 from opensourcerouting/ospfv3-debug-guard

ospf6d: remove extra debug message

3 years agotools: improve frr-reload.py delta file creation 9049/head
Christian Hopps [Wed, 14 Jul 2021 11:05:29 +0000 (07:05 -0400)]
tools: improve frr-reload.py delta file creation

- Remove incorrect requirement for `service integrated-vtysh-config`
  when producing a delta.
- Add `--test-reset` option which suppresses non-parseable lines from the
  produced delta
- Use new features in common_config.py

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agotests: Reduce bgp_conditional_advertisement converge time 10x 9068/head
Donatas Abraitis [Mon, 28 Jun 2021 12:59:57 +0000 (15:59 +0300)]
tests: Reduce bgp_conditional_advertisement converge time 10x

~15min vs. ~1min.

Before:
```
1 passed, 1 skipped in 908.61 seconds
```

After:
```
1 passed, 1 skipped in 82.94 seconds
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9055 from ton31337/fix/show_pfxsnt_even_when_default_route_originated
Donald Sharp [Thu, 15 Jul 2021 19:54:01 +0000 (15:54 -0400)]
Merge pull request #9055 from ton31337/fix/show_pfxsnt_even_when_default_route_originated

bgpd: Reflect changes to pfxSnt when using default-originate

3 years agoMerge pull request #9065 from colinbs/fix_config_help_undefined_sanitizer
Donald Sharp [Thu, 15 Jul 2021 19:52:15 +0000 (15:52 -0400)]
Merge pull request #9065 from colinbs/fix_config_help_undefined_sanitizer

configure.ac: fix help text to --enable-undefined-sanitizer

3 years agoconfigure.ac: fix help text to --enable-undefined-sanitizer 9065/head
Colin Sames [Thu, 15 Jul 2021 17:10:14 +0000 (19:10 +0200)]
configure.ac: fix help text to --enable-undefined-sanitizer

Signed-off-by: Colin Sames <colin.sames@haw-hamburg.de>
3 years agozebra: fix ifp pointer for groups/recursives 9063/head
Stephen Worley [Mon, 21 Jun 2021 16:53:25 +0000 (12:53 -0400)]
zebra: fix ifp pointer for groups/recursives

At some point we broke the ifp pointer for nhe->ifp such
that it was pointing to an interface even in groups/recurisve
instances.

Add checks here to make it again so that we only set the ifp
pointer if it is a fully resolved singleton NHE.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agobgpd: Fix `dampening flap-statistics json` crash 9062/head
Donatas Abraitis [Thu, 15 Jul 2021 13:11:45 +0000 (16:11 +0300)]
bgpd: Fix `dampening flap-statistics json` crash

With fix:
```
exit1-debian-9# sh ip bgp dampening flap-statistics
BGP table version is 22, local router ID is 10.10.10.200, 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          From            Flaps Duration Reuse    Path
*d 10.0.0.0/24      192.168.0.2     4    00:00:50 00:35:56 65000 ?
*d 10.10.10.100/32  192.168.0.2     4    00:00:50 00:35:56 65000 ?
*d 192.168.1.0/24   192.168.0.2     4    00:00:50 00:35:56 65000 ?

Displayed  3 routes and 10 total paths
exit1-debian-9# sh ip bgp dampening flap-statistics json
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 22,
 "routerId": "10.10.10.200",
 "defaultLocPrf": 100,
 "localAS": 65001,
 "routes": { "10.0.0.0/24": [
  {
    "valid":true,
    "damped":true,
    "pathFrom":"external",
    "peerHost":"192.168.0.2",
    "bdiFlap":4,
    "peerUptime":"00:00:54",
    "peerUptimeMsec":54000,
    "peerUptimeEstablishedEpoch":1626355135,
    "reuseTimerMsecs":2151000,
    "asPath":"65000",
    "origin":"?"
  }
],"10.10.10.100/32": [
  {
    "valid":true,
    "damped":true,
    "pathFrom":"external",
    "peerHost":"192.168.0.2",
    "bdiFlap":4,
    "peerUptime":"00:00:54",
    "peerUptimeMsec":54000,
    "peerUptimeEstablishedEpoch":1626355135,
    "reuseTimerMsecs":2151000,
    "asPath":"65000",
    "origin":"?"
  }
],"192.168.1.0/24": [
  {
    "valid":true,
    "damped":true,
    "pathFrom":"external",
    "peerHost":"192.168.0.2",
    "bdiFlap":4,
    "peerUptime":"00:00:54",
    "peerUptimeMsec":54000,
    "peerUptimeEstablishedEpoch":1626355135,
    "reuseTimerMsecs":2151000,
    "asPath":"65000",
    "origin":"?"
  }
] }  }
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agotests: Fixing timing issue in evpn script. 8946/head
nguggarigoud [Thu, 15 Jul 2021 12:57:25 +0000 (05:57 -0700)]
tests: Fixing timing issue in evpn script.

Modified bgp timer values for faster convergence.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
3 years agobgpd: Fix `dampening dampened-paths json` crash
Donatas Abraitis [Thu, 15 Jul 2021 12:55:46 +0000 (15:55 +0300)]
bgpd: Fix `dampening dampened-paths json` crash

```
5  0x00007fccab6fac39 in json_object_boolean_true_add (obj=<optimized out>, key=<optimized out>) at lib/json.c:70
No locals.
6  0x000055c7b8c08ae5 in route_vty_short_status_out (vty=<optimized out>, path=0x55c7bb37dcf0, p=<optimized out>, json_path=0x55c7bb3735a0)
    at bgpd/bgp_route.c:8566
        rpki_state = RPKI_NOT_BEING_USED
7  0x000055c7b8c22d1b in flap_route_vty_out (afi=AFI_IP, json=0x55c7bb3735a0, use_json=true, safi=SAFI_UNICAST, display=0, path=0x55c7bb37dcf0,
    p=0x55c7bb37dea0, vty=0x55c7bb39e4c0) at bgpd/bgp_route.c:9600
        attr = <optimized out>
        bdi = 0x55c7bb377950
        timebuf = '\000' <repeats 24 times>
        len = <optimized out>
8  bgp_show_table (vty=0x55c7bb39e4c0, bgp=0x55c7bb316300, safi=safi@entry=SAFI_UNICAST, table=0x55c7bb314d90, type=bgp_show_type_flap_statistics,
    output_arg=0x0, rd=0x0, is_last=1, output_cum=0x0, total_cum=0x0, json_header_depth=0x7ffeefd649f8, show_flags=1, rpki_target_state=RPKI_NOT_BEING_USED)
    at bgpd/bgp_route.c:11110
```

With fix:

```
exit1-debian-9# sh ip bgp dampening dampened-paths
BGP table version is 16, local router ID is 10.10.10.200, 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          From             Reuse    Path
*d 10.0.0.0/24      192.168.0.2      00:21:08 65000 ?
*d 10.10.10.100/32  192.168.0.2      00:21:08 65000 ?
*d 192.168.1.0/24   192.168.0.2      00:21:08 65000 ?

Displayed  3 routes and 10 total paths
exit1-debian-9# sh ip bgp dampening dampened-paths json
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 16,
 "routerId": "10.10.10.200",
 "defaultLocPrf": 100,
 "localAS": 65001,
 "routes": { "10.0.0.0/24": [
  {
    "valid":true,
    "damped":true,
    "pathFrom":"external",
    "reuseTimerMsecs":1263000,
    "asPath":"65000",
    "origin":"?",
    "peerHost":"192.168.0.2"
  }
],"10.10.10.100/32": [
  {
    "valid":true,
    "damped":true,
    "pathFrom":"external",
    "reuseTimerMsecs":1263000,
    "asPath":"65000",
    "origin":"?",
    "peerHost":"192.168.0.2"
  }
],"192.168.1.0/24": [
  {
    "valid":true,
    "damped":true,
    "pathFrom":"external",
    "reuseTimerMsecs":1263000,
    "asPath":"65000",
    "origin":"?",
    "peerHost":"192.168.0.2"
  }
] }  }
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agozebra: When passing lookup information back pass the fully resolved 9001/head
Donald Sharp [Wed, 7 Jul 2021 20:52:24 +0000 (16:52 -0400)]
zebra: When passing lookup information back pass the fully resolved

In the reachability code we auto pass back the fully resolved
nexthops.  Modify the ZEBRA_IPV4_NEXTHOP_LOOKUP_MRIB code
to do the exact same thing so that the zclient_lookup_nexthop
code does not need to recursively look for the data that
zebra already has.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9018 from LabNConsulting/chopps/triage-features
Donald Sharp [Thu, 15 Jul 2021 12:37:15 +0000 (08:37 -0400)]
Merge pull request #9018 from LabNConsulting/chopps/triage-features

tests: add triage features: strace, asan-abort, and shells/vtys/gdbs for docker runs too

3 years agotests: Adding lib changes for bgp peer type verification.
nguggarigoud [Tue, 29 Jun 2021 00:10:17 +0000 (17:10 -0700)]
tests: Adding lib changes for bgp peer type verification.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
3 years agodoc: Document the maximum-paths command for bgp 9061/head
Donald Sharp [Thu, 15 Jul 2021 12:10:10 +0000 (08:10 -0400)]
doc: Document the maximum-paths command for bgp

This was apparently missing from our documentation.
Let's add it in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9051 from opensourcerouting/bgp-bfd-crash-fix
Igor Ryzhov [Wed, 14 Jul 2021 22:14:22 +0000 (01:14 +0300)]
Merge pull request #9051 from opensourcerouting/bgp-bfd-crash-fix

3 years agotests: Check if pfxSnt is adjusted when default-originate is used for BGP 9055/head
Donatas Abraitis [Wed, 14 Jul 2021 21:10:38 +0000 (00:10 +0300)]
tests: Check if pfxSnt is adjusted when default-originate is used for BGP

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Increase sent prefix count per subgrp when originating default route
Donatas Abraitis [Wed, 14 Jul 2021 20:55:20 +0000 (23:55 +0300)]
bgpd: Increase sent prefix count per subgrp when originating default route

Before we didn't count default-originate to pfxSnt.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agotests: add triage features: strace, asan-abort, docker exec 9018/head
Christian Hopps [Fri, 9 Jul 2021 09:22:51 +0000 (05:22 -0400)]
tests: add triage features: strace, asan-abort, docker exec

TMUX and Screen support when running topotests inside docker. This
allows the gdb, shell and vtysh features to correctly work even when
running the tests inside docker.

Add options:
--asan-abort :: aborts the process on ASAN errors
--strace-daemons :: strace some or all daemons

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agoospf6d: remove extra debug message 9053/head
Rafael Zalamena [Fri, 9 Jul 2021 18:46:36 +0000 (15:46 -0300)]
ospf6d: remove extra debug message

Somehow the hello message debugging code slipped outside the debug
guard. Lets just remove it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agobgpd: fix crash during configuration removal 9051/head
Rafael Zalamena [Wed, 14 Jul 2021 01:46:40 +0000 (22:46 -0300)]
bgpd: fix crash during configuration removal

Test the BFD config pointer before trying to free the session as it
might not exist.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoMerge pull request #9041 from taspelund/next-hop-self-force-doc
Donatas Abraitis [Wed, 14 Jul 2021 11:05:09 +0000 (14:05 +0300)]
Merge pull request #9041 from taspelund/next-hop-self-force-doc

doc: replace next-hop-self all with force

3 years agodoc: replace next-hop-self all with force 9041/head
Trey Aspelund [Tue, 13 Jul 2021 13:38:44 +0000 (13:38 +0000)]
doc: replace next-hop-self all with force

Replaces next-hop-self keyword "all" with "force" to match the CLI.
Also mentions third-party next-hops will be bypassed by next-hop-self.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
3 years agoMerge pull request #8893 from qlyoung/bgp-condadv-timer
Donatas Abraitis [Wed, 14 Jul 2021 05:04:16 +0000 (08:04 +0300)]
Merge pull request #8893 from qlyoung/bgp-condadv-timer

bgpd: add knob to config cond-adv scanner period

3 years agoMerge pull request #9024 from idryzhov/isis-attached-bit
Russ White [Tue, 13 Jul 2021 22:42:39 +0000 (18:42 -0400)]
Merge pull request #9024 from idryzhov/isis-attached-bit

isisd: fix setting of the attached bit

3 years agoMerge pull request #8992 from opensourcerouting/workflow-knobs
Russ White [Tue, 13 Jul 2021 22:41:52 +0000 (18:41 -0400)]
Merge pull request #8992 from opensourcerouting/workflow-knobs

workflow: add guidelines for config knobs

3 years agoMerge pull request #9039 from ton31337/fix/no_need_to_check_for_null_in_cmp_functions
Donald Sharp [Tue, 13 Jul 2021 20:42:23 +0000 (16:42 -0400)]
Merge pull request #9039 from ton31337/fix/no_need_to_check_for_null_in_cmp_functions

bgpd: Do not check for NULL values for vni_hash_cmp()

3 years agobgpd: add knob to config cond-adv scanner period 8893/head
Quentin Young [Fri, 14 May 2021 18:57:06 +0000 (14:57 -0400)]
bgpd: add knob to config cond-adv scanner period

Adds a knob that sets the time between loc-rib scans for conditional
advertisement.

I chose the range (5-240) because 1 second seems dumb and too easy to
hurt yourself at even moderate scale, 5 seconds you can still hurt
yourself but I could see a use case for it, and 4 minutes should be
enough for anyone (tm)

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #8961 from pguibert6WIND/bgp_unnumbered_config_find_nexthop
Donald Sharp [Tue, 13 Jul 2021 15:55:14 +0000 (11:55 -0400)]
Merge pull request #8961 from pguibert6WIND/bgp_unnumbered_config_find_nexthop

bgpd: associate correct nexthop when using peer link-local

3 years agoMerge pull request #9015 from Prerana-GB/GR
Russ White [Tue, 13 Jul 2021 15:39:31 +0000 (11:39 -0400)]
Merge pull request #9015 from Prerana-GB/GR

bgpd: Inconsistency in Local BGP GR state.

3 years agoMerge pull request #9037 from idryzhov/ospf6-freebsd
Donald Sharp [Tue, 13 Jul 2021 13:40:13 +0000 (09:40 -0400)]
Merge pull request #9037 from idryzhov/ospf6-freebsd

ospf6d: fix freebsd mcast group issues

3 years agoMerge pull request #9036 from donaldsharp/hash_cmp_stuff
Donatas Abraitis [Tue, 13 Jul 2021 13:27:27 +0000 (16:27 +0300)]
Merge pull request #9036 from donaldsharp/hash_cmp_stuff

bgpd: hash compare functions never receive null values

3 years agoisisd: fix setting IS type in LSPs 9024/head
Igor Ryzhov [Mon, 12 Jul 2021 20:56:50 +0000 (23:56 +0300)]
isisd: fix setting IS type in LSPs

IS type in an LSP is a type of the router, not a type of the circuit.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: fix processing of the attached bit
Igor Ryzhov [Mon, 12 Jul 2021 20:56:04 +0000 (23:56 +0300)]
isisd: fix processing of the attached bit

There are two problems with the current code for processing the attached
bit:
- we should process it when acting both a level-1-only and level-1-2
- we should add the default route when we don't have L2 adjacensies, not
  when we don't have other routers configured on the device

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: fix setting of the attached bit
Igor Ryzhov [Mon, 12 Jul 2021 20:51:27 +0000 (23:51 +0300)]
isisd: fix setting of the attached bit

Current code related to setting of the attached bit checks for existence
of L2 adjacencies in other routers configured on the device. This makes
no sense. We should check for L2 adjacencies in the same router where we
have L1 adjacencies.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8767 from opensourcerouting/ospfd-gr
Russ White [Tue, 13 Jul 2021 10:39:53 +0000 (06:39 -0400)]
Merge pull request #8767 from opensourcerouting/ospfd-gr

ospfd: introduce support for Graceful Restart (restarting mode)

3 years agoMerge pull request #8734 from imzyxwvu/paf-deactivate
Russ White [Tue, 13 Jul 2021 10:35:30 +0000 (06:35 -0400)]
Merge pull request #8734 from imzyxwvu/paf-deactivate

bgpd: Do not delete peer_af structure when deactivating peer-group from an address-family.

3 years agoMerge pull request #9029 from donaldsharp/ospfv3_stuff
Igor Ryzhov [Tue, 13 Jul 2021 08:51:15 +0000 (11:51 +0300)]
Merge pull request #9029 from donaldsharp/ospfv3_stuff

ospf6d: Correct spelling in debug

3 years agotools: Add coccinelle script for hash compare functions NULL values 9039/head
Donatas Abraitis [Tue, 13 Jul 2021 05:48:11 +0000 (08:48 +0300)]
tools: Add coccinelle script for hash compare functions NULL values

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Do not check for NULL values for vni_hash_cmp()
Donatas Abraitis [Tue, 13 Jul 2021 05:46:10 +0000 (08:46 +0300)]
bgpd: Do not check for NULL values for vni_hash_cmp()

There is no need to test for null values in the hash compare
function as that we are guaranteed to send in data in
the hash compare functions.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: XREALLOC handles NULL properly 9038/head
Donald Sharp [Mon, 12 Jul 2021 23:32:42 +0000 (19:32 -0400)]
bgpd: XREALLOC handles NULL properly

the realloc man page:

If ptr is NULL, then the call is equivalent to malloc(size)

This should be sufficient for our needs to not have to have
XMALLOC and XREALLOC

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: fix freebsd mcast group issues 9037/head
Igor Ryzhov [Mon, 12 Jul 2021 19:51:49 +0000 (22:51 +0300)]
ospf6d: fix freebsd mcast group issues

There's a delay in FreeBSD between issuing a command to leave a
multicast group and an actual leave. If we execute "no router ospf6" and
"router ospf6" fast enough, we can end up in a situation when OS
performs the leave later than it performs the join and the interface
remains without a multicast group.

Instead of counting on a one second delay, we must wait until the
interface actually leaves the group.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: hash compare functions never receive null values 9036/head
Donald Sharp [Mon, 12 Jul 2021 18:23:51 +0000 (14:23 -0400)]
bgpd: hash compare functions never receive null values

There is no need to test for null values in the hash compare
function as that we are guaranteed to send in data in
the hash compare functions.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9027 from ton31337/fix/missing_unlock_bgp_dest
Donald Sharp [Mon, 12 Jul 2021 11:27:12 +0000 (07:27 -0400)]
Merge pull request #9027 from ton31337/fix/missing_unlock_bgp_dest

bgpd: Don't forget bgp_dest_unlock_node for bgp_static_set()

3 years agoospf6d: Correct spelling in debug 9029/head
Donald Sharp [Thu, 8 Jul 2021 18:52:19 +0000 (14:52 -0400)]
ospf6d: Correct spelling in debug

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: associate correct nexthop when using peer link-local 8961/head
Philippe Guibert [Mon, 12 Jul 2021 07:22:41 +0000 (09:22 +0200)]
bgpd: associate correct nexthop when using peer link-local

When setting bgp configuration using peers referencing link local
ipv6 addresses, the bgp should be able to handle incoming bgp
connections, and find out the appropriate interface where the
connection comes from.

ipv6 link local sessions work by using bgp unnumbered interfaces
config, but it does not work if we have a shared media with
multiple potential link local ipv6 addresses on the network.

The fix consists in finding out the appropriate interface, when
the local configuration references a link local ipv6 addresses,
and the source address used references an interface. below
configuration illustrates what can be done then:

neighbor fe80::4113:5bba:2b61:b20c remote-as 55
neighbor fe80::4113:5bba:2b61:b20c update-source eth0

note: this change does not solve the ability for such config to
create an outgoing connection to remote peer (as the link local
ipv6 address config does not indicate which interface to use).

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agobgpd: Don't forget bgp_dest_unlock_node for bgp_static_set() 9027/head
Donatas Abraitis [Sun, 11 Jul 2021 20:39:53 +0000 (23:39 +0300)]
bgpd: Don't forget bgp_dest_unlock_node for bgp_static_set()

Before returning an error, unlock bgp dest which is locked by
bgp_node_lookup().

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9004 from anlancs/fix-staticd-blackhole
Igor Ryzhov [Sat, 10 Jul 2021 06:26:58 +0000 (09:26 +0300)]
Merge pull request #9004 from anlancs/fix-staticd-blackhole

3 years agostaticd: fix late initialization of blackhole type 9004/head
anlan_cs [Thu, 8 Jul 2021 09:57:37 +0000 (05:57 -0400)]
staticd: fix late initialization of blackhole type

If a static route is added to a not-yet-existing VRF, the blackhole type
is not initialized. Initialization must be done before the VRF existence
check.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
3 years agoMerge pull request #9010 from opensourcerouting/ospf-misc
Igor Ryzhov [Fri, 9 Jul 2021 16:19:13 +0000 (19:19 +0300)]
Merge pull request #9010 from opensourcerouting/ospf-misc

doc,lib,ospfd,ospf6d: trivial improvements

3 years agoMerge pull request #9016 from LabNConsulting/chopps/ospf6d-fix-backlink-chk
Igor Ryzhov [Fri, 9 Jul 2021 12:46:43 +0000 (15:46 +0300)]
Merge pull request #9016 from LabNConsulting/chopps/ospf6d-fix-backlink-chk

ospf6d: fix backlink check

3 years agoospf6d: rework default-information configuration 9010/head
Rafael Zalamena [Wed, 7 Jul 2021 13:20:01 +0000 (10:20 -0300)]
ospf6d: rework default-information configuration

Move code to its own function and remove most of the code indentation
(e.g. test for failure and quit as soon as possible).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: document OSPFv3 debug commands
Rafael Zalamena [Thu, 8 Jul 2021 17:35:23 +0000 (14:35 -0300)]
doc: document OSPFv3 debug commands

Let users know all the available debug commands we have.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agolib,ospfd,ospf6d: remove duplicated function
Rafael Zalamena [Thu, 8 Jul 2021 17:09:20 +0000 (14:09 -0300)]
lib,ospfd,ospf6d: remove duplicated function

Move `is_default_prefix` variations to `lib/prefix.h` and make the code
use the library version instead of implementing it again.

NOTE
----

The function was split into per family versions to cover all types.
Using `union prefixconstptr` is not possible due to static analyzer
warnings which cause CI to fail.

The specific cases that would cause this failure were:
 - Caller used `struct prefix_ipv4` and called the generic function.
 - `is_default_prefix` with signature using `const struct prefix *` or
   `union prefixconstptr`.

The compiler would complain about reading bytes outside of the memory
bounds even though it did not take into account the `prefix->family`
part.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoMerge pull request #8978 from kssoman/ospf_new
Rafael Zalamena [Fri, 9 Jul 2021 10:46:11 +0000 (07:46 -0300)]
Merge pull request #8978 from kssoman/ospf_new

ospf6d : Send LSA update immediately when ospf instance is deleted

3 years agoospf6d: fix backlink check 9016/head
Christian Hopps [Fri, 9 Jul 2021 07:58:02 +0000 (03:58 -0400)]
ospf6d: fix backlink check

This code has been wrong ~ever (according to git history). There are 3
conditional blocks with the added assertion that both the LSA and the
vertex being checked can't both be network LSAs.

The third block is clearly assuming both LSA and vertex are router
LSAs b/c it is accessing the backlink and lsdesc as router lsdesc's also
making sure both are p2p links (which they would have to be to point at
each other).

The programming error here is that (A && B) == False does NOT imply !A,
but the code is written that way.

So we end up in the third block one of LSA or vertex being network LSAs
rather easily (whenever that is the case and the desc isn't the backlink
being sought).

This was caught by ASAN b/c the lsdesc and backlinks are being accessed
(> 4 byte field offsets) as if they were router lsdesc's in the third
block, when in fact one of them is a network lsdesc which is only 4
bytes long -- so ASAN flags the access beyond bounds.

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agobgpd: Inconsistency in Local BGP GR state. 9015/head
prerana [Fri, 9 Jul 2021 07:20:15 +0000 (00:20 -0700)]
bgpd: Inconsistency in Local BGP GR state.

Problem: Sometimes the configured Local GR state is not reflected in
show command and peer node. This is causing failures in few of the
BGP-GR topotests.

RCA: This problem is seen when the configuration of local GR state
happens when the BGP session is in OpenSent state and  moves to
Established after the configuration is complete.
When the session gets established, we move the GR state value from stub peer
to the config peer. This will result in overriding the GR state to
previous value.

Fix: The local GR state is modified only through CLI configuration and
does not change during BGP FSM transition. In this case it is not necessary
to transfer the GR state value from stub peer to config peer. This way we
can ensure that always the most recent config value is present in peer
datastructure.

Signed-off-by: Prerana-GB <prerana@vmware.com>
3 years agoospf6d : Send LSA update immediately when ospf instance is deleted 8978/head
Soman K.S [Sun, 4 Jul 2021 12:10:19 +0000 (17:40 +0530)]
ospf6d : Send LSA update immediately when ospf instance is deleted

Fix: The fix is to call ospf6_write to send the packet immediately to all neighbors

Signed-off-by: kssoman <somanks@gmail.com>
3 years agoMerge pull request #8997 from donaldsharp/opaque_length
Martin Winter [Thu, 8 Jul 2021 01:35:42 +0000 (03:35 +0200)]
Merge pull request #8997 from donaldsharp/opaque_length

lib: Allow ZAPI_MESSAGE_OPAQUE_LENGTH length of data

3 years agoMerge pull request #8991 from opensourcerouting/sd-coverity-fix
Donald Sharp [Thu, 8 Jul 2021 01:18:27 +0000 (21:18 -0400)]
Merge pull request #8991 from opensourcerouting/sd-coverity-fix

lib: fix coverity unused result warning

3 years agolib: Allow ZAPI_MESSAGE_OPAQUE_LENGTH length of data 8997/head
Donald Sharp [Wed, 7 Jul 2021 20:00:12 +0000 (16:00 -0400)]
lib: Allow ZAPI_MESSAGE_OPAQUE_LENGTH length of data

We are sending up to ZAPI_MESSAGE_OPAQUE_LENGTH but checking
for one less.  We know the data will fit in it to that size.
Also we have asserts on the write to ensure we don't go over
it

Fixes: #8995
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8987 from mobash-rasool/ospfv3-bug-fixes
Igor Ryzhov [Wed, 7 Jul 2021 14:28:14 +0000 (17:28 +0300)]
Merge pull request #8987 from mobash-rasool/ospfv3-bug-fixes

ospf6d: Fix crash in ospf6_asbr_lsa_remove at ospf6d/ospf6_asbr.c:696

3 years agodoc/workflow: YANG is a hard requirement 8992/head
David Lamparter [Wed, 7 Jul 2021 13:48:39 +0000 (15:48 +0200)]
doc/workflow: YANG is a hard requirement

The text didn't reflect the YANG requirement decision yet.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: fix coverity unused result warning 8991/head
David Lamparter [Wed, 7 Jul 2021 12:57:36 +0000 (14:57 +0200)]
lib: fix coverity unused result warning

There's nothing that can be done here with an error.  Try to make
Coverity understand that this is intentional.

(I don't know if the `(void)` will actually fix the coverity warning,
but I don't really have a better way to figure it out beyond just
getting this merged and waiting for a result...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agodoc/workflow: add guidelines for config knobs
David Lamparter [Wed, 7 Jul 2021 12:32:26 +0000 (14:32 +0200)]
doc/workflow: add guidelines for config knobs

This is pretty much common sense ("runtime knobs are easier to adjust
than a compile-time setting"), but maybe it should be said just for
reference.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoMerge pull request #8919 from mobash-rasool/ospfv3-fixes
Donald Sharp [Tue, 6 Jul 2021 20:13:05 +0000 (16:13 -0400)]
Merge pull request #8919 from mobash-rasool/ospfv3-fixes

ospf6d: Max aged LSAs are not getting deleted from DB

3 years agoMerge pull request #8930 from pjdruddy/ospf6_packet_debug
Donald Sharp [Tue, 6 Jul 2021 20:09:07 +0000 (16:09 -0400)]
Merge pull request #8930 from pjdruddy/ospf6_packet_debug

Ospf6 packet debug

3 years agoMerge pull request #8945 from ton31337/fix/check_only_ebgp_peer
Donald Sharp [Tue, 6 Jul 2021 20:06:54 +0000 (16:06 -0400)]
Merge pull request #8945 from ton31337/fix/check_only_ebgp_peer

bgpd: Parse as withdrawal if AS-PATH contains 0 within the path

3 years agoMerge pull request #8938 from volta-networks/fix_no_path_retries
Donald Sharp [Tue, 6 Jul 2021 19:36:46 +0000 (15:36 -0400)]
Merge pull request #8938 from volta-networks/fix_no_path_retries

pathd : Better RFC complain for two cases, no_path answer and srp_id handle

3 years agoospf6d: Fix crash in ospf6_asbr_lsa_remove at ospf6d/ospf6_asbr.c:696 8987/head
github login name [Tue, 6 Jul 2021 11:31:21 +0000 (04:31 -0700)]
ospf6d: Fix crash in ospf6_asbr_lsa_remove at ospf6d/ospf6_asbr.c:696

Issue: Crash observed when LSAs are removed from LSDB after max age
when there is no area configured.
(gdb) bt
0  raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
1  0x00007fdb190548bc in core_handler (signo=6, siginfo=0x7ffdd2f5a470, context=<optimized out>) at lib/sigevent.c:262
2  <signal handler called>
3  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
4  0x00007fdb185ad921 in __GI_abort () at abort.c:79
5  0x00007fdb1907f199 in _zlog_assert_failed (xref=xref@entry=0x55f30902aa20 <_xref.21999>, extra=extra@entry=0x0) at lib/zlog.c:581
6  0x000055f308dc4f78 in ospf6_asbr_lsa_remove (lsa=0x55f30a7546d0, asbr_entry=0x0) at ospf6d/ospf6_asbr.c:696
7  0x000055f308dd8f0d in ospf6_lsdb_remove (lsa=0x55f30a7546d0, lsdb=lsdb@entry=0x55f30a73d300) at ospf6d/ospf6_lsdb.c:166
8  0x000055f308dd9701 in ospf6_lsdb_maxage_remover (lsdb=0x55f30a73d300) at ospf6d/ospf6_lsdb.c:376
9  0x000055f308dee724 in ospf6_maxage_remover (thread=<optimized out>) at ospf6d/ospf6_top.c:603
10 0x00007fdb1906520d in thread_call (thread=thread@entry=0x7ffdd2f5ae90) at lib/thread.c:1919
11 0x00007fdb19023e48 in frr_run (master=0x55f30a569b70) at lib/libfrr.c:1155
12 0x000055f308dc09b6 in main (argc=6, argv=0x7ffdd2f5b198, envp=<optimized out>) at ospf6d/ospf6_main.c:235
(gdb)

Steps to reproduce the issue:
1. router ospf6
2. redistribute static
3. ipv6 route 1::1/128 Null0
4. no redistribute static
5. wait for Max aged LSA to flush
6. Check DB, crash occurs.

RCA:
Crash occurred while accessing listgetdata(listhead(ospf6->area_list))
When there is no area attached to any of the interface listhead(ospf6->area_list)
is NULL. Therefore it crashed due to NULL access.

Fix:
Check before accessing null pointer.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agoMerge pull request #8508 from opensourcerouting/systemd-no-lib
Quentin Young [Tue, 6 Jul 2021 14:54:25 +0000 (14:54 +0000)]
Merge pull request #8508 from opensourcerouting/systemd-no-lib

3 years agoMerge pull request #8942 from ton31337/fix/cleanups_2
Donald Sharp [Tue, 6 Jul 2021 13:47:41 +0000 (09:47 -0400)]
Merge pull request #8942 from ton31337/fix/cleanups_2

Another round of cleanup

3 years agoMerge pull request #8972 from ton31337/fix/bgp_extended_msg_support
Donald Sharp [Tue, 6 Jul 2021 13:41:45 +0000 (09:41 -0400)]
Merge pull request #8972 from ton31337/fix/bgp_extended_msg_support

bgpd: Extended message support potential fixes

3 years agoMerge pull request #8975 from ton31337/fix/show_ip_route_json_prefix_formatting
Donald Sharp [Tue, 6 Jul 2021 13:40:19 +0000 (09:40 -0400)]
Merge pull request #8975 from ton31337/fix/show_ip_route_json_prefix_formatting

zebra: Do not escape forward slashes for `show ip route json`

3 years agoMerge pull request #8939 from LabNConsulting/chopps/sup-bund-fixes
Donald Sharp [Tue, 6 Jul 2021 11:58:19 +0000 (07:58 -0400)]
Merge pull request #8939 from LabNConsulting/chopps/sup-bund-fixes

Speedup support bundles, fix bugs, add CLI timestamp

3 years agobgpd: Do not delete peer_af when deactivating peer-group. 8734/head
zyxwvu Shi [Wed, 26 May 2021 02:33:55 +0000 (10:33 +0800)]
bgpd: Do not delete peer_af when deactivating peer-group.

There is no peer_af allocated in `peer_activate`. Trying to delete
the structure just results in an no-op and a error return value.
The error message "couldn't delete af structure for peer" is
unexpected.

Signed-off-by: zyxwvu Shi <shiyuchen.syc@bytedance.com>
3 years agoMerge pull request #8958 from pguibert6WIND/choose_ipv6_linklocal_nht
Donatas Abraitis [Tue, 6 Jul 2021 11:27:15 +0000 (14:27 +0300)]
Merge pull request #8958 from pguibert6WIND/choose_ipv6_linklocal_nht

bgpd: nht unresolved with global address next-hop

3 years agoMerge pull request #8976 from ton31337/fix/bgp_dest_unlock_node
Patrick Ruddy [Tue, 6 Jul 2021 08:03:40 +0000 (09:03 +0100)]
Merge pull request #8976 from ton31337/fix/bgp_dest_unlock_node

bgpd: Unlock bgp_dest for bgp_distance_unset if distance does not match