Commit Graph

23768 Commits

Author SHA1 Message Date
Philippe Guibert
7723e8d3fd zebra: link layer config and notification, implementation in zebra
zebra implements zebra api for configuring link layer information. that
can be an arp entry (for ipv4) or ipv6 neighbor discovery entry. This
can also be an ipv4/ipv6 entry associated to an underlay ipv4 address,
as it is used in gre point to multipoint interfaces.
this api will also be used as monitoring. an hash list is instantiated
into zebra (this is the vrf bitmap). each client interested in those entries
in a specific vrf, will listen for following messages: entries added, removed,
or who-has messages.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09 18:29:58 +02:00
Philippe Guibert
fda64ab443 lib: link layer neighbor registration and notification, define API msgs
This patch implements new zapi api to get neighbor information that zebra knows
and that other daemons may need to know. Actually, nhrp daemons is
interested in getting the neighbor information on gre interfaces, and
the API will be used for that.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09 18:29:58 +02:00
Philippe Guibert
e8263bdb77 nhrpd: use CALLOC instead of MALLOC
in order to apply a memset to a non initialised structure, use CALLOC
instead of MALLOC

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09 18:29:58 +02:00
Philippe Guibert
4030737044 nhrpd: lookup appropriate ipsec path
lookup appropriate ipsec path. there are systems where the path where
the charon.vici file is not in standard paths. For that, 'ipsec
--piddir' may help in solving the path.

result of ipsec --piddir is as follow for example:
'
/etc/ike/ipsec.d/run
'

Note that the assumption is done that even if there are several
instances of strongswan across the vrfs, the charon.vici path file is
the same across vrfs. Consequently, as there is a thread per vrf that
performs vici initialisation, and file path retrieval is part of the
vici initialisation procedure, in order to avoid intempestive system
calls, use a boolean 'vici_charon_filepath_done' to avoid doing
unnecessary calls.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2021-04-09 18:29:58 +02:00
Donald Sharp
248e7b3af1 doc: Check for convergence, not sleep for convergence
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 12:24:22 -04:00
Donald Sharp
9e7fd5ecbd tests: Do not sleep(5) when verifying bgp communities
There are better ways of ensuring that the remote side
has your change instead of sleeping

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 12:02:18 -04:00
Quentin Young
f99b9d6eb1
Merge pull request #8432 from ton31337/fix/use_bool_for_use32bit_asn
bgpd: Use bool type to check if use32bit ASN
2021-04-09 15:59:38 +00:00
Donald Sharp
3404eb5309
Merge pull request #8428 from idryzhov/show-memory-daemon
vtysh: add "show memory" for a single daemon
2021-04-09 11:18:25 -04:00
Donald Sharp
97bbb2c1c4
Merge pull request #8433 from ton31337/fix/mpls_prd_dead_code
bgpd: Remove dead code regarding prefix_rd allocation
2021-04-09 11:17:49 -04:00
Rafael Zalamena
e2134a79ee ospfd: fix crash on interface/vrf removal
The interface parameters deletion must be called before
`route_table_finish` due to the usage of the route data structures to
search neighbors in the same interface. If the route info is removed
before that we get the following crash:

```
 6  0x00007f5c6ed50394 in core_handler at lib/sigevent.c:255
 7  <signal handler called>
 8  ospf_interface_bfd_apply (ifp=<optimized out>) at ospfd/ospf_bfd.c:130
 9  0x000055d4c306d076 in ospf_interface_disable_bfd at ospfd/ospf_bfd.c:159
 10 0x000055d4c3071781 in ospf_del_if_params at ospfd/ospf_interface.c:553
 11 0x000055d4c3071900 in ospf_if_delete_hook at ospfd/ospf_interface.c:704
 12 0x00007f5c6ed17935 in hook_call_if_del at lib/if.c:59
 13 if_delete_retain at lib/if.c:290
 14 0x00007f5c6ed19bc5 in if_delete at lib/if.c:313
 15 0x00007f5c6ed19d88 in if_terminate at lib/if.c:1067
 16 0x00007f5c6ed63a04 in vrf_delete at lib/vrf.c:297
 17 0x00007f5c6ed76784 in zclient_vrf_delete at lib/zclient.c:1974
 18 zclient_read at lib/zclient.c:3686
 19 0x00007f5c6ed60f85 in thread_call at lib/thread.c:1815
 20 0x00007f5c6ed20228 in frr_run at lib/libfrr.c:1149
 21 0x000055d4c306bc70 in main at ospfd/ospf_main.c:233
```

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-04-09 10:54:23 -03:00
Donald Sharp
0b25370e95 tests: More black fixups
Just another round of fixups found by running black on the code

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 08:35:05 -04:00
Donald Sharp
98ca91e181 tests: Add some more pytest marks for bgpd
Just another round of trying to add pytest.mark.bgpd.  Not finished yet just
what I could stand doing for a few minutes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-04-09 08:34:45 -04:00
Donald Sharp
750b1916b9
Merge pull request #8422 from idryzhov/fix-show-ip-ospf
ospfd: fix crash on "show ip ospf neighbor detail"
2021-04-09 08:14:17 -04:00
Mark Stapp
2a034138d4 lib: use platform-neutral value for TCP MD5 signature len
Use a pcep-specific value for MD5SIG_MAXLEN, use the OS value if
present.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2021-04-09 08:13:58 -04:00
Donatas Abraitis
654527a1f0 bgpd: Remove dead code regarding prefix_rd allocation
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-09 14:38:01 +03:00
Donatas Abraitis
e9e1890ba5 bgpd: Use bool type to check if use32bit ASN
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-04-09 14:37:54 +03:00
Patrick Ruddy
455bc41000
Merge pull request #8430 from ton31337/fix/revert_0b6d35324ef3fd2b4d5997103795cad73eb72954
Revert "bgpd: BGP session not established for ipv6 link local address…
2021-04-09 12:25:21 +01:00
Igor Ryzhov
aa270404fc doc: add "show memory [DAEMON]"
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-09 11:30:49 +03:00
Igor Ryzhov
83c4442202 ospfd: fix crash on "show ip ospf neighbor detail"
Fixes #8419.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-09 11:24:51 +03:00
Donatas Abraitis
5fc443575b
Merge pull request #8424 from taspelund/allow_no_advertise_evpn
bgpd: always allow no advertise-svi-ip/default-gw
2021-04-09 10:55:11 +03:00
Donatas Abraitis
6740a191ad Revert "bgpd: BGP session not established for ipv6 link local address with vrf config"
This reverts commit 0b6d35324e.
2021-04-09 10:14:32 +03:00
Igor Ryzhov
f09e0369f6 vtysh: add "show memory" for a single daemon
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-04-08 18:47:43 +03:00
Patrick Ruddy
fb94a2e65d
Merge pull request #8402 from opensourcerouting/debian10-topotest-fix
tests: fix for l3mdev topotests on kernel 4.19
2021-04-08 14:54:54 +01:00
Trey Aspelund
e5aee1518a bgpd: always allow no advertise-svi-ip/default-gw
Current behavior has an EVPN_ENABLED check for both standard and 'no'
forms of 'advertise-svi-ip' and 'advertise-default-gw'. This prevents a
user from removing either command from running config if
'advertise-all-vni' is not present.
This commit removes/adjusts the EVPN_ENABLED checks to always allow the
'no' command so config doesn't get stuck.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2021-04-08 07:25:22 +00:00
Donatas Abraitis
9d78be6aac
Merge pull request #7434 from sudhanshukumar22/bgp-link-local-address
bgpd: BGP session not established for ipv6 link local address with vrf config
2021-04-08 09:26:55 +03:00
David Lamparter
b17f302b20 python: fix 32-bit pointers in xrelfo container_of
This was mistakenly using the host platform's pointer size rather than
the ELF file's.  Only noticeable when cross compiling...

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-04-08 00:01:07 +02:00
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
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
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
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
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