]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoMerge pull request #7261 from Niral-Networks/niral_dev_vrf_ospf6
Rafael Zalamena [Tue, 3 Nov 2020 14:59:38 +0000 (11:59 -0300)]
Merge pull request #7261 from Niral-Networks/niral_dev_vrf_ospf6

ospf6d : Transformation changes for ospf6 vrf support.

3 years agoMerge pull request #6795 from rgirada/ospf_db_json
Olivier Dugeon [Tue, 3 Nov 2020 14:42:03 +0000 (15:42 +0100)]
Merge pull request #6795 from rgirada/ospf_db_json

ospfd: json support for ospf database command.

3 years agoMerge pull request #6922 from rgirada/ospf_summarisation
Olivier Dugeon [Tue, 3 Nov 2020 14:34:36 +0000 (15:34 +0100)]
Merge pull request #6922 from rgirada/ospf_summarisation

ospfd: Implementation of ospf external route summarization.

3 years agoMerge pull request #7427 from mjstapp/dplane_intf_info
Russ White [Tue, 3 Nov 2020 12:44:45 +0000 (07:44 -0500)]
Merge pull request #7427 from mjstapp/dplane_intf_info

zebra: add optional extra data about routes' interfaces

3 years agoMerge pull request #7442 from qlyoung/fix-thread-tracepoint-pointer
Russ White [Tue, 3 Nov 2020 12:39:12 +0000 (07:39 -0500)]
Merge pull request #7442 from qlyoung/fix-thread-tracepoint-pointer

lib: fix missed pointer update

3 years agoMerge pull request #7421 from ton31337/fix/default-originate_attributes
Donald Sharp [Tue, 3 Nov 2020 12:16:31 +0000 (07:16 -0500)]
Merge pull request #7421 from ton31337/fix/default-originate_attributes

bgpd: Respect match operations for default-originate, not only prefixes

3 years agoMerge pull request #7440 from pjdruddy/fix_snmp_doc
Donald Sharp [Tue, 3 Nov 2020 00:56:23 +0000 (19:56 -0500)]
Merge pull request #7440 from pjdruddy/fix_snmp_doc

doc: fix code snippet for net-snmp

3 years agolib: fix missed pointer update
Quentin Young [Mon, 2 Nov 2020 21:22:54 +0000 (16:22 -0500)]
lib: fix missed pointer update

Function argument changed from thread * to thread ** without updating
the corresponding tracepoint.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agodoc: fix code snippet for net-snmp
Pat Ruddy [Mon, 2 Nov 2020 16:47:58 +0000 (16:47 +0000)]
doc: fix code snippet for net-snmp

incorrect formatting in doc

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoospf6d : Transformation changes for ospf6 vrf support.
harios_niral [Mon, 2 Nov 2020 16:24:21 +0000 (08:24 -0800)]
ospf6d : Transformation changes for ospf6 vrf support.

1. Reviews comments taken care.

Signed-off-by: harios_niral <hari@niralnetworks.com>
3 years agoMerge pull request #7425 from sworleys/Fix-Bgp-Dist-Help
Mark Stapp [Mon, 2 Nov 2020 12:54:00 +0000 (07:54 -0500)]
Merge pull request #7425 from sworleys/Fix-Bgp-Dist-Help

bgpd: fix help for ipv6 under distance src command

3 years agoospfd: OSPF external summarisation documentation
rgirada [Sun, 6 Sep 2020 07:21:23 +0000 (00:21 -0700)]
ospfd: OSPF external summarisation documentation

Description:
Documentation for external summarisation feature support.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoospfd: OSPF external summarisation debug support
rgirada [Sat, 5 Sep 2020 16:41:04 +0000 (09:41 -0700)]
ospfd: OSPF external summarisation debug support

Description:
Changes to enable/disable debugs for external
LSA sumarisation.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoospfd: OSPF external summarisation scenarios
rgirada [Sat, 5 Sep 2020 15:15:51 +0000 (08:15 -0700)]
ospfd: OSPF external summarisation scenarios

Description:
Aggergation handled in the following scenarios.
1. Route update from Zebra.
2. Refresh external LSA.
3. Processing routemap update.
4. Self originated lsa processing.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoospfd: OSPF external LSA summarisation show commands
rgirada [Tue, 1 Sep 2020 11:47:13 +0000 (04:47 -0700)]
ospfd: OSPF external LSA summarisation show commands

Description:
The below show command introduced to diplay all configured
summary addresss information along with matching corresponding
external route information.

show ip ospf [vrf <NAME|all>] summary-address [detail] [json]

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoospfd: External LSA summarisation config commands.
rgirada [Tue, 1 Sep 2020 07:58:47 +0000 (00:58 -0700)]
ospfd: External LSA summarisation config commands.

Description:
The following config commands introduced for external route
aggregation.

[no] summary-address A.B.C.D/M [tag (1-4294967295)]
[no] summary-address A.B.C.D/M no-advertise
aggregation timer (5-1800)
no aggregation timer

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoospfd: ospf summarisation core handlers
rgirada [Sat, 15 Aug 2020 09:55:40 +0000 (02:55 -0700)]
ospfd: ospf summarisation core handlers

Description:
Apis for creating/deleting aggregate routes.
Origination of summary route on behalf of matched external routes.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoospfd: Summarisation init/de-init.
rgirada [Sat, 15 Aug 2020 08:27:40 +0000 (01:27 -0700)]
ospfd: Summarisation init/de-init.

Description:
       Summarisation initilisation and de-init apis.
       summary route table will be created as part of initilisation
       at the time of ospf deamon init.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoospfd: summarisation specific data structures.
rgirada [Sat, 15 Aug 2020 07:27:25 +0000 (00:27 -0700)]
ospfd: summarisation specific data structures.

Description:
Data structures definitions for summary route.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoospfd: json support for ospf database command.
rgirada [Thu, 23 Jul 2020 23:25:04 +0000 (16:25 -0700)]
ospfd: json support for ospf database command.

Description:
Added json support to ospf lsdb command and its subcommands.
Added json to the following sub commands.
show ip ospf  database json
show ip ospf  database router json
show ip ospf  database network json
show ip ospf  database external json
show ip ospf  database summary json
show ip ospf  database asbr-summary json
show ip ospf  database nssa-external json
show ip ospf  databas max-age json
show ip ospf  database self-originate json

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoMerge pull request #7429 from opensourcerouting/rpm-subpkgs
Donald Sharp [Sat, 31 Oct 2020 11:08:47 +0000 (07:08 -0400)]
Merge pull request #7429 from opensourcerouting/rpm-subpkgs

RPM Subpackages for RPKI and SNMP

3 years agoospf6d : Transformation changes for ospf6 vrf support.
harios_niral [Thu, 8 Oct 2020 05:38:43 +0000 (22:38 -0700)]
ospf6d : Transformation changes for ospf6 vrf support.

1. All the changes are related to handle ospf6 with different vrf.
2. The dependancy of global ospf6 is removed.

Co-authored-by: Kaushik <kaushik@niralnetworks.com>
Signed-off-by: harios_niral <hari@niralnetworks.com>
3 years agoredhat: Update changelog in frr.spec.in
Martin Winter [Sat, 31 Oct 2020 01:19:18 +0000 (02:19 +0100)]
redhat: Update changelog in frr.spec.in

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
3 years agoredhat: Add snmp as a subpackage
Martin Winter [Sat, 31 Oct 2020 01:11:45 +0000 (02:11 +0100)]
redhat: Add snmp as a subpackage

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
3 years agoredhat: Move RPKI to subpackage instead of a RPM build option
Martin Winter [Sat, 31 Oct 2020 00:09:30 +0000 (01:09 +0100)]
redhat: Move RPKI to subpackage instead of a RPM build option

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
3 years agobgpd: fix help for ipv6 under distance src command
Stephen Worley [Fri, 30 Oct 2020 20:14:40 +0000 (16:14 -0400)]
bgpd: fix help for ipv6 under distance src command

We were missing the help docstring for IPV6 under the
distance src command in for bgp.

```
[root@alfred frr-2]# /usr/lib/frr/bgpd --log stdout --log-level debug
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
2020/10/30 16:02:26 BGP: Ran out of docstring while parsing '[no] distance (1-255) <A.B.C.D/M | X:X::X:X/M>$prefix [WORD$acl]'
```

Signed-off-by: Stephen Worley <sworley@nvidia.com>
3 years agotests: Add more tests for BGP default-originate command
Donatas Abraitis [Fri, 30 Oct 2020 10:47:44 +0000 (12:47 +0200)]
tests: Add more tests for BGP default-originate command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Handle route-maps properly for `default-originate route-map` command
Donatas Abraitis [Thu, 29 Oct 2020 19:41:12 +0000 (21:41 +0200)]
bgpd: Handle route-maps properly for `default-originate route-map` command

The problem is that only prefixes were handled and any other `match`
commands were ignored. Let's do not forget them as well.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agozebra: add optional extra data about routes' interfaces
Mark Stapp [Fri, 30 Oct 2020 14:51:54 +0000 (10:51 -0400)]
zebra: add optional extra data about routes' interfaces

Add extra data about the interfaces used in route updates'
nexthops - some consumers of route updates may want additional
data, but dataplane plugins running in the dplane pthread
cannot safely access the normal zebra data structures. Capturing
this info is optional - a plugin must request it (via an api).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7418 from donaldsharp/manuall
Mark Stapp [Fri, 30 Oct 2020 12:16:46 +0000 (08:16 -0400)]
Merge pull request #7418 from donaldsharp/manuall

*: spelling fixes

3 years agoMerge pull request #7415 from mjstapp/fix_sa_strlen
Donald Sharp [Fri, 30 Oct 2020 11:21:45 +0000 (07:21 -0400)]
Merge pull request #7415 from mjstapp/fix_sa_strlen

ospfd, zebra: Fix SA warnings

3 years agoMerge pull request #7414 from donaldsharp/32bitflags
Jafar Al-Gharaibeh [Fri, 30 Oct 2020 02:47:15 +0000 (21:47 -0500)]
Merge pull request #7414 from donaldsharp/32bitflags

zebra: Consolidate on 32 bits as the flag size for route flags

3 years agoMerge pull request #7408 from volta-networks/fix_isis_p2p_passive
Donald Sharp [Fri, 30 Oct 2020 00:21:52 +0000 (20:21 -0400)]
Merge pull request #7408 from volta-networks/fix_isis_p2p_passive

isisd: fix segfault with circuit p2p neighbor

3 years ago*: Correct spelling stuff
Donald Sharp [Thu, 29 Oct 2020 20:06:13 +0000 (16:06 -0400)]
*: Correct spelling stuff

Pretty obvious.  WE R SPELL GOOD

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7412 from donaldsharp/ospf6_stuff
Mark Stapp [Thu, 29 Oct 2020 18:57:27 +0000 (14:57 -0400)]
Merge pull request #7412 from donaldsharp/ospf6_stuff

Ospf6 stuff

3 years agoMerge pull request #7413 from donaldsharp/zebra_string
Patrick Ruddy [Thu, 29 Oct 2020 18:45:36 +0000 (18:45 +0000)]
Merge pull request #7413 from donaldsharp/zebra_string

zebra: Don't do expensive string manip if not in debug

3 years agozebra: clean up zebra_protodown_rc_str()
Mark Stapp [Thu, 29 Oct 2020 16:03:25 +0000 (12:03 -0400)]
zebra: clean up zebra_protodown_rc_str()

Clean up api SA warning, use 'const', and replace snprintf+
pointer math with strlcat.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoospfd: clean up SA warning in ospf_finish_final()
Mark Stapp [Thu, 29 Oct 2020 16:02:40 +0000 (12:02 -0400)]
ospfd: clean up SA warning in ospf_finish_final()

Clean up an SA warning.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agozebra: Consolidate on 32 bits as the flag size for route flags
Donald Sharp [Thu, 15 Oct 2020 17:41:30 +0000 (13:41 -0400)]
zebra: Consolidate on 32 bits as the flag size for route flags

When we get a route for installation via any method we should
consolidate on 32 bits as the flag size, since we have
actually more than 8 bits of data to bass around.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Don't do expensive string manip if not in debug
Donald Sharp [Mon, 26 Oct 2020 13:19:18 +0000 (09:19 -0400)]
zebra: Don't do expensive string manip if not in debug

Modify the code to not load up a string that is only used
in debugging unless we are debugging.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Give a bit more data when sendmsg fails
Donald Sharp [Thu, 29 Oct 2020 12:53:43 +0000 (08:53 -0400)]
ospf6d: Give a bit more data when sendmsg fails

When sendmsg fails add a bit more data in hopes we can
figure out what is going wrong.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: ifindex should not be a pointer for ospf6_sendmsg
Donald Sharp [Thu, 29 Oct 2020 10:59:42 +0000 (06:59 -0400)]
ospf6d: ifindex should not be a pointer for ospf6_sendmsg

Let's cleanup the ospf6_sendmsg api and not pass in a pointer
to the ifindex to use.  It's an integer.

Also remove the assert(*ifindex);  We never use ifindex of 0

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Clean up ospf6_network.h header
Donald Sharp [Thu, 29 Oct 2020 10:55:04 +0000 (06:55 -0400)]
ospf6d: Clean up ospf6_network.h header

Make it compliant.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: fix segfault in the circuit p2p/bcast union
Emanuele Di Pascale [Thu, 29 Oct 2020 08:51:27 +0000 (09:51 +0100)]
isisd: fix segfault in the circuit p2p/bcast union

The fields in the broadcast/p2p union struct in an isis circuit are
initialized when the circuit goes up, but currently this step is
skipped if the interface is passive. This can create problems if the
circuit type (referred to as network type in the config) changes from
broadcast to point-to-point. We can end up with the p2p neighbor
pointer pointing at some garbage left by the broadcast struct in the
union, which would then cause a segfault the first time we would
dereference it - for example when building the lsp, or computing the
SPF tree.

compressed backtrace of a possible crash:
 #0  0x0000555555579a9c in lsp_build at frr/isisd/isis_lsp.c:1114
 #1  0x000055555557a516 in lsp_regenerate at frr/isisd/isis_lsp.c:1301
 #2  0x000055555557aa25 in lsp_refresh at frr/isisd/isis_lsp.c:1381
 #3  0x00007ffff7b2622c in thread_call at frr/lib/thread.c:1549
 #4  0x00007ffff7ad6df4 in frr_run at frr/lib/libfrr.c:1098
 #5  0x000055555556b67f in main at frr/isisd/isis_main.c:272

isis_lsp.c:
1112 case CIRCUIT_T_P2P: {
1113 struct isis_adjacency *nei = circuit->u.p2p.neighbor;
1114 if (nei && nei->adj_state == ISIS_ADJ_UP

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
3 years agoMerge pull request #7045 from mjstapp/fix_signals
Donald Sharp [Wed, 28 Oct 2020 23:29:29 +0000 (19:29 -0400)]
Merge pull request #7045 from mjstapp/fix_signals

lib: Resolve signal handling race in event loop

3 years agolib: avoid signal-handling race with event loop poll call
Mark Stapp [Mon, 21 Sep 2020 19:57:59 +0000 (15:57 -0400)]
lib: avoid signal-handling race with event loop poll call

Manage the main pthread's signal mask to avoid a signal-handling
race. Before entering poll, check for pending signals that the
application needs to handle. Use ppoll() to re-enable those
signals during the poll call.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agolib: add debug output for signal mask
Mark Stapp [Mon, 21 Sep 2020 20:02:06 +0000 (16:02 -0400)]
lib: add debug output for signal mask

Add an api that debugs the signals in a sigset.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7378 from donaldsharp/pbr_ifp_leak
Jafar Al-Gharaibeh [Wed, 28 Oct 2020 18:57:11 +0000 (13:57 -0500)]
Merge pull request #7378 from donaldsharp/pbr_ifp_leak

pbrd: Fix memory leak

3 years agoMerge pull request #7396 from AnuradhaKaruppiah/es-docs
Russ White [Wed, 28 Oct 2020 17:52:52 +0000 (13:52 -0400)]
Merge pull request #7396 from AnuradhaKaruppiah/es-docs

doc: Add documentation for EVPN Multihoming

3 years agoMerge pull request #7371 from AnuradhaKaruppiah/mh-uplink-tracking-1
Russ White [Wed, 28 Oct 2020 16:13:57 +0000 (12:13 -0400)]
Merge pull request #7371 from AnuradhaKaruppiah/mh-uplink-tracking-1

evpn-mh: uplink tracking and startup delay

3 years agoMerge pull request #7301 from idryzhov/ospf-fixes
Santosh P K [Wed, 28 Oct 2020 14:56:02 +0000 (20:26 +0530)]
Merge pull request #7301 from idryzhov/ospf-fixes

many ospfd fixes

3 years agoMerge pull request #7394 from donaldsharp/isis_uninited
Olivier Dugeon [Wed, 28 Oct 2020 08:11:53 +0000 (09:11 +0100)]
Merge pull request #7394 from donaldsharp/isis_uninited

isisd: Fix usage of uninited memory

3 years agoMerge pull request #7397 from donaldsharp/bgp_ecomm_leak
Donatas Abraitis [Wed, 28 Oct 2020 04:52:34 +0000 (06:52 +0200)]
Merge pull request #7397 from donaldsharp/bgp_ecomm_leak

bgpd: Prevent ecomm memory leak

3 years agoMerge pull request #7366 from eololab/add-disable-rpath-option-in-configure
Donald Sharp [Wed, 28 Oct 2020 00:20:24 +0000 (20:20 -0400)]
Merge pull request #7366 from eololab/add-disable-rpath-option-in-configure

build: add --disable-rpath option in configure

3 years agoMerge pull request #7398 from pjdruddy/fix-evpn-show-interface-test
Donald Sharp [Wed, 28 Oct 2020 00:08:10 +0000 (20:08 -0400)]
Merge pull request #7398 from pjdruddy/fix-evpn-show-interface-test

tests: do not rely on fixed indices in show output

3 years agoMerge pull request #7352 from mjstapp/fix_rt_netlink_indent
Donald Sharp [Wed, 28 Oct 2020 00:07:15 +0000 (20:07 -0400)]
Merge pull request #7352 from mjstapp/fix_rt_netlink_indent

zebra: fix strange indentation

3 years agoMerge pull request #7395 from donaldsharp/isis_rv_leak
Mark Stapp [Tue, 27 Oct 2020 20:26:09 +0000 (16:26 -0400)]
Merge pull request #7395 from donaldsharp/isis_rv_leak

isisd: Fix memory leak in copy_tlv_router_cap

3 years agotests: do not rely on fixed indices in show output
Pat Ruddy [Tue, 27 Oct 2020 19:25:55 +0000 (19:25 +0000)]
tests: do not rely on fixed indices in show output

Make tests more robust to changing show outputs by searching for
item of interest rather than using a fixed index.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agobgpd: Prevent ecomm memory leak
Donald Sharp [Tue, 27 Oct 2020 19:16:32 +0000 (15:16 -0400)]
bgpd: Prevent ecomm memory leak

There are some situations where we create a ecommunity for
comparing to internal state when we are deleting, but in the
failure cases we would not free up the created memory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: Add documentation for EVPN Multihoming
Anuradha Karuppiah [Tue, 27 Oct 2020 16:51:31 +0000 (09:51 -0700)]
doc: Add documentation for EVPN Multihoming

Added description and config commands for the various sub-features
introduced as a part of EVPN Multihoming.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agoisisd: Fix memory leak in copy_tlv_router_cap
Donald Sharp [Tue, 27 Oct 2020 16:40:46 +0000 (12:40 -0400)]
isisd: Fix memory leak in copy_tlv_router_cap

There exists a code path where we would allocate memory
then test a variable and then immediately return NULL.
Prevent memory from leaking in this situation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: add a topotest to validate uplink tracking
Anuradha Karuppiah [Thu, 22 Oct 2020 19:04:32 +0000 (12:04 -0700)]
tests: add a topotest to validate uplink tracking

When all the uplinks are disabled the access ports used for multihoming
are error-disabled/protodowned.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agotopotests: bgp-evpn-mh: configure uplinks and change the startup-delay
Anuradha Karuppiah [Wed, 23 Sep 2020 20:15:57 +0000 (13:15 -0700)]
topotests: bgp-evpn-mh: configure uplinks and change the startup-delay

1. The default startup-delay for multihomed devices is three minutes. While
that is necessary/reasonable for a real network it is not needed for a
test env. Lower the startup-delay to 1s to keep the test run time low.
2. Configure uplinks for mh uplink-tracking

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agozebra: uplink tracking and startup delay for EVPN-MH
Anuradha Karuppiah [Sat, 9 May 2020 02:11:13 +0000 (19:11 -0700)]
zebra: uplink tracking and startup delay for EVPN-MH

Local ethernet segments are held in a protodown or error-disabled state
if access to the VxLAN overlay is not ready -
1. When FRR comes up the local-ESs/access-port are kept protodown
for the startup-delay duration. During this time the underlay and
EVPN routes via it are expected to converge.
2. When all the uplinks/core-links attached to the underlay go down
the access-ports are similarly protodowned.

The ES-bond protodown state is propagated to each ES-bond member
and programmed in the dataplane/kernel (per-bond-member).

Configuring uplinks -
vtysh -c "conf t" vtysh -c "interface swp4" vtysh -c "evpn mh uplink"

Configuring startup delay -
vtysh -c "conf t" vtysh -c "evpn mh startup-delay 100"

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
EVPN protodown display -
========================
root@torm-11:mgmt:~# vtysh -c "show evpn"
L2 VNIs: 10
L3 VNIs: 3
Advertise gateway mac-ip: No
Advertise svi mac-ip: No
Duplicate address detection: Disable
  Detection max-moves 5, time 180
EVPN MH:
  mac-holdtime: 60s, neigh-holdtime: 60s
  startup-delay: 180s, start-delay-timer: 00:01:14 <<<<<<<<<<<<
  uplink-cfg-cnt: 4, uplink-active-cnt: 4
  protodown: startup-delay <<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond protodown display -
===========================
root@torm-11:mgmt:~# vtysh -c "show interface hostbond1"
Interface hostbond1 is up, line protocol is down
  Link ups:       0    last: (never)
  Link downs:     1    last: 2020/04/26 20:38:03.53
  PTM status: disabled
  vrf: default
  OS Description: Local Node/s torm-11 and Ports swp5 <==> Remote  Node/s hostd-11 and Ports swp1
  index 58 metric 0 mtu 9152 speed 4294967295
  flags: <UP,BROADCAST,MULTICAST>
  Type: Ethernet
  HWaddr: 00:02:00:00:00:35
  Interface Type bond
  Master interface: bridge
  EVPN-MH: ES id 1 ES sysmac 00:00:00:00:01:11
  protodown: off rc: startup-delay  <<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ES-bond member protodown display -
==================================
root@torm-11:mgmt:~# vtysh -c "show interface swp5"
Interface swp5 is up, line protocol is down
  Link ups:       0    last: (never)
  Link downs:     3    last: 2020/04/26 20:38:03.52
  PTM status: disabled
  vrf: default
  index 7 metric 0 mtu 9152 speed 10000
  flags: <UP,BROADCAST,MULTICAST>
  Type: Ethernet
  HWaddr: 00:02:00:00:00:35
  Interface Type Other
  Master interface: hostbond1
  protodown: on rc: startup-delay <<<<<<<<<<<<<<<<
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agoMerge pull request #7158 from AnuradhaKaruppiah/mh-df-election
Patrick Ruddy [Tue, 27 Oct 2020 16:09:45 +0000 (16:09 +0000)]
Merge pull request #7158 from AnuradhaKaruppiah/mh-df-election

evpn-mh: support for DF election

3 years agozebra: fix strange indentation
Mark Stapp [Tue, 20 Oct 2020 18:04:48 +0000 (14:04 -0400)]
zebra: fix strange indentation

Fix some odd indentation in rt_netlink.c - merge damage, maybe?

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7381 from sworleys/NHG-Show-Proto-Filter
Mark Stapp [Tue, 27 Oct 2020 15:33:00 +0000 (11:33 -0400)]
Merge pull request #7381 from sworleys/NHG-Show-Proto-Filter

zebra: add type specifier to show nexthop-group

3 years agoMerge pull request #7390 from donaldsharp/evpn_uptime
Russ White [Tue, 27 Oct 2020 15:32:17 +0000 (11:32 -0400)]
Merge pull request #7390 from donaldsharp/evpn_uptime

Evpn uptime

3 years agoMerge pull request #7370 from eololab/add-missing-daemon-in-watchfrr-conf-file
Donald Sharp [Tue, 27 Oct 2020 15:29:26 +0000 (11:29 -0400)]
Merge pull request #7370 from eololab/add-missing-daemon-in-watchfrr-conf-file

tools: add staticd line in daemon config file

3 years agoMerge pull request #7329 from idryzhov/fix-ip-route-table
Stephen Worley [Tue, 27 Oct 2020 15:27:39 +0000 (11:27 -0400)]
Merge pull request #7329 from idryzhov/fix-ip-route-table

staticd: fix checks for table param in "ip route" commands

3 years agoMerge pull request #7189 from maduri111/bgpd-conditional-adv
Rafael Zalamena [Tue, 27 Oct 2020 15:24:24 +0000 (12:24 -0300)]
Merge pull request #7189 from maduri111/bgpd-conditional-adv

bgpd: conditional advertisement

3 years agoMerge pull request #7173 from ckishimo/force
Donald Sharp [Tue, 27 Oct 2020 15:22:23 +0000 (11:22 -0400)]
Merge pull request #7173 from ckishimo/force

ospfd: fix lsa type-7 continuously refreshed

3 years agoMerge pull request #7026 from chiragshah6/yang_nb5
Donald Sharp [Tue, 27 Oct 2020 15:18:43 +0000 (11:18 -0400)]
Merge pull request #7026 from chiragshah6/yang_nb5

*: Convert bgp afi-safis configurations to transactional clis

3 years agoMerge pull request #7341 from kssoman/nssa_fix
Olivier Dugeon [Tue, 27 Oct 2020 14:30:31 +0000 (15:30 +0100)]
Merge pull request #7341 from kssoman/nssa_fix

ospfd: External LSA not flushed when area is configured as NSSA

3 years agoisisd: Fix usage of uninited memory
Donald Sharp [Tue, 27 Oct 2020 13:59:10 +0000 (09:59 -0400)]
isisd: Fix usage of uninited memory

valgrind is showing a usage of uninited memory:

==935465== Conditional jump or move depends on uninitialised value(s)
==935465==    at 0x159E17: tlvs_area_addresses_to_adj (isis_tlvs.c:4430)
==935465==    by 0x15A4BD: isis_tlvs_to_adj (isis_tlvs.c:4568)
==935465==    by 0x1377F0: process_p2p_hello (isis_pdu.c:203)
==935465==    by 0x1391FD: process_hello (isis_pdu.c:781)
==935465==    by 0x13BDBE: isis_handle_pdu (isis_pdu.c:1700)
==935465==    by 0x13BECD: isis_receive (isis_pdu.c:1744)
==935465==    by 0x49210FF: thread_call (thread.c:1585)
==935465==    by 0x48CFACB: frr_run (libfrr.c:1099)
==935465==    by 0x1218C9: main (isis_main.c:272)
==935465==
==935465== Conditional jump or move depends on uninitialised value(s)
==935465==    at 0x483EEC5: bcmp (vg_replace_strmem.c:1111)
==935465==    by 0x15A290: tlvs_ipv4_addresses_to_adj (isis_tlvs.c:4512)
==935465==    by 0x15A4EB: isis_tlvs_to_adj (isis_tlvs.c:4570)
==935465==    by 0x1377F0: process_p2p_hello (isis_pdu.c:203)
==935465==    by 0x1391FD: process_hello (isis_pdu.c:781)
==935465==    by 0x13BDBE: isis_handle_pdu (isis_pdu.c:1700)
==935465==    by 0x13BECD: isis_receive (isis_pdu.c:1744)
==935465==    by 0x49210FF: thread_call (thread.c:1585)
==935465==    by 0x48CFACB: frr_run (libfrr.c:1099)
==935465==    by 0x1218C9: main (isis_main.c:272)

Effectively we are reallocing memory to hold data.  realloc does not
set the new memory to anything.  So whatever happens to be in the memory
is what is there.  after the realloc happens we are iterating over the
memory just realloced and doing memcmp's to values in it causing these
use of uninitialized memory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: conditional advertisement - copyright
Madhuri Kuruganti [Tue, 27 Oct 2020 10:43:42 +0000 (16:13 +0530)]
bgpd: conditional advertisement - copyright

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
3 years agobgpd: conditional advertisement - topotests-2
Madhuri Kuruganti [Fri, 23 Oct 2020 16:09:12 +0000 (21:39 +0530)]
bgpd: conditional advertisement - topotests-2

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
3 years agobgpd: conditional advertisement - topotests
Madhuri Kuruganti [Tue, 13 Oct 2020 20:14:27 +0000 (01:44 +0530)]
bgpd: conditional advertisement - topotests

Router2# show ip bgp neighbors 10.10.20.3 json

!--- Output suppressed.

    "addressFamilyInfo":{
      "ipv4Unicast":{
        "updateGroupId":2,
        "subGroupId":2,
        "packetQueueLength":0,
        "inboundSoftConfigPermit":true,
        "commAttriSentToNbr":"extendedAndStandard",
        "advertiseMap":{
          "condition":"NON_EXIST",
          "conditionMap":"EXIST-MAP",
          "advertiseMap":"ADV-MAP",
          "advertiseStatus":"Withdraw"
        },
        "acceptedPrefixCounter":0,
        "sentPrefixCounter":2
      },
      "ipv6Unicast":{
        "inboundSoftConfigPermit":true,
        "commAttriSentToNbr":"extendedAndStandard",
        "advertiseMap":{
          "condition":"EXIST",
          "conditionMap":"ALLOW_ALL",
          "advertiseMap":"ALLOW_ALL",
          "advertiseStatus":"Advertise"
        },
        "acceptedPrefixCounter":0
      }
    },

!--- Output suppressed.

router@router:~/frr/tests/topotests/bgp_conditional_advertisement$ sudo pytest -s test_bgp_conditional_advertisement.py
[sudo] password for router:
mkdir: cannot create directory â€˜/tmp/topotests’: File exists
2020-10-14 17:00:46,649 INFO: Running environment diagnostics
=========================================================================================== test session starts ============================================================================================
platform linux2 -- Python 2.7.17, pytest-4.6.11, py-1.9.0, pluggy-0.13.1
rootdir: /home/router/frr/tests/topotests, inifile: pytest.ini
collected 2 items

test_bgp_conditional_advertisement.py 2020-10-14 17:00:47,137 INFO: Testsuite start time: Wed Oct 14 17:00:47 2020
2020-10-14 17:00:47,137 INFO: ========================================
2020-10-14 17:00:47,138 INFO: Running setup_module to create topology
2020-10-14 17:00:48,711 INFO: loading topology: bgp_conditional_advertisement.test_bgp_conditional_advertisement
2020-10-14 17:00:48,712 INFO: starting topology: bgp_conditional_advertisement.test_bgp_conditional_advertisement
2020-10-14 17:00:49,042 INFO: r1: running version: 7.6-dev-MyOwnFRRVersion-gd77fe2dd0
2020-10-14 17:00:51,284 INFO: r2: running version: 7.6-dev-MyOwnFRRVersion-gd77fe2dd0
2020-10-14 17:00:53,582 INFO: r3: running version: 7.6-dev-MyOwnFRRVersion-gd77fe2dd0
2020-10-14 17:00:55,826 INFO: Running setup_module() done
2020-10-14 17:00:57,747 INFO: '_all_routes_advertised' polling started (interval 1 secs, maximum wait 130 secs)
2020-10-14 17:00:58,262 INFO: '_all_routes_advertised' succeeded after 0.52 seconds
2020-10-14 17:00:58,262 INFO: TC11: "router3" BGP convergence - PASSED!!!
2020-10-14 17:00:58,863 INFO: '_exist_map_routes_present' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:00:59,419 INFO: '_exist_map_routes_present' succeeded after 0.56 seconds
2020-10-14 17:00:59,419 INFO: TC21: exist-map routes present in "router2" BGP table - PASSED!!!
2020-10-14 17:01:00,017 INFO: '_exist_map_routes_not_present' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:02:00,192 INFO: '_exist_map_routes_not_present' succeeded after 60.18 seconds
2020-10-14 17:02:00,192 INFO: TC22: exist-map routes not present in "router2" BGP table - PASSED!!!
2020-10-14 17:02:00,736 INFO: '_non_exist_map_routes_not_present' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:02:59,215 INFO: '_non_exist_map_routes_not_present' succeeded after 58.48 seconds
2020-10-14 17:02:59,215 INFO: TC31: non-exist-map routes not present in "router2" BGP table - PASSED!!!
2020-10-14 17:02:59,968 INFO: '_non_exist_map_routes_present' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:03:59,300 INFO: '_non_exist_map_routes_present' succeeded after 59.33 seconds
2020-10-14 17:03:59,300 INFO: TC32: non-exist-map routes present in "router2" BGP table - PASSED!!!
2020-10-14 17:03:59,919 INFO: '_non_exist_map_no_condition_route_map' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:05:00,306 INFO: '_non_exist_map_no_condition_route_map' succeeded after 60.39 seconds
2020-10-14 17:05:00,306 INFO: TC41: non-exist-map route-map removed in "router2" - PASSED!!!
2020-10-14 17:05:01,024 INFO: '_exist_map_no_condition_route_map' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:05:59,405 INFO: '_exist_map_no_condition_route_map' succeeded after 58.38 seconds
2020-10-14 17:05:59,406 INFO: TC42: exist-map route-map removed in "router2" - PASSED!!!
2020-10-14 17:05:59,941 INFO: '_exist_map_routes_present_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:06:59,622 INFO: '_exist_map_routes_present_rmap_filter' succeeded after 59.68 seconds
2020-10-14 17:06:59,622 INFO: TC51: exist-map routes present with route-map filter - PASSED!!!
2020-10-14 17:07:00,150 INFO: '_exist_map_routes_present_no_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:07:00,688 INFO: '_exist_map_routes_present_no_rmap_filter' succeeded after 0.54 seconds
2020-10-14 17:07:00,688 INFO: TC52: exist-map routes present, no route-map filter - PASSED!!!
2020-10-14 17:07:01,229 INFO: '_non_exist_map_routes_present_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:07:01,767 INFO: '_non_exist_map_routes_present_rmap_filter' succeeded after 0.54 seconds
2020-10-14 17:07:01,767 INFO: TC53: non-exist-map routes present, with route-map filter - PASSED!!!
2020-10-14 17:07:02,321 INFO: '_non_exist_map_routes_present_no_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:08:00,419 INFO: '_non_exist_map_routes_present_no_rmap_filter' succeeded after 58.10 seconds
2020-10-14 17:08:00,419 INFO: TC54: non-exist-map routes present, no route-map filter - PASSED!!!
2020-10-14 17:08:01,485 INFO: '_exist_map_routes_not_present_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:08:02,039 INFO: '_exist_map_routes_not_present_rmap_filter' succeeded after 0.55 seconds
2020-10-14 17:08:02,039 INFO: TC61: exist-map routes not present, route-map filter - PASSED!!!
2020-10-14 17:08:02,568 INFO: '_exist_map_routes_not_present_no_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:08:59,147 INFO: '_exist_map_routes_not_present_no_rmap_filter' succeeded after 56.58 seconds
2020-10-14 17:08:59,147 INFO: TC62: exist-map routes not present, no route-map filter - PASSED!!!
2020-10-14 17:08:59,686 INFO: '_non_exist_map_routes_not_present_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:09:59,354 INFO: '_non_exist_map_routes_not_present_rmap_filter' succeeded after 59.67 seconds
2020-10-14 17:09:59,354 INFO: TC63: non-exist-map routes not present, route-map filter - PASSED!!!
2020-10-14 17:09:59,886 INFO: '_non_exist_map_routes_not_present_no_rmap_filter' polling started (interval 1 secs, maximum wait 90 secs)
2020-10-14 17:10:00,424 INFO: '_non_exist_map_routes_not_present_no_rmap_filter' succeeded after 0.54 seconds
2020-10-14 17:10:00,424 INFO: TC64: non-exist-map routes not present, no route-map filter - PASSED!!!
.2020-10-14 17:10:01,989 INFO: assert skipped at "bgp_conditional_advertisement.test_bgp_conditional_advertisement/test_memory_leak": Memory leak test/report is disabled
s2020-10-14 17:10:01,989 INFO: Running teardown_module to delete topology
2020-10-14 17:10:01,990 INFO: stopping topology: bgp_conditional_advertisement.test_bgp_conditional_advertisement
2020-10-14 17:10:01,990 INFO: stopping "s2"
2020-10-14 17:10:01,990 INFO: stopping "s1"
2020-10-14 17:10:01,993 INFO: r1: stopping bgpd
2020-10-14 17:10:01,995 INFO: r1: stopping staticd
2020-10-14 17:10:02,010 INFO: r1: stopping zebra
2020-10-14 17:10:02,013 INFO: r1: stopping bgpd
2020-10-14 17:10:02,015 INFO: r1: stopping zebra
2020-10-14 17:10:02,025 INFO: r1: waiting for daemons stopping: bgpd, zebra (0.1 seconds)
2020-10-14 17:10:02,143 INFO: r2: stopping bgpd
2020-10-14 17:10:02,147 INFO: r2: stopping staticd
2020-10-14 17:10:02,152 INFO: r2: stopping zebra
2020-10-14 17:10:02,156 INFO: r2: stopping bgpd
2020-10-14 17:10:02,164 INFO: r2: stopping zebra
2020-10-14 17:10:02,175 INFO: r2: waiting for daemons stopping: zebra (0.1 seconds)
2020-10-14 17:10:02,291 INFO: r3: stopping bgpd
2020-10-14 17:10:02,302 INFO: r3: stopping staticd
2020-10-14 17:10:02,309 INFO: r3: stopping zebra
2020-10-14 17:10:02,313 INFO: r3: stopping bgpd
2020-10-14 17:10:02,316 INFO: r3: stopping zebra
2020-10-14 17:10:02,323 INFO: r3: waiting for daemons stopping: zebra (0.1 seconds)
2020-10-14 17:10:03,615 INFO: Testsuite end time: Wed Oct 14 17:10:03 2020
2020-10-14 17:10:03,615 INFO: ========================================

================================================================================== 1 passed, 1 skipped in 556.55 seconds ===================================================================================

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
temp

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
3 years agobgpd: conditional advertisement - comments addressed and few checks
Madhuri Kuruganti [Fri, 9 Oct 2020 08:29:49 +0000 (13:59 +0530)]
bgpd: conditional advertisement - comments addressed and few checks

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
3 years agobgpd: conditional advertisement - comments addressed
Madhuri Kuruganti [Wed, 7 Oct 2020 12:10:00 +0000 (17:40 +0530)]
bgpd: conditional advertisement - comments addressed

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
3 years agobgpd: conditional advertisement - other match rules support
Madhuri Kuruganti [Mon, 5 Oct 2020 17:40:56 +0000 (23:10 +0530)]
bgpd: conditional advertisement - other match rules support

Sample Configuration with prefix-list and community match rules
---------------------------------------------------------------

R1 ------- R2(DUT) ------- R3

Router2# show running-config
Building configuration...

Current configuration:
!
frr version 7.6-dev-MyOwnFRRVersion
frr defaults traditional
hostname router
log file /var/log/frr/bgpd.log
log syslog informational
hostname Router2
service integrated-vtysh-config
!
debug bgp updates in
debug bgp updates out
!
debug route-map
!
ip route 20.20.0.0/16 blackhole
ipv6 route 2001:db8::200/128 blackhole
!
interface enp0s9
 ip address 10.10.10.2/24
!
interface enp0s10
 ip address 10.10.20.2/24
!
interface lo
 ip address 2.2.2.2/32
!
router bgp 2
 bgp log-neighbor-changes
 no bgp ebgp-requires-policy
 neighbor 10.10.10.1 remote-as 1
 neighbor 10.10.20.3 remote-as 3
 !
 address-family ipv4 unicast
  neighbor 10.10.10.1 soft-reconfiguration inbound
  neighbor 10.10.20.3 soft-reconfiguration inbound
  neighbor 10.10.20.3 advertise-map ADV-MAP non-exist-map EXIST-MAP
 exit-address-family
!
ip prefix-list DEFAULT seq 5 permit 1.1.1.5/32
ip prefix-list DEFAULT seq 10 permit 1.1.1.1/32
ip prefix-list EXIST seq 5 permit 10.10.10.10/32
ip prefix-list DEFAULT-ROUTE seq 5 permit 0.0.0.0/0
ip prefix-list IP1 seq 5 permit 10.139.224.0/20
ip prefix-list T2 seq 5 permit 1.1.1.5/32
!
bgp community-list standard DC-ROUTES seq 5 permit 64952:3008
bgp community-list standard DC-ROUTES seq 10 permit 64671:501
bgp community-list standard DC-ROUTES seq 15 permit 64950:3009
bgp community-list standard DEFAULT-ROUTE seq 5 permit 65013:200
!
route-map ADV-MAP permit 10
 match ip address prefix-list IP1
!
route-map ADV-MAP permit 20
 match community DC-ROUTES
!
route-map EXIST-MAP permit 10
 match community DEFAULT-ROUTE
 match ip address prefix-list DEFAULT-ROUTE
!
line vty
!
end
Router2#

Router2# show ip bgp 0.0.0.0
BGP routing table entry for 0.0.0.0/0
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  10.10.10.1 10.10.20.3
  1
    10.10.10.1 from 10.10.10.1 (10.139.224.1)
      Origin IGP, metric 0, valid, external, best (First path received)
      Community: 64848:3011 65011:200 65013:200
      Last update: Tue Oct  6 02:39:42 2020
Router2#

Sample output with non-exist-map when default route present in table
--------------------------------------------------------------------
Router2# show ip bgp
BGP table version is 4, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network          Next Hop            Metric LocPrf Weight Path
*> 0.0.0.0/0        10.10.10.1               0             0 1 i
*> 1.1.1.1/32       10.10.10.1               0             0 1 i
*> 1.1.1.5/32       10.10.10.1               0             0 1 i
*> 10.139.224.0/20  10.10.10.1               0             0 1 ?

Displayed  4 routes and 4 total paths

Router2# show ip bgp neighbors 10.10.20.3 advertised-routes
BGP table version is 4, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network          Next Hop            Metric LocPrf Weight Path
*> 0.0.0.0/0        0.0.0.0                                0 1 i
*> 1.1.1.5/32       0.0.0.0                                0 1 i    <<<<<<<<<  non-exist-map : 0.0.0.0/0 is present so, 10.139.224.0/20 not advertised

Total number of prefixes 2

Sample output with non-exist-map when default route not present in table
------------------------------------------------------------------------
Router2# show ip bgp
BGP table version is 5, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       10.10.10.1               0             0 1 i
*> 1.1.1.5/32       10.10.10.1               0             0 1 i
*> 10.139.224.0/20  10.10.10.1               0             0 1 ?

Displayed  3 routes and 3 total paths
Router2#
Router2#
Router2# show ip bgp neighbors 10.10.20.3 advertised-routes
BGP table version is 5, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       0.0.0.0                                0 1 i
*> 1.1.1.5/32       0.0.0.0                                0 1 i
*> 10.139.224.0/20  0.0.0.0                                0 1 ?                <<<<<<<<<  non-exist-map : 0.0.0.0/0 is not present so, 10.139.224.0/20 advertised

Total number of prefixes 3
Router2#

Sample output with exist-map when default route present in table
--------------------------------------------------------------------
Router2# show ip bgp
BGP table version is 8, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network          Next Hop            Metric LocPrf Weight Path
*> 0.0.0.0/0        10.10.10.1               0             0 1 i
*> 1.1.1.1/32       10.10.10.1               0             0 1 i
*> 1.1.1.5/32       10.10.10.1               0             0 1 i
*> 10.139.224.0/20  10.10.10.1               0             0 1 ?

Displayed  4 routes and 4 total paths
Router2#
Router2#
Router2#
Router2#
Router2# show ip bgp neighbors 10.10.20.3 advertised-routes
BGP table version is 8, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network          Next Hop            Metric LocPrf Weight Path
*> 0.0.0.0/0        0.0.0.0                                0 1 i
*> 1.1.1.1/32       0.0.0.0                                0 1 i
*> 1.1.1.5/32       0.0.0.0                                0 1 i
*> 10.139.224.0/20  0.0.0.0                                0 1 ? <<<<<<<<<  exist-map : 0.0.0.0/0 is present so, 10.139.224.0/20 advertised

Total number of prefixes 4
Router2#

Sample output with exist-map when default route not present in table
--------------------------------------------------------------------
Router2# show ip bgp
BGP table version is 9, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.1/32       10.10.10.1               0             0 1 i
*> 1.1.1.5/32       10.10.10.1               0             0 1 i
*> 10.139.224.0/20  10.10.10.1               0             0 1 ?

Displayed  3 routes and 3 total paths
Router2#
Router2#
Router2#
Router2# show ip bgp neighbors 10.10.20.3 advertised-routes
BGP table version is 9, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network          Next Hop            Metric LocPrf Weight Path
*> 1.1.1.5/32       0.0.0.0                                0 1 i <<<<<<<<<  exist-map : 0.0.0.0/0 is not present so, 10.139.224.0/20 not advertised

Total number of prefixes 1
Router2#

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
3 years agobgpd: conditional advertisement - with route-map filter
Madhuri Kuruganti [Thu, 1 Oct 2020 20:40:48 +0000 (02:10 +0530)]
bgpd: conditional advertisement - with route-map filter

Sample configuration along with route-map filter
------------------------------------------------
Router2# show running-config
Building configuration...

Current configuration:
!
frr version 7.6-dev-MyOwnFRRVersion
frr defaults traditional
hostname router
log file /var/log/frr/bgpd.log
log syslog informational
hostname Router2
service integrated-vtysh-config
!
debug bgp updates in
debug bgp updates out
!
debug route-map
!
ip route 200.200.0.0/16 blackhole
ipv6 route 2001:db8::200/128 blackhole
!
interface enp0s9
 ip address 10.10.10.2/24
!
interface enp0s10
 ip address 10.10.20.2/24
!
interface lo
 ip address 2.2.2.2/24
 ipv6 address 2001:db8::2/128
!
router bgp 2
 bgp log-neighbor-changes
 no bgp ebgp-requires-policy
 neighbor 10.10.10.1 remote-as 1
 neighbor 10.10.20.3 remote-as 3
 !
 address-family ipv4 unicast
  network 2.2.2.0/24
  network 200.200.0.0/16
  neighbor 10.10.10.1 soft-reconfiguration inbound
  neighbor 10.10.10.1 route-map RMAP_PERMIT_100 out
  neighbor 10.10.10.1 advertise-map ADVERTISE non-exist-map CONDITION
  neighbor 10.10.20.3 soft-reconfiguration inbound
 exit-address-family
 !
 address-family ipv6 unicast
  network 2001:db8::2/128
  network 2001:db8::200/128
  neighbor 10.10.10.1 activate
  neighbor 10.10.10.1 soft-reconfiguration inbound
  neighbor 10.10.10.1 route-map CONDITION_6 out
  neighbor 10.10.10.1 advertise-map ADVERTISE_6 non-exist-map CONDITION_6
  neighbor 10.10.20.3 activate
  neighbor 10.10.20.3 soft-reconfiguration inbound
 exit-address-family
!
access-list CONDITION seq 5 permit 3.3.3.0/24
access-list ADVERTISE seq 6 permit 200.200.0.0/16
access-list ADVERTISE seq 7 permit 20.20.0.0/16
access-list ADVERTISE seq 5 permit 2.2.2.0/24
access-list RMAP_PERMIT_100 seq 4 permit 100.100.0.0/16
!
ipv6 access-list ADVERTISE_6 seq 5 permit 2001:db8::2/128
ipv6 access-list CONDITION_6 seq 5 permit 2001:db8::3/128
!
route-map ADVERTISE permit 10
 match ip address ADVERTISE
!
route-map CONDITION permit 10
 match ip address CONDITION
!
route-map ADVERTISE_6 permit 10
 match ipv6 address ADVERTISE_6
!
route-map CONDITION_6 permit 10
 match ipv6 address CONDITION_6
!
route-map RMAP_PERMIT_100 permit 10
 match ip address RMAP_PERMIT_100
!
line vty
!
end

Sample output when non-exist-map prefixes present in BGP table
--------------------------------------------------------------
Router2# show ip bgp all wide

For address family: IPv4 Unicast
BGP table version is 5, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 1.1.1.0/24                                   10.10.10.1                                     0             0 1 i
*> 2.2.2.0/24                                   0.0.0.0                                        0         32768 i
*> 3.3.3.0/24                                   10.10.20.3                                     0             0 3 i
*> 100.100.0.0/16                               10.10.20.3                                     0             0 3 i
*> 200.200.0.0/16                               0.0.0.0                                        0         32768 i

Displayed  5 routes and 5 total paths

For address family: IPv6 Unicast
BGP table version is 4, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 2001:db8::1/128                              fe80::a00:27ff:fecb:ad57                       0             0 1 i
*> 2001:db8::2/128                              ::                                             0         32768 i
*> 2001:db8::3/128                              fe80::a00:27ff:fe76:6738                       0             0 3 i
*> 2001:db8::200/128                            ::                                             0         32768 i

Displayed  4 routes and 4 total paths
Router2#
Router2#
Router2#
Router2#
Router2# show ip bgp all neighbors 10.10.10.1 advertised-routes wide

For address family: IPv4 Unicast
BGP table version is 5, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 100.100.0.0/16                               0.0.0.0                                                      0 3 i

Total number of prefixes 1

For address family: IPv6 Unicast
BGP table version is 4, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 2001:db8::3/128                              ::                                                           0 3 i

Total number of prefixes 1
Router2#

Sample output when non-exist-map prefixes not present in BGP table
------------------------------------------------------------------
Router2# show ip bgp all wide

For address family: IPv4 Unicast
BGP table version is 6, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 1.1.1.0/24                                   10.10.10.1                                     0             0 1 i
*> 2.2.2.0/24                                   0.0.0.0                                        0         32768 i
*> 100.100.0.0/16                               10.10.20.3                                     0             0 3 i
*> 200.200.0.0/16                               0.0.0.0                                        0         32768 i

Displayed  4 routes and 4 total paths

For address family: IPv6 Unicast
BGP table version is 5, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 2001:db8::1/128                              fe80::a00:27ff:fecb:ad57                       0             0 1 i
*> 2001:db8::2/128                              ::                                             0         32768 i
*> 2001:db8::200/128                            ::                                             0         32768 i

Displayed  3 routes and 3 total paths
Router2#

Router2# show ip bgp all neighbors 10.10.10.1 advertised-routes wide

For address family: IPv4 Unicast
BGP table version is 6, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 2.2.2.0/24                                   0.0.0.0                                        0         32768 i
*> 100.100.0.0/16                               0.0.0.0                                                      0 3 i
*> 200.200.0.0/16                               0.0.0.0                                        0         32768 i

Total number of prefixes 3

For address family: IPv6 Unicast
BGP table version is 5, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 2001:db8::2/128                              ::                                             0         32768 i

Total number of prefixes 1
Router2#

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
3 years agobgpd: conditional advertisement
Madhuri Kuruganti [Tue, 29 Sep 2020 09:46:04 +0000 (15:16 +0530)]
bgpd: conditional advertisement

Implemented as per the feature description given in the source link.

Descriprion:
The BGP conditional advertisement feature uses the non-exist-map or exist-map
and the advertise-map keywords of the neighbor advertise-map command in order
to track routes by the route prefix.

non-exist-map :
If a route prefix is not present in output of the non-exist-map command, then
the route specified by the advertise-map command is announced.

exist-map :
If a route prefix is present in output of the exist-map command, then the route
specified by the advertise-map command is announced.

The conditional BGP announcements are sent in addition to the normal
announcements that a BGP router sends to its peers.

The conditional advertisement process is triggered by the BGP scanner process,
which runs every 60 seconds. This means that the maximum time for the conditional
advertisement to take effect is 60 seconds. The conditional advertisement can take
effect sooner, depending on when the tracked route is removed from the BGP table
and when the next instance of the BGP scanner occurs.

Sample Configuration on DUT
---------------------------
Router2# show running-config
Building configuration...

Current configuration:
!
frr version 7.6-dev-MyOwnFRRVersion
frr defaults traditional
hostname router
log file /var/log/frr/bgpd.log
log syslog informational
hostname Router2
service integrated-vtysh-config
!
debug bgp updates in
debug bgp updates out
!
debug route-map
!
ip route 200.200.0.0/16 blackhole
ipv6 route 2001:db8::200/128 blackhole
!
interface enp0s9
 ip address 10.10.10.2/24
!
interface enp0s10
 ip address 10.10.20.2/24
!
interface lo
 ip address 2.2.2.2/24
 ipv6 address 2001:db8::2/128
!
router bgp 2
 bgp log-neighbor-changes
 no bgp ebgp-requires-policy
 neighbor 10.10.10.1 remote-as 1
 neighbor 10.10.20.3 remote-as 3
 !
 address-family ipv4 unicast
  network 2.2.2.0/24
  network 200.200.0.0/16
  neighbor 10.10.10.1 soft-reconfiguration inbound
  neighbor 10.10.10.1 advertise-map ADVERTISE non-exist-map CONDITION
  neighbor 10.10.20.3 soft-reconfiguration inbound
 exit-address-family
 !
 address-family ipv6 unicast
  network 2001:db8::2/128
  network 2001:db8::200/128
  neighbor 10.10.10.1 activate
  neighbor 10.10.10.1 soft-reconfiguration inbound
  neighbor 10.10.10.1 advertise-map ADVERTISE_6 non-exist-map CONDITION_6
  neighbor 10.10.20.3 activate
  neighbor 10.10.20.3 soft-reconfiguration inbound
 exit-address-family
!
access-list CONDITION seq 5 permit 3.3.3.0/24
access-list ADVERTISE seq 5 permit 2.2.2.0/24
access-list ADVERTISE seq 6 permit 200.200.0.0/16
access-list ADVERTISE seq 7 permit 20.20.0.0/16
!
ipv6 access-list ADVERTISE_6 seq 5 permit 2001:db8::2/128
ipv6 access-list CONDITION_6 seq 5 permit 2001:db8::3/128
!
route-map ADVERTISE permit 10
 match ip address ADVERTISE
!
route-map CONDITION permit 10
 match ip address CONDITION
!
route-map ADVERTISE_6 permit 10
 match ipv6 address ADVERTISE_6
!
route-map CONDITION_6 permit 10
 match ipv6 address CONDITION_6
!
line vty
!
end
Router2#

Withdraw when non-exist-map prefixes present in BGP table:
----------------------------------------------------------
Router2# show ip bgp all wide

For address family: IPv4 Unicast
BGP table version is 8, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 1.1.1.0/24                                   10.10.10.1                                     0             0 1 i
*> 2.2.2.0/24                                   0.0.0.0                                        0         32768 i
*> 3.3.3.0/24                                   10.10.20.3                                     0             0 3 i
*> 200.200.0.0/16                               0.0.0.0                                        0         32768 i

Displayed  4 routes and 4 total paths

For address family: IPv6 Unicast
BGP table version is 8, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 2001:db8::1/128                              fe80::a00:27ff:fecb:ad57                       0             0 1 i
*> 2001:db8::2/128                              ::                                             0         32768 i
*> 2001:db8::3/128                              fe80::a00:27ff:fe76:6738                       0             0 3 i
*> 2001:db8::200/128                            ::                                             0         32768 i

Displayed  4 routes and 4 total paths
Router2#

Router2# show ip bgp neighbors 10.10.10.1
BGP neighbor is 10.10.10.1, remote AS 1, local AS 2, external link

!--- Output suppressed.

 For address family: IPv4 Unicast
  Update group 9, subgroup 5
  Packet Queue length 0
  Inbound soft reconfiguration allowed
  Community attribute sent to this neighbor(all)
  Condition NON_EXIST, Condition-map *CONDITION, Advertise-map *ADVERTISE, status: Withdraw
  1 accepted prefixes

 For address family: IPv6 Unicast
  Update group 10, subgroup 6
  Packet Queue length 0
  Inbound soft reconfiguration allowed
  Community attribute sent to this neighbor(all)
  Condition NON_EXIST, Condition-map *CONDITION_6, Advertise-map *ADVERTISE_6, status: Withdraw
  1 accepted prefixes

!--- Output suppressed.

Router2#

Here 2.2.2.0/24 & 200.200.0.0/16 (prefixes in advertise-map) are withdrawn
by conditional advertisement scanner as the prefix(3.3.3.0/24) specified
by non-exist-map is present in BGP table.

Router2# show ip bgp all neighbors 10.10.10.1 advertised-routes wide

For address family: IPv4 Unicast
BGP table version is 8, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 1.1.1.0/24                                   0.0.0.0                                                      0 1 i
*> 3.3.3.0/24                                   0.0.0.0                                                      0 3 i

Total number of prefixes 2

For address family: IPv6 Unicast
BGP table version is 8, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 2001:db8::1/128                              ::                                                           0 1 i
*> 2001:db8::3/128                              ::                                                           0 3 i
*> 2001:db8::200/128                            ::                                             0         32768 i

Total number of prefixes 3
Router2#

Advertise when non-exist-map prefixes not present in BGP table:
---------------------------------------------------------------
After Removing 3.3.3.0/24 (prefix present in non-exist-map),
2.2.2.0/24 & 200.200.0.0/16 (prefixes present in advertise-map) are advertised

Router2# show ip bgp all wide

For address family: IPv4 Unicast
BGP table version is 9, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 1.1.1.0/24                                   10.10.10.1                                     0             0 1 i
*> 2.2.2.0/24                                   0.0.0.0                                        0         32768 i
*> 200.200.0.0/16                               0.0.0.0                                        0         32768 i

Displayed  3 routes and 3 total paths

For address family: IPv6 Unicast
BGP table version is 9, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 2001:db8::1/128                              fe80::a00:27ff:fecb:ad57                       0             0 1 i
*> 2001:db8::2/128                              ::                                             0         32768 i
*> 2001:db8::200/128                            ::                                             0         32768 i

Displayed  3 routes and 3 total paths
Router2#

Router2# show ip bgp neighbors 10.10.10.1

!--- Output suppressed.

 For address family: IPv4 Unicast
  Update group 9, subgroup 5
  Packet Queue length 0
  Inbound soft reconfiguration allowed
  Community attribute sent to this neighbor(all)
  Condition NON_EXIST, Condition-map *CONDITION, Advertise-map *ADVERTISE, status: Advertise
  1 accepted prefixes

 For address family: IPv6 Unicast
  Update group 10, subgroup 6
  Packet Queue length 0
  Inbound soft reconfiguration allowed
  Community attribute sent to this neighbor(all)
  Condition NON_EXIST, Condition-map *CONDITION_6, Advertise-map *ADVERTISE_6, status: Advertise
  1 accepted prefixes

!--- Output suppressed.

Router2#
Router2# show ip bgp all neighbors 10.10.10.1 advertised-routes wide

For address family: IPv4 Unicast
BGP table version is 9, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 1.1.1.0/24                                   0.0.0.0                                                      0 1 i
*> 2.2.2.0/24                                   0.0.0.0                                        0         32768 i
*> 200.200.0.0/16                               0.0.0.0                                        0         32768 i

Total number of prefixes 3

For address family: IPv6 Unicast
BGP table version is 9, local router ID is 2.2.2.2, vrf id 0
Default local pref 100, local AS 2
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

   Network                                      Next Hop                                  Metric LocPrf Weight Path
*> 2001:db8::1/128                              ::                                                           0 1 i
*> 2001:db8::2/128                              ::                                             0         32768 i
*> 2001:db8::200/128                            ::                                             0         32768 i

Total number of prefixes 3
Router2#

Signed-off-by: Madhuri Kuruganti <k.madhuri@samsung.com>
3 years agoMerge pull request #7393 from chiragshah6/mdev
Donatas Abraitis [Tue, 27 Oct 2020 09:35:37 +0000 (11:35 +0200)]
Merge pull request #7393 from chiragshah6/mdev

bgpd: fix mem leak in router bgp import vrf check

3 years agoMerge pull request #7389 from donaldsharp/no_bfdd
Donatas Abraitis [Tue, 27 Oct 2020 09:35:21 +0000 (11:35 +0200)]
Merge pull request #7389 from donaldsharp/no_bfdd

bgpd: Fix profiles compile issue when not using bfdd

3 years agoMerge pull request #7387 from dslicenc/bgp-update-delay-local
Santosh P K [Tue, 27 Oct 2020 08:44:54 +0000 (14:14 +0530)]
Merge pull request #7387 from dslicenc/bgp-update-delay-local

bgpd: delay local routes until update-delay is over

3 years agobgpd: fix mem leak in router bgp import vrf check
Chirag Shah [Tue, 27 Oct 2020 05:18:46 +0000 (22:18 -0700)]
bgpd: fix mem leak in router bgp import vrf check

==916511== 18 bytes in 2 blocks are definitely lost in loss record 7 of 147
==916511==    at 0x483877F: malloc (vg_replace_malloc.c:307)
==916511==    by 0x4BE0F0A: strdup (strdup.c:42)
==916511==    by 0x48D66CE: qstrdup (memory.c:122)
==916511==    by 0x1E6E31: bgp_vpn_leak_export (bgp_mplsvpn.c:2690)
==916511==    by 0x28E892: bgp_router_create (bgp_nb_config.c:124)
==916511==    by 0x48E05AB: nb_callback_create (northbound.c:869)
==916511==    by 0x48E0FA2: nb_callback_configuration (northbound.c:1183)
==916511==    by 0x48E13D0: nb_transaction_process (northbound.c:1308)
==916511==    by 0x48E0137: nb_candidate_commit_apply (northbound.c:741)
==916511==    by 0x48E024B: nb_candidate_commit (northbound.c:773)
==916511==    by 0x48E6B21: nb_cli_classic_commit (northbound_cli.c:64)
==916511==    by 0x48E757E: nb_cli_apply_changes (northbound_cli.c:281)

Signed-off-by: Chirag Shah <chirag@nvidia.com>
3 years agozebra: Add uptime to `show evpn mac vni ... detail`
Donald Sharp [Mon, 26 Oct 2020 20:46:03 +0000 (16:46 -0400)]
zebra: Add uptime to `show evpn mac vni ... detail`

Add the uptime a mac entry has been in the system.

New Output:

eva# show evpn mac vni all detail

VNI 1000 #MACs (local and remote) 16

MAC: 4e:2d:f3:75:ff:db
 ESI: 03:44:38:39:ff:ff:01:00:00:02
 Intf: hostbond2(10) VLAN: 1000
 Sync-info: neigh#: 0 peer-active
 Local Seq: 0 Remote Seq: 0
 Uptime: 00:00:28
 Neighbors:
    No Neighbors

MAC: 7a:a4:f2:30:dd:5d
 ESI: 03:44:38:39:ff:ff:01:00:00:01
 Intf: hostbond1(9) VLAN: 1000
 Sync-info: neigh#: 0 peer-active
 Local Seq: 0 Remote Seq: 0
 Uptime: 00:00:28
 Neighbors:
    No Neighbors

MAC: 66:9e:d7:3a:f1:f1
 Remote VTEP: 192.168.100.18
 Sync-info: neigh#: 0
 Local Seq: 0 Remote Seq: 0
 Uptime: 00:00:26
 Neighbors:
    45.0.0.5 Active
    fe80::649e:d7ff:fe3a:f1f1 Active

MAC: 26:f1:bd:5f:e1:77
 Remote ES: 03:44:38:39:ff:ff:02:00:00:02
 Sync-info: neigh#: 0
 Local Seq: 0 Remote Seq: 0
 Uptime: 00:00:23
 Neighbors:
    No Neighbors

MAC: 16:80:eb:c4:43:6d
 ESI: 03:44:38:39:ff:ff:01:00:00:01
 Intf: hostbond1(9) VLAN: 1000
 Sync-info: neigh#: 0 peer-active
 Local Seq: 0 Remote Seq: 0
 Uptime: 00:00:28
 Neighbors:
    No Neighbors

MAC: 00:00:00:00:00:22
 Remote ES: 03:44:38:39:ff:ff:02:00:00:02
 Sync-info: neigh#: 0
 Local Seq: 0 Remote Seq: 0
 Uptime: 00:00:26
 Neighbors:
    No Neighbors

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Add uptime to `show evpn arp-cache vni .. detail`
Donald Sharp [Mon, 26 Oct 2020 20:34:05 +0000 (16:34 -0400)]
zebra: Add uptime to `show evpn arp-cache vni .. detail`

Add uptime data to `show evpn arp-cache vni ... detail` command.

Effectively when we create a neighbor entry store the time it
was created.  When we modify the neighbor entry store the time it
was modified.  Display under detail output and json output.

New output:
eva# show evpn arp-cache vni all detail

VNI 1000 #ARP (IPv4 and IPv6, local and remote) 8

IP: 45.0.0.5
 Type: remote
 State: active
 Uptime: 00:01:59
 MAC: 0a:fd:87:ca:7c:00
 Sync-info: -
 Remote VTEP: 192.168.100.18
 Local Seq: 0 Remote Seq: 0
IP: fe80::8fd:87ff:feca:7c00
 Type: remote
 State: active
 Uptime: 00:01:59
 MAC: 0a:fd:87:ca:7c:00
 Sync-info: -
 Remote VTEP: 192.168.100.18
 Local Seq: 0 Remote Seq: 0
IP: fe80::14e5:c2ff:fe50:fa59
 Type: local
 State: active
 Uptime: 00:02:04
 MAC: 16:e5:c2:50:fa:59
 Sync-info: -
 Local Seq: 0 Remote Seq: 0
IP: 45.0.0.3
 Type: remote
 State: active
 Uptime: 00:02:02
 MAC: 0e:50:e8:cf:6b:eb
 Sync-info: -
 Remote VTEP: 192.168.100.16
 Local Seq: 0 Remote Seq: 0
IP: 45.0.0.2
 Type: local
 State: active
 Uptime: 00:02:05
 MAC: 16:e5:c2:50:fa:59
 Sync-info: -
 Local Seq: 0 Remote Seq: 0
IP: fe80::c50:e8ff:fecf:6beb
 Type: remote
 State: active
 Uptime: 00:02:02
 MAC: 0e:50:e8:cf:6b:eb
 Sync-info: -
 Remote VTEP: 192.168.100.16
 Local Seq: 0 Remote Seq: 0
IP: 45.0.0.4
 Type: remote
 State: active
 Uptime: 00:01:55
 MAC: 02:ad:5f:d8:da:80
 Sync-info: -
 Remote VTEP: 192.168.100.17
 Local Seq: 0 Remote Seq: 0
IP: fe80::ad:5fff:fed8:da80
 Type: remote
 State: active
 Uptime: 00:01:55
 MAC: 02:ad:5f:d8:da:80
 Sync-info: -
 Remote VTEP: 192.168.100.17
 Local Seq: 0 Remote Seq: 0
eva#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: add sigevent_check api
Mark Stapp [Wed, 2 Sep 2020 20:25:00 +0000 (16:25 -0400)]
lib: add sigevent_check api

Add an api that blocks application-handled signals (SIGINT,
SIGTERM, e.g.) then tests whether any signals have been received.
This helps to manage a race between signal reception and the poll
call in the main event loop.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7376 from mjstapp/fix_pim_align
Quentin Young [Mon, 26 Oct 2020 20:24:00 +0000 (16:24 -0400)]
Merge pull request #7376 from mjstapp/fix_pim_align

pimd: Fix pim address-of-unaligned error and use of zlog_warn

3 years agozebra,doc: add type specifier to show nexthop-group
Stephen Worley [Fri, 23 Oct 2020 18:28:50 +0000 (14:28 -0400)]
zebra,doc: add type specifier to show nexthop-group

Add a type specifier to the `show nexthop-group` command
so we can easily filter by type when using proto created
nexthop groups.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
3 years agobgpd: cleanup inet_ntoa in the bgp_evpn_mh debug logs
Anuradha Karuppiah [Mon, 19 Oct 2020 17:42:39 +0000 (10:42 -0700)]
bgpd: cleanup inet_ntoa in the bgp_evpn_mh debug logs

Replaced inet_ntoa with %pI4 in the debug logs.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agozebra: cleanup inet_ntoa usage in zebra_evpn_mh.c logs
Anuradha Karuppiah [Mon, 19 Oct 2020 17:35:44 +0000 (10:35 -0700)]
zebra: cleanup inet_ntoa usage in zebra_evpn_mh.c logs

Replaced inet_ntoa with %pI4 in the zebra debugs logs.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agotopotest: tests for evpn-mh DF via Type-4 routes
Anuradha Karuppiah [Fri, 18 Sep 2020 17:58:14 +0000 (10:58 -0700)]
topotest: tests for evpn-mh DF via Type-4 routes

Change DF preference and validate DF role.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agozebra: add json output for zebra ES, ES-EVI and access vlan dumps
Anuradha Karuppiah [Sun, 17 May 2020 17:59:30 +0000 (10:59 -0700)]
zebra: add json output for zebra ES, ES-EVI and access vlan dumps

1. ES
root@torm-11:mgmt:~# vtysh -c "show evpn es 03:44:38:39:ff:ff:01:00:00:01 json"
|python -m json.tool
{
    "accessPort": "hostbond1",
    "dfPreference": 50000,
    "esi": "03:44:38:39:ff:ff:01:00:00:01",
    "flags": [
        "local",
        "remote",
        "readyForBgp",
        "bridgePort",
        "operUp",
        "nexthopGroupActive"
    ],
    "macCount": 10,
    "nexthopGroup": 536870913,
    "vniCount": 10,
    "vteps": [
        {
            "dfAlgorithm": "preference",
            "dfPreference": 32767,
            "nexthopId": 268435460,
            "vtep": "27.0.0.16"
        },
        {
            "dfAlgorithm": "preference",
            "dfPreference": 32767,
            "nexthopId": 268435463,
            "vtep": "27.0.0.17"
        }
    ]
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

2. ES-EVI -
root@torm-11:mgmt:~# vtysh -c "show evpn es-evi vni 1001 detail json" |python -m json.tool
[
    {
        "esi": "03:44:38:39:ff:ff:01:00:00:01",
        "flags": [
            "local",
            "readyForBgp"
        ],
        "vni": 1001
    },
    {
        "esi": "03:44:38:39:ff:ff:01:00:00:02",
        "flags": [
            "local",
            "readyForBgp"
        ],
        "vni": 1001
    },
]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

3. access-vlan
root@torm-11:mgmt:~# vtysh -c "show evpn access-vlan 1001 json" |python -m json.
tool
{
    "memberIfCount": 4,
    "members": [
        {
            "ifName": "hostbond4"
        },
        {
            "ifName": "hostbond1"
        },
        {
            "ifName": "hostbond2"
        },
        {
            "ifName": "hostbond3"
        }
    ],
    "vlan": 1001,
    "vni": 1001,
    "vxlanIf": "vx-1001"
}
root@torm-11:mgmt:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agolib, bgpd: move json_array_string_add to lib
Anuradha Karuppiah [Sun, 17 May 2020 17:57:35 +0000 (10:57 -0700)]
lib, bgpd: move json_array_string_add to lib

json_array_string_add is used to add a string entry into a JSON
list. This API is needed by zebra so moving it from bgpd to lib.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agozebra: handle local-es bridge port association
Anuradha Karuppiah [Tue, 14 Apr 2020 15:30:09 +0000 (08:30 -0700)]
zebra: handle local-es bridge port association

A local ES can be added or removed to a bridge after it is created.
When it becomes a bridge port member the dataplane attributes need
to be programmed.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agozebra: changes for programming SPH, non-DF and backup NHG br-port attrs
Anuradha Karuppiah [Mon, 13 Apr 2020 22:56:03 +0000 (15:56 -0700)]
zebra: changes for programming SPH, non-DF and backup NHG br-port attrs

split horizon filter, non-DF block filter and backup nexthop group
are passed as bridge port attributes to the dataplane.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agozebra: dplane APIs for programming evpn-mh access port attributes
Anuradha Karuppiah [Fri, 8 May 2020 23:53:25 +0000 (16:53 -0700)]
zebra: dplane APIs for programming evpn-mh access port attributes

This includes -
1. non-DF block filter
2. List of es-peers that need to be blocked per-access port (for
split horizon filtering)
3. Backup nexthop group to failover local-es via the VxLAN overlay

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>