]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
3 years agoMerge pull request #9166 from idryzhov/vtysh-enable
Donald Sharp [Mon, 26 Jul 2021 11:22:03 +0000 (07:22 -0400)]
Merge pull request #9166 from idryzhov/vtysh-enable

vtysh: another take at "enable" in vtysh user mode

3 years agoMerge pull request #8637 from opensourcerouting/pim-vrf-acl-fixes
Donatas Abraitis [Mon, 26 Jul 2021 09:20:54 +0000 (12:20 +0300)]
Merge pull request #8637 from opensourcerouting/pim-vrf-acl-fixes

Pim vrf acl fixes

3 years agovtysh: don't install "enable" command in user mode
Igor Ryzhov [Fri, 23 Jul 2021 15:38:20 +0000 (18:38 +0300)]
vtysh: don't install "enable" command in user mode

Recent change in d1b287e only fixed the problem for 3-letter words.

We were still displaying error for longer words starting with "ena":
```
nfware> enac
% Command not allowed: enable
nfware> enad
% Command not allowed: enable
nfware> enaena
% Command not allowed: enable
```

If we don't allow "enable" command in user mode, why add it at all?

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9120 from taspelund/remove_rmac_seq
Donatas Abraitis [Fri, 23 Jul 2021 05:39:56 +0000 (08:39 +0300)]
Merge pull request #9120 from taspelund/remove_rmac_seq

zebra: Remove MM seq from evpn rmac json output

3 years agoMerge pull request #9116 from donaldsharp/vtysh_enable
Donatas Abraitis [Fri, 23 Jul 2021 05:33:02 +0000 (08:33 +0300)]
Merge pull request #9116 from donaldsharp/vtysh_enable

vtysh: Handle `en` better when in -u for vtysh

3 years agoMerge pull request #9126 from donaldsharp/rpki_spacing
Donatas Abraitis [Fri, 23 Jul 2021 05:27:37 +0000 (08:27 +0300)]
Merge pull request #9126 from donaldsharp/rpki_spacing

bgpd: Fix rpki spacing to be 1 for indentation

3 years agobgpd: Fix rpki spacing to be 1 for indentation
Donald Sharp [Thu, 22 Jul 2021 20:53:15 +0000 (16:53 -0400)]
bgpd: Fix rpki spacing to be 1 for indentation

The rpki sub-node was outputting 2 spaces instead
of 1 space.  Let's fix that to be consistent with
the rest of our code.

Fixes: #2738
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Remove MM seq from evpn rmac json output
Trey Aspelund [Thu, 1 Apr 2021 04:43:55 +0000 (04:43 +0000)]
zebra: Remove MM seq from evpn rmac json output

Currently 'show evpn rmac vni .. mac .. json' includes fields for
localSequence and remoteSequence, which are misleading since they
aren't applicable to a macs in the IP-VRF mac table (RMAC).
This removes the localSequence + remoteSequence fields from the output.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
3 years agovtysh: Handle `en` better when in -u for vtysh
Donald Sharp [Thu, 22 Jul 2021 15:59:25 +0000 (11:59 -0400)]
vtysh: Handle `en` better when in -u for vtysh

vtysh was unable to distinguish between end and ena.  The
code can now do so:

sharpd@eva ~/frr5 (master)> sudo vtysh/vtysh -u sharpd

Hello, this is FRRouting (version 8.1-dev).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

eva> e
% Ambiguous command: e
eva> en
% Command not allowed: enable
eva> ena
% Command not allowed: enable
eva> enab
% Command not allowed: enable
eva> enabl
% Command not allowed: enable
eva> enable
% Command not allowed: enable
eva> enb
% Unknown command: enb
eva> enc
% Unknown command: enc
eva> end
% Unknown command: end
eva> ene
% Unknown command: ene
eva> quit

Fixes: #2296
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8983 from mobash-rasool/pim-upstreaming-activity
Donald Sharp [Thu, 22 Jul 2021 12:35:06 +0000 (08:35 -0400)]
Merge pull request #8983 from mobash-rasool/pim-upstreaming-activity

pimd: Minor fixes for BSM Show CLI and Hold Timer CLI

3 years agoMerge pull request #8986 from mobash-rasool/pim-upst-2
Donald Sharp [Thu, 22 Jul 2021 12:33:24 +0000 (08:33 -0400)]
Merge pull request #8986 from mobash-rasool/pim-upst-2

pimd: To print querierIP address on the querier and nonQuerier IGMP e…

3 years agoMerge pull request #9082 from ton31337/feature/bgp_alias_route-map_match
Donald Sharp [Thu, 22 Jul 2021 12:30:15 +0000 (08:30 -0400)]
Merge pull request #9082 from ton31337/feature/bgp_alias_route-map_match

bgpd: `match alias` for route-map

3 years agoMerge pull request #9091 from gord1306/remove_lst_vlan
Donald Sharp [Thu, 22 Jul 2021 11:04:20 +0000 (07:04 -0400)]
Merge pull request #9091 from gord1306/remove_lst_vlan

zebra: trigger remove all access vlans info for access port

3 years agoMerge pull request #9102 from opensourcerouting/autoconf-fix-gcov
Donald Sharp [Wed, 21 Jul 2021 23:26:15 +0000 (19:26 -0400)]
Merge pull request #9102 from opensourcerouting/autoconf-fix-gcov

build: fix LDFLAGS confusion & gcov

3 years agoMerge pull request #9105 from idryzhov/vtysh-ls-pw
Donald Sharp [Wed, 21 Jul 2021 23:20:07 +0000 (19:20 -0400)]
Merge pull request #9105 from idryzhov/vtysh-ls-pw

vtysh, lib, zebra: fix exit from link-params and pseudowire nodes

3 years agobuild: use `--coverage` for gcov
David Lamparter [Wed, 21 Jul 2021 09:23:23 +0000 (11:23 +0200)]
build: use `--coverage` for gcov

libtool does not understand `-coverage` with a single dash.  Official
gcc docs also say `--coverage` rather than `-coverage`.  (clang lists
both.)

Also, for correct linking, libtool needs `--coverage` in LDFLAGS as
opposed to `-lgcov` (with the latter you get library ordering/deps
issues)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobuild: fix `AM_LDFLAGS` usage (and gcov)
David Lamparter [Wed, 21 Jul 2021 09:04:23 +0000 (11:04 +0200)]
build: fix `AM_LDFLAGS` usage (and gcov)

like the other automake variables, setting `xyz_LDFLAGS` causes
`AM_LDFLAGS` to be ignored for `xyz`.  For some reason I had in my mind
that automake doesn't do this for LDFLAGS, but... it does.  (Which is
consistent with `_CFLAGS` and co.)

So, all the libraries and modules have been ignoring `AM_LDFLAGS` (which
includes `SAN_FLAGS` too).  Set up new `LIB_LDFLAGS` and
`MODULE_LDFLAGS` to handle all of this correctly (and move these bits to
a central location.)

Fixes: #9034
Fixes: 0c4285d77eb ("build: properly split CFLAGS from AC_CFLAGS")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib, zebra: fix exit from link-params node
Igor Ryzhov [Wed, 21 Jul 2021 14:23:45 +0000 (17:23 +0300)]
lib, zebra: fix exit from link-params node

When exiting from link-params node, we must not decrement xpath_index
because it is not incremented when entering the node.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agovtysh: fix exit from zebra-only nodes
Igor Ryzhov [Wed, 21 Jul 2021 14:22:14 +0000 (17:22 +0300)]
vtysh: fix exit from zebra-only nodes

When exiting from link-params and pseudowire nodes, we were sending exit
command to all VTYSH_INTERFACE daemons. This led to a desynchronized
state in vtysh and daemons other then zebra. We must send exit command
only to zebra.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9094 from mjstapp/fix_pathd_pcep_localtime
Donald Sharp [Wed, 21 Jul 2021 11:48:28 +0000 (07:48 -0400)]
Merge pull request #9094 from mjstapp/fix_pathd_pcep_localtime

pathd: don't use localtime

3 years agoMerge pull request #8956 from pguibert6WIND/bgp_loop_through_itself
Donatas Abraitis [Wed, 21 Jul 2021 06:28:21 +0000 (09:28 +0300)]
Merge pull request #8956 from pguibert6WIND/bgp_loop_through_itself

bgpd: prevent routes loop through itself

3 years agodoc: Add `match alias` command for BGP route-maps
Donatas Abraitis [Sun, 18 Jul 2021 12:14:01 +0000 (15:14 +0300)]
doc: Add `match alias` command for BGP route-maps

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agotests: Check if `match alias` works for route-maps
Donatas Abraitis [Sun, 18 Jul 2021 11:36:53 +0000 (14:36 +0300)]
tests: Check if `match alias` works for route-maps

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Add route-map `match alias` command
Donatas Abraitis [Sun, 18 Jul 2021 09:14:24 +0000 (12:14 +0300)]
bgpd: Add route-map `match alias` command

Will be handy to filter BGP prefixes by using BGP community alias
instead of numerical community values.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9098 from donaldsharp/if_secondary_bsd
Renato Westphal [Wed, 21 Jul 2021 04:06:42 +0000 (01:06 -0300)]
Merge pull request #9098 from donaldsharp/if_secondary_bsd

zebra: Mark some bsd interface prefixes as SECONDARY

3 years agoMerge pull request #9095 from opensourcerouting/ospfv3-stub-def-always
Russ White [Tue, 20 Jul 2021 19:25:27 +0000 (15:25 -0400)]
Merge pull request #9095 from opensourcerouting/ospfv3-stub-def-always

ospf6d: always generate default route for stubs

3 years agoMerge pull request #9093 from rgirada/nbr_crash
Russ White [Tue, 20 Jul 2021 19:25:07 +0000 (15:25 -0400)]
Merge pull request #9093 from rgirada/nbr_crash

ospfd: ospfd crash while giving 'clear ip ospf neighbor'

3 years agoMerge pull request #9074 from mobash-rasool/pim-fixes
Donald Sharp [Tue, 20 Jul 2021 16:29:53 +0000 (12:29 -0400)]
Merge pull request #9074 from mobash-rasool/pim-fixes

pimd: IGMPv3 conformance fixes for invalid TTL and invalid TOS

3 years agozebra: Mark some bsd interface prefixes as SECONDARY
Donald Sharp [Tue, 20 Jul 2021 14:12:04 +0000 (10:12 -0400)]
zebra: Mark some bsd interface prefixes as SECONDARY

Notice when a ip address on a bsd interface is considered
an alias, let's mark the connected prefix we generate as
a SECONDARY.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agopathd: don't use localtime
Mark Stapp [Tue, 20 Jul 2021 12:52:33 +0000 (08:52 -0400)]
pathd: don't use localtime

Use localtime_r() instead of localtime() in pathd.

Signed-off-by: Mark Stapp <mjs.ietf@gmail.com>
3 years agoospf6d: always generate default route for stubs
Rafael Zalamena [Tue, 20 Jul 2021 12:43:03 +0000 (09:43 -0300)]
ospf6d: always generate default route for stubs

In RFC 2328 OSPF Version 2, Section 12.4.3.1 "Originating summary-LSAs
into stub areas" mentions that the stub areas should not import external
routes and instead should generate a 'default summary-LSA' set to
default destination.

> In a stub area, instead of importing external routes
> each area border router originates a "default summary-
> LSA" into the area. The Link State ID for the default
> summary-LSA is set to DefaultDestination, and the metric
> set to the (per-area) configurable parameter
> StubDefaultCost.  Note that StubDefaultCost need not be
> configured identically in all of the stub area's area
> border routers.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospfd: ospfd crash while giving 'clear ip ospf neighbor'
rgirada [Tue, 20 Jul 2021 11:39:05 +0000 (04:39 -0700)]
ospfd: ospfd crash while giving 'clear ip ospf neighbor'

Description:
Ospf process crashes upon giving 'clear ip ospf neighbor' with
        self routerId. It is asserting if it is a self neighbor in ospf
        neighbour kill event processing.
Added a check to validate the provided router-id is self
        router-id.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agozebra: trigger remove all access vlans for access port
gord_chen [Tue, 20 Jul 2021 09:28:37 +0000 (09:28 +0000)]
zebra: trigger remove all access vlans for access port

When port was removed from last access vlan, the linux kernel
won't send any vlan info in the netlink message, it might affact
the evpn mh not withdraw EAD-EVI routes.

Signed-off-by: Gord Chen <gord_chen@edge-core.com>
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 agopimd: Add TOS check for IGMP conformance
Mobashshera Rasool [Mon, 19 Jul 2021 19:31:56 +0000 (19:31 +0000)]
pimd: Add TOS check for IGMP conformance

IGMPv3 packets with invalid TOS should be dropped.
Test Case ID: 4.10
TEST_DESCRIPTION
Every IGMP message described in this document is sent with
IP Precedence of Internetwork Control (e.g., Type of Service
0xc0)
(Tests that IGMPv3 Membership Query Message conforms to
above statement)
TEST_REFERENCE
NEGATIVE: RFC 3376, IGMP Version 3, s4 p7 Message Formats
Issue: #9071

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agopimd: Add TTL check for IGMP conformance
Mobashshera Rasool [Mon, 19 Jul 2021 19:29:09 +0000 (19:29 +0000)]
pimd: Add TTL check for IGMP conformance

IGMPv3 packets with invalid TTL should be dropped.
Test Case ID: 4.10
TEST_DESCRIPTION
Every IGMP message described in this document is sent with an IP
Time-to-Live of 1 (Tests that IGMPv3 Membership Report Message
conforms to above statement)
TEST_REFERENCE
NEGATIVE: RFC 3376, IGMP Version 3, s4 p7 Message Formats
Issue: #9070

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agopimd: Abstracting header verification for igmp
Mobashshera Rasool [Fri, 16 Jul 2021 11:55:56 +0000 (11:55 +0000)]
pimd: Abstracting header verification for igmp

Moving the header verification checks inside a function.

Signed-off-by: Mobashshera Rasool <mrassol@vmware.com>
3 years agozebra: replace ipaddr2str in dplane module
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
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
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
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
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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 agobgp_basic_functionality: fix pylint errors
Philippe Guibert [Mon, 12 Jul 2021 07:03:22 +0000 (09:03 +0200)]
bgp_basic_functionality: fix pylint errors

fix pylint errors found.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>