Commit Graph

22862 Commits

Author SHA1 Message Date
Donatas Abraitis
f32fc99078
Merge pull request #7815 from ckishimo/pytests
tests: fix typos and remove duplicate output
2021-01-06 09:08:35 +02:00
kuldeepkash
e58fdb55d6 tests: [topojson]Enhance lib/topojson.py to support PIM automation
1. Enhanced lib/topojson.py for creating topologies with switches and routers
2. Ran it through (black) for expected formatting

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2021-01-06 05:13:05 +00:00
kuldeepkash
aafca66993 tests: [topojson]Enhance lib/common_config.py to support PIM automation
1. Enhanced lib/common_config.py for common configuration/verification needed
   for PIM automation
2. Ran it through (black) for expected formatting

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2021-01-06 05:08:31 +00:00
kuldeepkash
e8cd26fdc5 tests: [topojson]Add lib/pim.py to support PIM automation
1. Added lib/pim.py for PIM configuration/verification
2. Ran it through (black) for expected formatting

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2021-01-06 05:05:30 +00:00
Donald Sharp
1a3519b69e bgpd: Cleanup debugs for bgp_zebra_route_notify_owner
User %pRN as well as add some more debugs for other
interesting cases.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-05 15:37:33 -05:00
Donald Sharp
92269aa253 bgpd: Allow more detailed knowledge of bgp's internal state
When bgp is using wait for install semantics it would be nice
to be able to debug it when it is running.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-05 15:37:33 -05:00
Donald Sharp
6f4196d72b pathd: Convert to use our internal frr_weak_random
rand() should not be used, we should be using the frr_weak_random()
call instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-05 15:37:32 -05:00
ckishimo
90340b2b82 tests: fix typos
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-05 20:00:19 +01:00
Mark Stapp
6b66913275
Merge pull request #7762 from sworleys/PBR-Ipv4/Ipv6-Match-Fixes
pbrd: pbr ipv4/ipv6 match fixes
2021-01-05 13:54:06 -05:00
Pat Ruddy
cdb2af427a tests: add test for labelmanager plugin
An external label manager plugin may want to use the following
functions:
    - create_label_chunk
    - assign_label_chunk
    - delete_label_chunk
    - release_label_chunk
This test ensures that they are externally visible.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-05 18:20:50 +00:00
Pat Ruddy
507d2737d6 zebra: expose label-manager util-funcs
Revert "zebra: unexpose label-manager util-funcs as static"
This reverts commit d3d9639d9a.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-05 18:19:44 +00:00
Donatas Abraitis
bcbeb3f967 bgpd: Use neighbor_events instead of debug_update for route-refresh msg
This was somewhy under bgp_debug_udpate() guard and others are under
bgp_debug_neighbor_events().

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-05 20:19:42 +02:00
Donatas Abraitis
9af52ccf81 bgpd: Implement enhanced route refresh capability
16:40:49 BGP: 192.168.0.2: sending route-refresh (BoRR) for IPv4/unicast
16:40:51 BGP: 192.168.0.2: sending route-refresh (EoRR) for IPv4/unicast

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-05 20:19:41 +02:00
Donatas Abraitis
923c631fde doc: Add rfc7313 (Enhanced Route Refresh Capability for BGP-4) to the list
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-05 20:16:19 +02:00
Donatas Abraitis
2b3de9e5a6 doc: Define bgp graceful-restart stalepath-time command
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-05 20:16:19 +02:00
Mark Stapp
b04932df02
Merge pull request #7772 from LabNConsulting/ziemba/tests-lutil-timestamp
tests: topotests/lib/lutil.py: add timestamp to log of test start
2021-01-05 11:29:49 -05:00
ckishimo
19185dbac2 tests: remove duplicate output
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2021-01-05 17:26:01 +01:00
Russ White
cec0e51e25
Merge pull request #7807 from logbob0401/vrrpd_yang_bug_fix
Fix augment path problem in frr-vrrpd.yang to comply with rfc 7950
2021-01-05 10:30:55 -05:00
Russ White
ee117a8bd6
Merge pull request #7507 from ton31337/fix/bgpd_do_not_send_update_if_path_really_did_not_change
bgpd: Do not send BGP UPDATE if the route actually not changed
2021-01-05 10:26:18 -05:00
Russ White
7e9492a9a6
Merge pull request #6810 from Orange-OpenSource/link_state
Lib: Add Link State Database
2021-01-05 10:25:38 -05:00
Patrick Ruddy
b567ed7eeb
Merge pull request #7722 from AnuradhaKaruppiah/mh-fixes
bgpd, zebra: evpn mh fixes
2021-01-05 09:26:17 +00:00
Donatas Abraitis
0e8916e0cf bgpd: Validate community list if they are not malformed
Before fix:
```
root@exit1-debian-9:~/frr# /usr/local/bin/vtysh  -c 'c' -c 'route-map test permit 10' -c 'set community 65535:429496723296'
root@exit1-debian-9:~/frr#

root@exit1-debian-9:~/frr# vtysh -c 'c' -c 'bgp community-list standard test permit 65535:4294967296'
root@exit1-debian-9:~/frr#

root@exit1-debian-9:~/frr# /usr/local/bin/vtysh  -c 'c' -c 'route-map test permit 10' -c 'set community 65535'
root@exit1-debian-9:~/frr# /usr/local/bin/vtysh  -c 'c' -c 'route-map test permit 10' -c 'set community 65535:'
% Malformed communities attribute
```

After fix:
```
root@exit1-debian-9:~/frr# /usr/local/bin/vtysh  -c 'c' -c 'route-map test permit 10' -c 'set community 65535:4294967296'
% Malformed communities attribute

root@exit1-debian-9:~/frr# vtysh -c 'c' -c 'bgp community-list standard test permit 65535:4294967299'
% Malformed community-list value

root@exit1-debian-9:~/frr# /usr/local/bin/vtysh  -c 'c' -c 'route-map test permit 10' -c 'set community 65535:'
% Malformed communities attribute
root@exit1-debian-9:~/frr# /usr/local/bin/vtysh  -c 'c' -c 'route-map test permit 10' -c 'set community 65535'
% Malformed communities attribute
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-05 10:59:11 +02:00
zyxwvu Shi
66de968020 bgpd: Fix default-originate clearing from peer-groups.
Fix `peer_default_originate_unset` so default route can be withdrawn
when `default-originate` option is being unset from a peer-group.

The loop calling `bgp_default_originate` is clearing default-originate
from the peer-group peer `peer` instead of the peer-group member peer
`member`.

Signed-off-by: zyxwvu Shi <shiyuchen.syc@bytedance.com>
2021-01-05 07:17:48 +00:00
Jafar Al-Gharaibeh
9c28522e12
Merge pull request #7809 from donaldsharp/m_coverity
some coverity fixes
2021-01-04 16:13:21 -06:00
Olivier Dugeon
bbd85e2038 lib: Add Link State Database
Define new models for Link State Database a.k.a TED
and functions to manipulate the new database as well as exchange Link State
information through ZAPI Opaque message.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-01-04 18:19:26 +01:00
Pat Ruddy
160ad964e7 tests: add BGPLU label sanity test
This test checks the interactions between the BGP label requesting
code and the labelpool code to ensure the correct number of labels
and label chunks are requested and those labels are freed back into
the pool when the corresponding prefix is removed.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:44 +00:00
Pat Ruddy
3466e2a1ea bgpd: fix zclient return code damage in labelpool
The check for the return code for zclient_send_get_label_chunk is
reversed and therefore the pending count does not get incremented
for each successful label chunk request.
This has the effect of requesting a 50 label chunk per label request
from BGP i.e we request 50 times the labels we require.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:44 +00:00
Pat Ruddy
78b351ddcd bgpd: release label to labelpool on dereg
when we de-register for a label associated with a prefix then release
it back to the labelpool to clean up the stale reference held in the
ledger and inuse lists.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:44 +00:00
Pat Ruddy
992dd67ec7 bgpd: refactor label allocation code
To prepare for fixing an issue where labels do not get released back
to the labelpool when the route is deleted some refactoring is
necessary. There are 2 parts to this.
1. restructure the code to remove the circular nature of label
allocations via the labelpool and decouple the label type decision
from the notification fo the FEC.
The code to notify the FEC association to zebra has been split out
into a separate function so that it can be called from the synchronous
path (for registration of index-based labels and de-registration of all
labels), and from the asynchronous path where we need to wait for a
callback from the labelpool code with a label allocation.
The decision about whether we are using an index-based label or an
allocated label is reflected in the state of the BGP_NODE_LABEL_REQUESTED
flag so the checks on the path_info in the labelpool callback code are
no longer required.
2. change the owned of a labelpool allocated label from the path info
structure to the bgp_dest structure. This allows labels to be released
(in a subsequent commit) when the owner (bgp_dest) goes away.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:44 +00:00
Pat Ruddy
189982283a zebra: labelmanager could return reserved labels
when checking if there is a "hole" behind the current reservation
marker the calculation of whether the hole is big enough to satisfy
the requested chunk is out by 1. This could result in returning a label
which has already been allocated.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:44 +00:00
Pat Ruddy
3c84497943 zebra: label manager should never return a reserved block
if the requested chunk size was less than 16 then a chunk
within the reserved block would be returned. Make sure that
we never return labels that are below MPLS_LABEL_UNRESERVED_MIN

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:44 +00:00
Pat Ruddy
331bd0ebad bgpd: add missing unlock of path_info
when the path info information is queued on the work queue it
is protected by a lock to avoid the rug being pulled whilst it
resides on the queue add an unlock in the error case where we do
no queue the reference to the workqueue.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:44 +00:00
Pat Ruddy
e3ea65039e bgpd: add show commands for bgp labelpool
These commands allow the bgp labelpool lists and counts to be
viewed for debug purposes.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:35 +00:00
Donald Sharp
e80bc08944 bgpd: Prevent null deref
There exists a path where we could possibly have a NULL deref
of a pointer.  Prevent this from happening.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-04 07:56:47 -05:00
Donald Sharp
fc7d07275e pathd: Fix unlock of non-locked mutex
We have several instances of a non-locked mutex being unlocked
in path_zebra_router_id_update.  Clean this up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-04 07:54:06 -05:00
Bo Zhang
8cf813c5ea vrrpd.yang bug fix: modify augment path to comply with rfc 7950
Signed-off-by: Bo Zhang <logbob0401@gmail.com>
2021-01-02 17:47:11 -08:00
Quentin Young
a7f52fb0f7
Merge pull request #7791 from mjstapp/fix_pbr_nht_goto
pbrd: clean up possible checkpatch issue
2020-12-29 15:54:46 -05:00
Quentin Young
46b0e93168
Merge pull request #7795 from louis-oui/show-database-vrf
ospfd: fix no show database output when selecting vrf
2020-12-29 15:53:28 -05:00
Quentin Young
19ff5340a1
Merge pull request #7777 from volta-networks/fix_zebra_rib_c++
zebra: avoid c++ reserved keyword
2020-12-29 11:07:12 -05:00
G. Paul Ziemba
2f17f52a02 tests: topotests/lib/lutil.py: add timestamp to log of test start
Timestamps in test logs are needed for correlation with messages in
    routing protocol log files. Vox populi indicates preference for
    timestamp at beginning of line.

    OLD:
    (#55) scripts/rip-show.py:61 COMMAND:r1:vtysh -c "show ip rip status": 00:0.* 00:0:wait:RIP Peers:

    NEW:
    Sat Dec 19 08:26:45 2020 (#55) scripts/rip-show.py:61 COMMAND:r1:vtysh -c "show ip rip status": 00:0.* 00:0:wait:RIP Peers:

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2020-12-29 05:34:46 -08:00
Stephen Worley
a4525d25b5
Merge pull request #7788 from deastoe/zebra2proto-kernel-connect
zebra: zebra2proto() handle kernel/connect type
2020-12-28 14:57:41 -05:00
Donatas Abraitis
6d665c2082
Merge pull request #7761 from bisdhdh/local_1
doc: Add BGP GR command for preserving forwarding state.
2020-12-28 17:09:36 +02:00
Olivier Dugeon
7396354158
Merge pull request #7776 from mjstapp/fix_pathd_build
pathd: fix compile warning in path_cli
2020-12-28 10:45:38 +01:00
Louis Scalbert
d68e47e162 ospfd: fix no show database output when selecting vrf
No output when selecting a vrf
frr# show ip ospf vrf default database router adv-router 10.125.0.1
VRF Name: default

       OSPF Router with ID (10.125.0.1)

In comparison with:
frr# show ip ospf database router adv-router 10.125.0.1

       OSPF Router with ID (10.125.0.1)

                Router Link States (Area 0.0.0.0)

  LS age: 155
  Options: 0x2  : *|-|-|-|-|-|E|-
(...)

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2020-12-24 15:07:24 +01:00
Mobashshera Rasool
d1b61cb92d pimd: IGMP conformance 5.10 test case is failing
Test case 5.10 sends leave message to unicast address, the leave
packet is accepted and a query message is sent in response to this.
No validation for address is present in the function

Add check for addresses as per RFC. Leave messages are allowed only
sent to either ALL-ROUTERS (224.0.0.2) or group address.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2020-12-24 06:39:12 +00:00
Mark Stapp
95001dd146 pbrd: clean up possible checkpatch issue
PR 7724 triggered a minor style warning (at least in the CI
context). Clean that up.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-12-23 14:03:06 -05:00
Mark Stapp
7c08b70a53
Merge pull request #7724 from donaldsharp/pbr_zebra_was_wrong
Pbr zebra was wrong
2020-12-23 13:34:18 -05:00
Mark Stapp
d4473065f4
Merge pull request #7759 from qlyoung/reformat-tests-again
Reformat tests again
2020-12-23 08:11:00 -05:00
bisdhdh
4907bcd8a5 doc: Add BGP GR command for preserving forwarding state.
BGP GR command for preserving forwarding state command is
Added to the docs.

Signed-off-by: Biswajit Sadhu <biswajit.sadhu@gmail.com>
2020-12-23 09:58:06 +05:30
Martin Winter
90cd28e91a
Merge pull request #6212 from gpnaveen/static_routes
tests: Adding static routing topojson automation suites.
2020-12-22 14:11:37 -08:00