Commit Graph

24361 Commits

Author SHA1 Message Date
David Lamparter
81693617a2 lib: add DT_REL to elf_py/clippy ELF code
ARM (32-bit) needs DT_REL... and here I was hoping I could avoid the
trouble.

Fixes: #8355
Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-08 00:00:08 +02:00
Reuben Dowle
46d3c1859b nhrpd: Change sockunion2str to %pSU in a few places
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-08 08:45:51 +12:00
David Lamparter
b0b14dfdd1 tools: dump YANG info in frr-llvm-cg
Since all of these function pointers are entry points for YANG actions,
they're useful to have in the call graph.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-07 22:31:54 +02:00
David Lamparter
d71449a3f7 tools: grok struct member calls in frr-llvm-cg
Calling a function pointer embedded in a struct is quite common & having
this listed in the call graph is useful.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-07 22:31:25 +02:00
Mark Stapp
aef1d5404f zebra: add config control to hide backup nh events in nht
Add a config that can control hiding of backup-nexthop activation
changes in nexthop-tracking.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-07 15:38:09 -04:00
Mark Stapp
a702694a60
Merge pull request #8365 from aldobrrrr/fix_parse_topology_function_in_isis_topo1_vrf_test
topotests: fix 'parse_topology' function in test_isis_topo1_vrf.py
2021-04-07 15:01:12 -04:00
Quentin Young
fdd40d514d doc: update docs for find REGEX... command
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:40:00 -04:00
Quentin Young
767f67a456 lib, vtysh: re-add support for spaces in 'find'
Lost ability to handle them in the regex patch

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:39:56 -04:00
Quentin Young
660c59ed6f tests: fix use of undefined variable in pim lib
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Quentin Young
5aab262b74 tests: fix improper format strings in pim lib
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Quentin Young
8ab4625666 tests: remove duplicate pim test function
Twice defined

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Quentin Young
c287dfd25c tests: provide sane default for --topology-only
Fixes:

/usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1463: in getoption
    val = getattr(self.option, name)
E   AttributeError: 'Namespace' object has no attribute 'topology_only'

The above exception was the direct cause of the following exception:
/usr/lib/python3.9/site-packages/pluggy/manager.py:127: in register
    hook._maybe_apply_history(hookimpl)
/usr/lib/python3.9/site-packages/pluggy/hooks.py:333: in _maybe_apply_history
    res = self._hookexec(self, [method], kwargs)
/usr/lib/python3.9/site-packages/pluggy/manager.py:93: in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
/usr/lib/python3.9/site-packages/pluggy/manager.py:84: in <lambda>
    self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
tests/topotests/conftest.py:62: in pytest_configure
    if config.getoption("--topology-only"):
/usr/lib/python3.9/site-packages/_pytest/config/__init__.py:1474: in getoption
    raise ValueError(f"no option named {name!r}") from e
E   ValueError: no option named 'topology_only'

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-04-07 13:31:27 -04:00
Igor Ryzhov
c53b1ff198
Merge pull request #8415 from mjstapp/fix_ospf_keyid_config
ospfd: permit over-write of message-digest-key
2021-04-07 15:16:47 +03:00
Abhinay Ramesh
de7cee09eb bgpd: vrf route leaking, fix vpn router id update
Description:
Route leaking from default vrf to non-default vrf stops after frr restart.

If the interface comes up after route leaking is configured,
in the case of vpn router id update, we delete the ecommunity value
and never reconfigure the rtlist.
This results in skipping route leak to non-default vrfs (vpn to vrf).

Router-id change that is not explicitly configured
(a change from zebra, frr restart) should not replace a configured vpn RD/RT.
Added few helpful debugs as well.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-04-07 09:57:08 +00:00
Abhinay Ramesh
8fac400c79 VRF-Lite: Fix export of withdraw-in-progress routes
Problem:
Stale routes are seen in the bgp table(ipv4 and ipv6)
RCA:
Scenario1:
Interface down and withdraw is in-progress.
Router bgp config leading to re-leaking.
Now, withdraw-in-progress routes,
       are again leaked to bgp vrf instance(s) importing routes.
Whenever we see an interface down
and corresponding address delete,
while withdrawal of exported routes is in-progress,
routes are marked as being removed and put into work queue.
‘router bgp’ config is updated, which triggers
bgp_vpn_leak_export; which exports routes from configured bgp vrf to VPN.
So withdraw-in-progress routes,
are again leaked to bgp vrf instance(s) importing routes; leading to stale routes.
Scenario2:
- 'no import vrf non-default-vrf’ [in the default vrf]
- bgp update from the peer withdrawing prefix [non-default vrf]
- 'import vrf non-default-vrf’ [configured in the default vrf]
While withdrawal of exported routes is in-progress,
routes are marked as being removed and put into work queue,
In the meantime, if import vrf is configured,
which exports routes from configured bgp vrf to VPN.
So withdraw-in-progress new routes,
are again leaked to bgp vrf instance(s) importing routes; leading to stale routes.
Fix:
Whenever leaking routes (leak_update),
for already existing routes,
skip the routes with bgp_path_info
marked as being removed.
Also added the log message for the return.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-04-07 09:57:04 +00:00
Abhinay Ramesh
6b2433c63f bgpd: vrf route leaking, fix vrf redistribute
Description:
After FRR restart, routes are not getting redistributed;
when routes added first and then 'redistribute static' cmd is issued.

During the frr restart, vrf_id will be unknown,
so irrespective of redistribution, we set the redistribute vrf bitmap.
Later, when we add a route and then issue 'redistribute' cmd,
we check the redistribute vrf bitmap and return CMD_WARNING;
zebra_redistribute_add also checks the redistribute vrf bitmap and returns.

Instead of checking the redistribute vrf bitmap, always set it anyways.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-04-07 06:09:42 +00:00
Abhinay Ramesh
b19c4f0829 bgpd: vrf route leaking, fix vrf delete
Description:
Imported/leak-from routes do not get withdrawn/removed
even if the source VRF is deleted.
Deleting and re-adding a tenant vrf, does not refresh the RIB.

Whenever VRF is deleted (bgp_vrf_disable),
currently we are withdrawing leak-from-vrf and
leak-to-vrf routes from vpn table for the vrf,
which is deleted.
But we are currently not withdrawing routes from leak-to vrfs.
We should also withdraw leak-to routes
from leak-to vrfs (calling vpn_leak_to_vrf_withdraw).

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-04-07 06:09:42 +00:00
Abhinay Ramesh
ef7c53e244 bgpd: vrf route leaking, fix the bgp instance delete and re-add
Description:
FRR doesn't re-install the routes, imported from a tenant VRF,
when bgp instance for source vrf is deleted and re-added again.
When bgp instance is removed and re-added, when import statement is already there,
then route leaking stops between two VRFs.

Every 'router bgp' command should trigger re-export of all the routes
to the importing bgp vrf instances.
When a router bgp is configured, there could be bgp vrf instance(s) importing routes from
this newly configured bgp vrf instance.
We need to export routes from configured bgp vrf to VPN.
This can impact performance, whenever we are testing scale from vrf route-leaking perspective.
We should not trigger re-export for already existing bgp vrf instances.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-04-07 06:09:42 +00:00
Quentin Young
f19d77a086
Merge pull request #8413 from mjstapp/zebra_doc_debugs
docs: add zebra debug docs
2021-04-06 22:11:50 +00:00
Igor Ryzhov
1dc32c419d lib: delete empty access-lists
We should delete the access-list when the last entry and remark is
deleted. This is already done for prefix-lists.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-06 23:18:47 +03:00
Igor Ryzhov
ad2b07055c lib: fix deletion of empty prefix-lists
We delete the prefix-list when its last entry is deleted, but the check
is missed when we delete the description.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-06 23:18:47 +03:00
Igor Ryzhov
a0145975e3 lib: fix usage of operational data in CLI
CLI must never use operational data, because this won't work in
transactional mode. Rework search for prefix-list/access-list entries
using only candidate config.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-06 23:18:47 +03:00
Jafar Al-Gharaibeh
b359c71eba
Merge pull request #8411 from donaldsharp/nhrp_really
nhrpd: Fixup tab usage and sockunion2str usage
2021-04-06 15:00:57 -05:00
Mark Stapp
519b14645e ospfd: permit over-write of message-digest-key
Allow over-write of message-digest-key interface config. Most
attributes handle multi-instance by ... ignoring instances,
and tolerating repeated config: do the same for md5 auth.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-06 15:26:51 -04:00
Mark Stapp
e08165def1 lib: logic and macro cleanup in frr_zmq shim
Fix a couple of logic/macro issues in the frr_zmq shim
module.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-06 14:41:45 -04:00
Mark Stapp
1dffe35773 lib: use public task-scheduling apis
The frr_zmq shim was trying to use some internal scheduling
macros, and that was causing trouble. Just use the public
apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-06 14:40:39 -04:00
Mark Stapp
8d150f5287 docs: add zebra debug docs
Add docs for the zebra debug commands.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-06 14:18:18 -04:00
Igor Ryzhov
451e6dcfc7 lib: fix check for duplicated access-list entries
The correct string representation for "empty" type is an empty string.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-06 20:38:24 +03:00
Igor Ryzhov
3ebeec9446 lib: convert route-map optimization to NB
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-06 19:00:21 +03:00
Russ White
964788a11f
Merge pull request #8405 from mjstapp/skip_backup_lsps
zebra: don't process LSPs with backups immediately
2021-04-06 11:11:52 -04:00
Russ White
63caaeb2c1
Merge pull request #8407 from ton31337/fix/nexthop_should_not_be_changed_if_peer_shares_common_subnet
tests: Nexthop should not be changed if peer X shares a common subnet
2021-04-06 11:02:19 -04:00
Donald Sharp
2a1fa50ecf nhrpd: Fixup tab usage and sockunion2str usage
For some reason the usage of tabs in a string snuck in as well
as using a sockunion2str instead of %pSU.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-06 10:09:48 -04:00
Mark Stapp
1832ff8b49
Merge pull request #8295 from opensourcerouting/ospf6-topo-stabilize
topotest: stabilize OSPFv3 topology
2021-04-06 09:48:45 -04:00
Martin Winter
4af86fb679
Merge pull request #8360 from kuldeepkash/bgp_graceful_restart
tests: Fix for BGP_GR test failures
2021-04-06 14:09:52 +02:00
Alexander Chernavin
6dd632c65d ospfd: fix output of dead-interval in show running
When you set OSPF hello-interval for an interface and dead-interval is
not set for this interface, dead-interval will be calculated and set
automatically. "show running-config" will contain an invalid command:

    test(config)# interface vpp1
    test(config-if)# ip ospf area 0
    test(config-if)# ip ospf hello-interval 1
    test(config-if)# exit
    test(config)#
    test(config)# do show running-config
    ...
    interface if1
     ip ospf area 0
     ip ospf dead-interval minimal hello-multiplier 0
     ip ospf hello-interval 1
    !
    ...

It causes frr-reload.py to fail because of this:

    # vtysh -c "show running-config no-header" | vtysh -m -f -
    line 9: % Unknown command:  ip ospf dead-interval minimal hello-multiplier 0
    ...

With this change, output "ip ospf dead-interval" only if it has value
configured explicitly.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2021-04-06 05:34:55 -04:00
Donatas Abraitis
b1367d6859 tests: Nexthop should not be changed if peer X shares a common subnet
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-06 10:32:02 +03:00
Renato Westphal
a61086d29c
Merge pull request #8391 from idryzhov/fix-bgp-nb-prefix-list
bgpd: prefix-list and route-map nb fixes
2021-04-06 01:10:41 -03:00
Quentin Young
2a9d6bce5a
Merge pull request #8384 from volta-networks/fix_no_srb_block
tools: do in-place SRGB/SRLB changes
2021-04-06 03:44:25 +00:00
Reuben Dowle
c2bb9917b1 nhrpd: Fix style issues
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Reuben Dowle
4946316150 nhrpd: Add missing semicolon
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Reuben Dowle
32ff81f6c9 nhrpd: Improve debug message for multicast interception
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Reuben Dowle
686967467c ospfd: Suppress spurious write message when using ip nhrp map multicast
When ip nhrp map multicast is being used, this is usually accompanied by an
iptables rule to block the original multicast packet. This causes sendmsg to
return EPERM.

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Amol Lad
0c5506a856 ospfd: changes for PMP network /32 prefix length
Operation with PMP network on /32 prefix is needed for DMVPN

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Reuben Dowle
63c0a73559 nhrpd: Cleanup multicast nflog handler function
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Amol Lad
9084e20961 nhrpd: Introduce new - nflog mutlicast-nflog-group (1-65535) - command
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Reuben Dowle
9f7f6d3c6b nhrpd: Use ethertype defines instead of hard-coded values
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Reuben Dowle
ab9ad933d0 nhrpd: Document how to block redirected multicast packets
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Reuben Dowle
ca317495b8 nhrpd: Use strlcpy not unsafe strncpy
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Reuben Dowle
0f8595a9f4 nhrpd: Fix style violation issues
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:23:42 +12:00
Reuben Dowle
4f7a37ace3 nhrpd: Use correct printf format specifier
Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
2021-04-06 09:22:59 +12:00