]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agodoc/developer: improve printfrr extension docs
David Lamparter [Sun, 21 Mar 2021 16:35:43 +0000 (17:35 +0100)]
doc/developer: improve printfrr extension docs

The table is getting rather clunky, let's just break this out and make
it pretty there.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: save errno in vty_out()
David Lamparter [Fri, 26 Mar 2021 13:27:51 +0000 (14:27 +0100)]
lib: save errno in vty_out()

... so `%m` works correctly, without us trampling over `errno` before we
get to formatting it.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%dPF` & `%dSO` formats
David Lamparter [Fri, 26 Mar 2021 13:20:08 +0000 (14:20 +0100)]
lib: add `%dPF` & `%dSO` formats

Just quick helpers to print `AF_*` and `SOCK_*` constants.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: fix & improve `%pSU` format
David Lamparter [Fri, 26 Mar 2021 13:16:01 +0000 (14:16 +0100)]
lib: fix & improve `%pSU` format

This wasn't quite formatting IPv6+port in a useful way (no brackets),
and printing the scope ID (interface index) and unix addrs is useful
too.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%pSQ` and `%pSE` string escape formats
David Lamparter [Mon, 22 Mar 2021 09:12:42 +0000 (10:12 +0100)]
lib: add `%pSQ` and `%pSE` string escape formats

These are for string quoting (`%pSQ`) and string escaping (`%pSE`); the
sets / escape methods are currently rather "basic" and might be extended
in the future.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%*pHX` + `%*pHS` hexdump in printfrr
David Lamparter [Thu, 18 Feb 2021 23:08:11 +0000 (00:08 +0100)]
lib: add `%*pHX` + `%*pHS` hexdump in printfrr

(I'll get to `zlog_hexdump()` in a separate pass.)

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%pFB` extension to print struct fbuf *
David Lamparter [Tue, 2 Mar 2021 20:39:49 +0000 (21:39 +0100)]
lib: add `%pFB` extension to print struct fbuf *

Useful to insert output from another bprintfrr() call.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `%pVA` recursive printfrr
David Lamparter [Tue, 2 Mar 2021 19:45:57 +0000 (20:45 +0100)]
lib: add `%pVA` recursive printfrr

Analogous to Linux kernel `%pV` (but our mechanism expects 2 specifier
chars and `%pVA` is clearer anyway.)

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: add `FMT_NSTD()` for non-standard printf exts
David Lamparter [Fri, 26 Mar 2021 17:11:21 +0000 (18:11 +0100)]
lib: add `FMT_NSTD()` for non-standard printf exts

... to suppress the warnings when using something that isn't quite ISO C
compatible and would otherwise cause compiler warnings from `-Wformat`.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: allow discerning unspec width in printfrr ext
David Lamparter [Fri, 26 Mar 2021 16:58:54 +0000 (17:58 +0100)]
lib: allow discerning unspec width in printfrr ext

With 0 currently the default value for the width specifier, it's not
possible to discern that from a %*p where 0 was passed as the length
parameter.  Use -1 to allow for that.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: put printfrr extension args into struct
David Lamparter [Sat, 20 Mar 2021 08:02:04 +0000 (09:02 +0100)]
lib: put printfrr extension args into struct

... for easier extensibility.  Add width, # and - flags while at it.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: record output positions in printfrr
David Lamparter [Tue, 2 Mar 2021 19:16:18 +0000 (20:16 +0100)]
lib: record output positions in printfrr

This replaces `%n` with a safe, out-of-band option that simply records
the start and end offset of the output produced for each `%...`
specifier.

The old `%n` code is removed.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: print `(null)` rather than `NULL`
David Lamparter [Fri, 26 Mar 2021 18:14:24 +0000 (19:14 +0100)]
lib: print `(null)` rather than `NULL`

... for consistency with `%s`, which also prints `(null)`.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agolib: rework printfrr extensions to output directly
David Lamparter [Thu, 18 Feb 2021 21:52:23 +0000 (22:52 +0100)]
lib: rework printfrr extensions to output directly

Allowing printfrr extensions to directly write to the output buffer has
a few advantages:
- there is no arbitrary length limit imposed (previously 64)
- the output doesn't need to be copied another time
- the extension can directly use bprintfrr() to put together pieces

The downside is that the theoretical length (regardless of available
buffer space) must be computed correctly.

Extended unit tests to test these paths a bit more thoroughly.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agotools/gcc-plugin: support [un]signed in pragma
David Lamparter [Thu, 18 Feb 2021 23:05:35 +0000 (00:05 +0100)]
tools/gcc-plugin: support [un]signed in pragma

Need `unsigned char *` for `%pHX`.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agotools/gcc-plugin: fix format precision/width type
David Lamparter [Thu, 18 Feb 2021 23:04:51 +0000 (00:04 +0100)]
tools/gcc-plugin: fix format precision/width type

`%*.*pEXT` applied the extension type to the precision and width (*.*)
too.  Oops.

Signed-off-by: David Lamparter <equinox@diac24.net>
3 years agoMerge pull request #8154 from AnuradhaKaruppiah/evpn-mh-irb-2
Patrick Ruddy [Fri, 26 Mar 2021 12:16:01 +0000 (12:16 +0000)]
Merge pull request #8154 from AnuradhaKaruppiah/evpn-mh-irb-2

bgpd, lib, zebra: Complete support for sym-IRB with EVPN-MH

3 years agobgpd: cleanup prefix2str usage
Anuradha Karuppiah [Fri, 26 Feb 2021 02:32:32 +0000 (18:32 -0800)]
bgpd: cleanup prefix2str usage

Use %pFX where possible.

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agobgpd: fix crash in the MH cleanup handling
Anuradha Karuppiah [Thu, 10 Sep 2020 20:51:56 +0000 (13:51 -0700)]
bgpd: fix crash in the MH cleanup handling

The MH datastructures were being released before the paths that were
referencing them. Fix is to do the MH cleanup last.

The MH finish function has also been stripped down to only do a
datastructure cleanup i.e. avoid sending route updates etc.

Ticket: 31376

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: handle local ES del or transition to LACP bypass
Anuradha Karuppiah [Sun, 30 Aug 2020 21:05:33 +0000 (14:05 -0700)]
bgpd: handle local ES del or transition to LACP bypass

1. When a local ES is deleted or the ES-bond goes into bypass we treat
imported MAC-IP routes with that ES destination as remote routes instead
of sync routes. This requires a re-evaluation of the routes as
"non-local-dest" and an update to zebra.
2. When a ES is attached to an access port or the ES-bond transitions from
bypass to LACP-up we treat imported MAC-IP routes with that ES destination as
sync routes. This requires a re-evaluation of the routes as
"local-dest" and an update to zebra.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: changes for maintaining evpn nexthops and their rmac mapping
Anuradha Karuppiah [Sat, 12 Sep 2020 17:36:01 +0000 (10:36 -0700)]
bgpd: changes for maintaining evpn nexthops and their rmac mapping

In the case of EVPN type-2 routes that use ES as destination, BGP
consolidates the nh (and nh->rmac mapping) and sends it to zebra as
a nexthop add.

This nexthop is the EVPN remote PE and is created by reference of
VRF IPvx unicast paths imported from EVPN Type-2 routes.

zebra uses this nexthop for setting up a remote neigh enty for the PE
and a remote fdb entry for the PE's RMAC.

Ticket: CM-31398

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: ES evpn nexthop prep work
Anuradha Karuppiah [Fri, 11 Sep 2020 18:11:35 +0000 (11:11 -0700)]
bgpd: ES evpn nexthop prep work

Setup a mh_info indirection in the path extra. This has been done to
avoid increasing evpn route's path size to add new (type based) pointers
in path_info_extra.

Ticket: CM-31398

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agolib/zebra: zapi for installing EVPN nexthops from bgp
Anuradha Karuppiah [Mon, 14 Sep 2020 13:35:45 +0000 (06:35 -0700)]
lib/zebra: zapi for installing EVPN nexthops from bgp

EVPN nexthops are installed as remote neighs by zebra. This was earlier
done only via VRF IPvX uni routes imported from EVPN routes.

With EVPN-MH these VRF routes now reference a L3NHG which is setup based
on the EAD and doesn't include the RMAC. To workaround that BGP now
consolidates and maintains EVPN nexthops which are then sent to zebra.

zebra sets up these nexthops as L3-VNI nh entries using a dummy type-1
route as reference.

Ticket: CM-31398

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: Disable L3NHG support for routes leaked from another VRF
Anuradha Karuppiah [Fri, 4 Sep 2020 15:19:49 +0000 (08:19 -0700)]
bgpd: Disable L3NHG support for routes leaked from another VRF

Theoretically we should just be able to use the L3 NHG in the other-VRF/nh-VRF.
But there is some change list handling (when an ES is added to or
removed from a VRF) that needs to be updated to account for routes in other
VRFs using that ES-VRF as nexthop. Till that is done we will disable L3-NHG
use for routes leaked from a different VRF.

Route in tenant2 with ES/NHG as destination -
===========================================
root@leaf11:mgmt:~# ip route show vrf tenant2 22.1.0.7
22.1.0.7 nhid 75000012 proto bgp metric 20
root@leaf11:mgmt:~# ip nexthop list id 75000012
id 75000012 group 103/107/111 proto bgp
root@leaf11:mgmt:~# ip nexthop |grep "103\|107\|111"
id 103 via 6.0.0.11 dev vlan12 scope link proto bgp onlink
id 107 via 6.0.0.12 dev vlan12 scope link proto bgp onlink
id 111 via 6.0.0.13 dev vlan12 scope link proto bgp onlink
id 75000012 group 103/107/111 proto bgp
root@leaf11:mgmt:~#

Leaked into VRF1 with a flat/exploded mpaths
============================================
root@leaf11:mgmt:~# ip route show vrf tenant1 |grep -A3 22.1.0.7
22.1.0.7 proto bgp metric 20
        nexthop via 6.0.0.11 dev vlan12 weight 1 onlink
        nexthop via 6.0.0.12 dev vlan12 weight 1 onlink
        nexthop via 6.0.0.13 dev vlan12 weight 1 onlink
root@leaf11:mgmt:~#

Ticket: CM-31115

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: flush remote ES-EVI entries when a L2-VNI is deleted
Anuradha Karuppiah [Thu, 27 Aug 2020 23:55:28 +0000 (16:55 -0700)]
bgpd: flush remote ES-EVI entries when a L2-VNI is deleted

Force flush all ES-EVI PE entries when a L2-VNI is deleted. This will
implicitly free up the remote ES-EVI and deref the ES entry.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: re-eval use-l3nhg when a remote ES is [de]activated in a VRF
Anuradha Karuppiah [Mon, 17 Aug 2020 23:24:50 +0000 (16:24 -0700)]
bgpd: re-eval use-l3nhg when a remote ES is [de]activated in a VRF

There are two changes in this commit -

1. Maintain a list of global MAC-IP routes per-ES. This list is maintained
for quick processing on the following events -
a. When the first VTEP/PE becomes active in the ES-VRF, the L3 NHG is
activated and the route can be sent to zebra.
b. When there are no active PEs in the ES-VRF the L3 NHG is
de-activated and -
- If the ES is present in the VRF -
The route is not installed in zebra as there are no active PEs for
the ES-VRF
- If the ES is not present in the VRF -
The route is installed with a flat multi-path list i.e. without L3NHG.
This is to handle the case where there are no locally attached L2VNIs
on the ES (for that tenant VRF).

2. Reinstall VRF route when an ES is installed or uninstalled in a
tenant VRF (the global MAC-IP list in #1 is used for this purpose also).
If an ES is present in the VRF we use L3NHG to enable fast-failover of
routed traffic.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: Rename macip_path_list to macip_evi_path_list
Anuradha Karuppiah [Tue, 18 Aug 2020 13:52:40 +0000 (06:52 -0700)]
bgpd: Rename macip_path_list to macip_evi_path_list

This is done to clearly indicate what routes are being linked to
the list i.e. MAC-IP routes in the VNI table.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: allow routes to be imported if the ES/ES-VRF is not present
Anuradha Karuppiah [Sat, 15 Aug 2020 13:41:31 +0000 (06:41 -0700)]
bgpd: allow routes to be imported if the ES/ES-VRF is not present

In a sym-IRB setup the remote ES may not be installed if the tenant
VRF is not present locally. To allow that case while retaining the
fast-failover benefits for the case where the tenant VRF is locally
present we use the following approach -
1. If ES is present in the tenant VRF we use the L3NHG for installing
the MAC-IP based tenant route. This allows for efficient failover via
L3NHG updates.
2. If the ES is not present locally in the corresponding tenant VRF we
fall back to a non-NHG multi-path based routing approach. In this
case individual routes are updated when the ES links flap.

PS: #1 can be turned off entirely by disabling use-l3-nhg in BGP.

Ticket: CM-30935

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: on ES down re-advertise the MAC-IP entry without the L3 ECOM
Anuradha Karuppiah [Fri, 14 Aug 2020 22:48:34 +0000 (15:48 -0700)]
bgpd: on ES down re-advertise the MAC-IP entry without the L3 ECOM

When an ES goes down the MAC-IP route must be updated to remove it from
the tenant VRF routing table. This is because the fast-failover
(via EAD-per-ES withdraw) procedures described in RFC 7432 are only
applicable to L2 forwarding/MAC-ECMP. For L3/routed traffic (in a
sym-IRB setup) failover, individual paths need to be withdrawn.

To handle this difference in L2/L3 requirements BGP updates the MAC-IP
route to include the L3 ECOM if local destination ES is oper-up and
to exclude the L3 ECOM if local ES is oper-down.

Ticket: CM-30935

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agoMerge pull request #8344 from pjdruddy/coverity_mpls_l3vpn
Donald Sharp [Thu, 25 Mar 2021 23:40:34 +0000 (19:40 -0400)]
Merge pull request #8344 from pjdruddy/coverity_mpls_l3vpn

lib, bgpd: add a specific oid_copy function for IPv6 addrs

3 years agoMerge pull request #8341 from simondeziel/systemd-onfailure
Donald Sharp [Thu, 25 Mar 2021 19:00:13 +0000 (15:00 -0400)]
Merge pull request #8341 from simondeziel/systemd-onfailure

systemd's %n already includes the type suffix (.service)

3 years agoMerge pull request #8340 from mjstapp/fix_pcep_timer_race
Donald Sharp [Thu, 25 Mar 2021 18:31:04 +0000 (14:31 -0400)]
Merge pull request #8340 from mjstapp/fix_pcep_timer_race

libs: fix race in pcep lib

3 years agoMerge pull request #8292 from donaldsharp/isis_crash
Mark Stapp [Thu, 25 Mar 2021 16:52:45 +0000 (12:52 -0400)]
Merge pull request #8292 from donaldsharp/isis_crash

isisd: Prevent OOM crash in isis

3 years agoMerge pull request #8338 from idryzhov/fix-ospfd-sa-warning
Mark Stapp [Thu, 25 Mar 2021 16:15:05 +0000 (12:15 -0400)]
Merge pull request #8338 from idryzhov/fix-ospfd-sa-warning

ospfd: fix SA warning

3 years agoMerge pull request #8252 from SaiGomathiN/8249
Donald Sharp [Thu, 25 Mar 2021 15:52:12 +0000 (11:52 -0400)]
Merge pull request #8252 from SaiGomathiN/8249

pimd: support bundle commands added

3 years agolib, bgpd: add a specific oid_copy function for IPv6 addrs
Pat Ruddy [Thu, 25 Mar 2021 14:39:07 +0000 (14:39 +0000)]
lib, bgpd: add a specific oid_copy function for IPv6 addrs

Do not overload the v4 oid_copy_addr function for ipv6
coverity does not like this kind of thing.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #8332 from donaldsharp/yang_clean
David Lamparter [Thu, 25 Mar 2021 14:50:18 +0000 (15:50 +0100)]
Merge pull request #8332 from donaldsharp/yang_clean

yang: Allow `make clean` to actually clean up dependant files

3 years agotools: fix systemd OnFailure directive
Simon Deziel [Thu, 25 Mar 2021 14:35:26 +0000 (10:35 -0400)]
tools: fix systemd OnFailure directive

systemd's %n already includes the type suffix (.service)

Signed-off-by: Simon Deziel <simon@sdeziel.info>
3 years agoMerge pull request #8167 from LabNConsulting/chopps/tests-add-gdb
Donald Sharp [Thu, 25 Mar 2021 14:27:50 +0000 (10:27 -0400)]
Merge pull request #8167 from LabNConsulting/chopps/tests-add-gdb

tests: add option for auto-launching gdb

3 years agoMerge pull request #8333 from mobash-rasool/pim-fixes-2
Donald Sharp [Thu, 25 Mar 2021 14:19:12 +0000 (10:19 -0400)]
Merge pull request #8333 from mobash-rasool/pim-fixes-2

pimd: Fix hold time related issues

3 years agolibs: fix race in pcep lib
Mark Stapp [Thu, 25 Mar 2021 13:56:11 +0000 (09:56 -0400)]
libs: fix race in pcep lib

Fix a race in the libpcep timer code; reported by coverity.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoisisd: Prevent OOM crash in isis
Donald Sharp [Fri, 19 Mar 2021 13:27:51 +0000 (09:27 -0400)]
isisd: Prevent OOM crash in isis

When you set the isis mtu to 200, isis ends up in a infinite loop
trying to fragment the tlv's.

Specifically ( for me ) the extended reachability function
for packing pack_item_extended_reach requires 11 + ISIS_SUBTLV_MAX_SIZE
room in the packet.  Which is 180 bytes.  At this point we have
174 bytes that we can write into a packet.

I created this by modifying the isis-topo1 topology to all
the isis routers to have a lsp-mtu of 200 and immediately
saw the crash.

Effectively the pack_items_ function had no detection for
when a part of the next bit it was writing into the stream
could not even fit and it would go into an infinite loop
allocating ~800 bytes at a time.  This would cause the
router to run out of memory very very fast and the OOM
detector would kill the process.

Modify the code to notice that we have insufficient space to
even write any data into the stream.

I suspect that pack_item_extended_reach could also be optimized
to figure out exactly how much space is needed.  But I also
think we need this protection in the function if this ever
happens again.

I also do not understand the use case of saying the min mtu is
200.

Fixes: #8289
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8309 from opensourcerouting/init-config-read
Donald Sharp [Thu, 25 Mar 2021 13:06:16 +0000 (09:06 -0400)]
Merge pull request #8309 from opensourcerouting/init-config-read

tools: run `vtysh -b` once for all-startup

3 years agoospfd: fix SA warning
Igor Ryzhov [Thu, 25 Mar 2021 12:29:43 +0000 (15:29 +0300)]
ospfd: fix SA warning

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8329 from volta-networks/fix_unkown_lsa_U_bit
Donald Sharp [Thu, 25 Mar 2021 12:29:13 +0000 (08:29 -0400)]
Merge pull request #8329 from volta-networks/fix_unkown_lsa_U_bit

ospf6d: Do not flood unknown LSAs if U-bit is clear

3 years agoMerge pull request #8335 from ranjanyash54/link-db
Donald Sharp [Thu, 25 Mar 2021 12:05:13 +0000 (08:05 -0400)]
Merge pull request #8335 from ranjanyash54/link-db

ospf6d: Link LSAs are not getting MAX_AGE in neighbor

3 years agoMerge pull request #8316 from qlyoung/fix-doc-interface-peer
Donatas Abraitis [Thu, 25 Mar 2021 11:08:04 +0000 (13:08 +0200)]
Merge pull request #8316 from qlyoung/fix-doc-interface-peer

doc: document proper config for BGP iface peers

3 years agopimd: in 'no ip pim hello' add hold time as optional when hello interval given
Mobashshera Rasool [Thu, 25 Mar 2021 05:45:06 +0000 (05:45 +0000)]
pimd: in 'no ip pim hello' add hold time as optional when hello interval given

Issue:
  User is allowed to configure only hello without hold timer but when undo
  config, the hold timer is mandatory as shown below:
  FRR-4(config-if)# ip pim hello 10
    <cr>
    (1-180)  Time in seconds for Hold Interval
  FRR-4(config-if)# ip pim hello 10
  FRR-4(config-if)# no ip pim hello 10
    (1-180)  Time in seconds for Hold Interval
  FRR-4(config-if)# no ip pim hello 10
  % Command incomplete: no ip pim hello 20

Fix:
  Making the hold timer as optional when undo config.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agopimd: Validation that hello should be less than hold time config.
Mobashshera Rasool [Thu, 25 Mar 2021 05:12:57 +0000 (05:12 +0000)]
pimd: Validation that hello should be less than hold time config.

Also included display of hold time in CLI 'show ip pim int <intf>' cmd
and json commands.

Issue:
PIM neighbor not coming up if hold time is less than hello timer
since hello is sent every 4 sec and hold is 1 sec,
because of this nbr is flapping

Fix:
Do not allow configuration of hold timer less than hello timer
Also reset the value of hold timer to 3.5 times to hello whenever
only hello is modified so that the relationship holds good.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agoMerge pull request #7437 from ckishimo/suppress_fa
Olivier Dugeon [Thu, 25 Mar 2021 09:06:54 +0000 (10:06 +0100)]
Merge pull request #7437 from ckishimo/suppress_fa

ospfd: add support for suppress_fa

3 years agoospf6d: Link LSAs are not getting MAX_AGE in neighbor
Yash Ranjan [Thu, 11 Mar 2021 13:41:05 +0000 (05:41 -0800)]
ospf6d: Link LSAs are not getting MAX_AGE in neighbor

When the ospf6 daemon goes down, it originates MAX_AGE
LSAs for all the self-originated LSAs so that it gets
flushed from the neighbor's database. But the link-LSAs
are not getting MAX_AGE.
Set the self-originated link-LSAs age to MAX_AGE and
flood it

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
3 years agoyang: Allow `make clean` to actually clean up dependant files
Donald Sharp [Wed, 24 Mar 2021 23:27:20 +0000 (19:27 -0400)]
yang: Allow `make clean` to actually clean up dependant files

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8326 from idryzhov/hide-show-config
Renato Westphal [Wed, 24 Mar 2021 22:40:13 +0000 (19:40 -0300)]
Merge pull request #8326 from idryzhov/hide-show-config

vtysh: hide "show configuration running" command

3 years agoMerge pull request #8250 from idryzhov/fix-nb-running-get-entry
Renato Westphal [Wed, 24 Mar 2021 22:39:09 +0000 (19:39 -0300)]
Merge pull request #8250 from idryzhov/fix-nb-running-get-entry

Fix aborts when using nb_running_get_entry during validation stage

3 years agodoc: document proper config for BGP iface peers
Quentin Young [Tue, 23 Mar 2021 17:02:15 +0000 (13:02 -0400)]
doc: document proper config for BGP iface peers

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #8331 from mjstapp/fix_dev_doc_pip
Quentin Young [Wed, 24 Mar 2021 20:52:38 +0000 (20:52 +0000)]
Merge pull request #8331 from mjstapp/fix_dev_doc_pip

doc: fix url for pip 2 in dev doc

3 years agodoc: fix url for pip 2 in dev doc
Mark Stapp [Wed, 24 Mar 2021 20:21:49 +0000 (16:21 -0400)]
doc: fix url for pip 2 in dev doc

Use updated url for python2 version of pip.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #8290 from adharkar/frr-es_rt
Patrick Ruddy [Wed, 24 Mar 2021 18:10:37 +0000 (18:10 +0000)]
Merge pull request #8290 from adharkar/frr-es_rt

bgpd: Update EVPN type-1 routes when VNI RT changes

3 years agoospf6d: Do not flood unknown LSAs if U-bit is clear
Karen Schoener [Wed, 24 Mar 2021 16:49:59 +0000 (12:49 -0400)]
ospf6d: Do not flood unknown LSAs if U-bit is clear

Do not flood unknown LSAs if U-bit is clear.

Signed-off-by: Karen Schoener <karen@voltanet.io>
3 years agoospfd: add support for suppress_fa
ckishimo [Mon, 2 Nov 2020 14:28:52 +0000 (06:28 -0800)]
ospfd: add support for suppress_fa

This command will trigger the OSPF forwarding address suppression in
translated type-5 LSAs, causing a NSSA ABR to use 0.0.0.0 as a forwarding
address instead of copying the address from the type-7 LSA

Example: In a topology like: R1 --- R2(ABR) --- R3(ASBR)

R3 is announcing a type-7 LSA that is translated to type-5 by the R2 ABR.
The forwarding address in the type-5 is by default copied from the type-7

    r1# sh ip os da external

                    AS External Link States

      LS age: 6
      Options: 0x2  : *|-|-|-|-|-|E|-
      LS Flags: 0x6
      LS Type: AS-external-LSA
      Link State ID: 3.3.3.3 (External Network Number)
      Advertising Router: 10.0.25.2
      LS Seq Number: 80000001
      Checksum: 0xcf99
      Length: 36

      Network Mask: /32
            Metric Type: 2 (Larger than any link state path)
            TOS: 0
            Metric: 20
            Forward Address: 10.0.23.3    <--- address copied from type-7 lsa
            External Route Tag: 0

    r2# sh ip os database

                    NSSA-external Link States (Area 0.0.0.1 [NSSA])

    Link ID         ADV Router      Age  Seq#       CkSum  Route
    3.3.3.3         10.0.23.3          8 0x80000001 0x431d E2 3.3.3.3/32 [0x0]

                    AS External Link States

    Link ID         ADV Router      Age  Seq#       CkSum  Route
    3.3.3.3         10.0.25.2          0 0x80000001 0xcf99 E2 3.3.3.3/32 [0x0]

    r2# conf t
    r2(config)# router ospf
    r2(config-router)# area 1 nssa suppress-fa
    r2(config-router)# exit
    r2(config)# exit

    r2# sh ip os database

                    NSSA-external Link States (Area 0.0.0.1 [NSSA])

    Link ID         ADV Router      Age  Seq#       CkSum  Route
    3.3.3.3         10.0.23.3         66 0x80000001 0x431d E2 3.3.3.3/32 [0x0]

                    AS External Link States

    Link ID         ADV Router      Age  Seq#       CkSum  Route
    3.3.3.3         10.0.25.2         16 0x80000002 0x0983 E2 3.3.3.3/32 [0x0]

    r1# sh ip os da external

           OSPF Router with ID (11.11.11.11)

                    AS External Link States

      LS age: 34
      Options: 0x2  : *|-|-|-|-|-|E|-
      LS Flags: 0x6
      LS Type: AS-external-LSA
      Link State ID: 3.3.3.3 (External Network Number)
      Advertising Router: 10.0.25.2
      LS Seq Number: 80000002
      Checksum: 0x0983
      Length: 36

      Network Mask: /32
            Metric Type: 2 (Larger than any link state path)
            TOS: 0
            Metric: 20
            Forward Address: 0.0.0.0       <--- address set to 0
            External Route Tag: 0

    r2# conf t
    r2(config)# router ospf
    r2(config-router)# no area 1 nssa suppress-fa
    r2(config-router)# exit

    r1# sh ip os da external

           OSPF Router with ID (11.11.11.11)

                    AS External Link States

      LS age: 1
      Options: 0x2  : *|-|-|-|-|-|E|-
      LS Flags: 0x6
      LS Type: AS-external-LSA
      Link State ID: 3.3.3.3 (External Network Number)
      Advertising Router: 10.0.25.2
      LS Seq Number: 80000003
      Checksum: 0xcb9b
      Length: 36
      Network Mask: /32
            Metric Type: 2 (Larger than any link state path)
            TOS: 0
            Metric: 20
            Forward Address: 0.0.0.0       <--- address set to 0
            External Route Tag: 0

    r2# conf t
    r2(config)# router ospf
    r2(config-router)# no area 1 nssa suppress-fa
    r2(config-router)# exit

    r1# sh ip os da external

           OSPF Router with ID (11.11.11.11)

                    AS External Link States

      LS age: 1
      Options: 0x2  : *|-|-|-|-|-|E|-
      LS Flags: 0x6
      LS Type: AS-external-LSA
      Link State ID: 3.3.3.3 (External Network Number)
      Advertising Router: 10.0.25.2
      LS Seq Number: 80000003
      Checksum: 0xcb9b
      Length: 36

      Network Mask: /32
            Metric Type: 2 (Larger than any link state path)
            TOS: 0
            Metric: 20
            Forward Address: 10.0.23.3    <--- address copied from type-7 lsa
            External Route Tag: 0

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
3 years agodoc: add documentation for OSPF suppress-fa
ckishimo [Fri, 6 Nov 2020 08:02:43 +0000 (00:02 -0800)]
doc: add documentation for OSPF suppress-fa

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
3 years agodoc: add documentation for OSPF NSSA
ckishimo [Fri, 6 Nov 2020 08:01:55 +0000 (00:01 -0800)]
doc: add documentation for OSPF NSSA

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
3 years agoospfd: add topotest for suppress-fa feature
ckishimo [Thu, 5 Nov 2020 13:32:03 +0000 (05:32 -0800)]
ospfd: add topotest for suppress-fa feature

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
3 years agoMerge pull request #8318 from qlyoung/improve-lua-autoconf-detection
David Lamparter [Wed, 24 Mar 2021 14:05:01 +0000 (15:05 +0100)]
Merge pull request #8318 from qlyoung/improve-lua-autoconf-detection

configure.ac: better lua detection

3 years agoMerge pull request #8078 from idryzhov/fix-zebra-vni
Rafael Zalamena [Wed, 24 Mar 2021 13:32:44 +0000 (13:32 +0000)]
Merge pull request #8078 from idryzhov/fix-zebra-vni

zebra: fix vni configuration in default vrf

3 years agoMerge pull request #8325 from idryzhov/fix-ip-router-isis
David Lamparter [Wed, 24 Mar 2021 11:13:07 +0000 (12:13 +0100)]
Merge pull request #8325 from idryzhov/fix-ip-router-isis

isisd: fix extra space after "ip router isis"

3 years agovtysh: hide "show configuration running" command
Igor Ryzhov [Wed, 24 Mar 2021 10:16:15 +0000 (13:16 +0300)]
vtysh: hide "show configuration running" command

This command is currently useful only for developers.
Let's hide it to not confuse end users by having both
"show runnning-config" and "show configuration running".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8203 from opensourcerouting/ospf-bfd-napi
Igor Ryzhov [Wed, 24 Mar 2021 07:36:48 +0000 (10:36 +0300)]
Merge pull request #8203 from opensourcerouting/ospf-bfd-napi

ospfd,doc,topotests: rework OSPFv2 BFD integrantion

3 years agoMerge pull request #8184 from opensourcerouting/bfd-bgp-napi
Igor Ryzhov [Wed, 24 Mar 2021 07:36:26 +0000 (10:36 +0300)]
Merge pull request #8184 from opensourcerouting/bfd-bgp-napi

bgpd,lib: rework BGP BFD integration

3 years agoisisd: fix extra space after "ip router isis"
Igor Ryzhov [Wed, 24 Mar 2021 07:30:36 +0000 (10:30 +0300)]
isisd: fix extra space after "ip router isis"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8319 from qlyoung/doc-remove-old-index-ospf6-spf-tree
Igor Ryzhov [Wed, 24 Mar 2021 07:01:16 +0000 (10:01 +0300)]
Merge pull request #8319 from qlyoung/doc-remove-old-index-ospf6-spf-tree

doc: remove extraneous .. index:: in ospf6d.rst

3 years agodoc: remove extraneous .. index:: in ospf6d.rst
Quentin Young [Tue, 23 Mar 2021 19:36:27 +0000 (19:36 +0000)]
doc: remove extraneous .. index:: in ospf6d.rst

And delete some trailing whitespace

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoconfigure.ac: better lua detection
Quentin Young [Tue, 23 Mar 2021 19:20:38 +0000 (19:20 +0000)]
configure.ac: better lua detection

Make sure to constrain the Lua autoconf search to
Lua 5.3 interpreter and libraries.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #8261 from opensourcerouting/log-ids
Russ White [Tue, 23 Mar 2021 15:46:41 +0000 (11:46 -0400)]
Merge pull request #8261 from opensourcerouting/log-ids

lib: output unique IDs in log messages

3 years agobgpd: Update EVPN type-1 routes when VNI RT changes
Ameya Dharkar [Fri, 19 Mar 2021 01:34:45 +0000 (18:34 -0700)]
bgpd: Update EVPN type-1 routes when VNI RT changes

1. When VNI export RT changes, for each local es_evi, update local
EAD/ES and EAD/EVI routes and advertise.

2. When VNI import RT changes, uninstall all type-1 routes imported in
the VNI and import routes carrying the updated RT.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
3 years agobgpd: improve BFD with timers configuration
Rafael Zalamena [Tue, 23 Mar 2021 15:19:20 +0000 (12:19 -0300)]
bgpd: improve BFD with timers configuration

Move `bgp_peer_config_apply` outside `bgp_peer_configure_bfd` (and
document it) so we only call the session installation once with one
set of timers. It also makes all calls of that function
equal (e.g. always calls `bgp_peer_config_apply` afterwards).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: document new BGP debug option
Rafael Zalamena [Fri, 5 Mar 2021 10:35:54 +0000 (07:35 -0300)]
doc: document new BGP debug option

Let user know what the debug knob does.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agobgpd: add debug option for BFD
Rafael Zalamena [Mon, 1 Mar 2021 19:07:28 +0000 (16:07 -0300)]
bgpd: add debug option for BFD

Add new BGP debug option to enable BFD related debugging messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agobgpd: rework BFD integration
Rafael Zalamena [Fri, 26 Feb 2021 19:50:51 +0000 (16:50 -0300)]
bgpd: rework BFD integration

Remove old BFD API usage and replace it with the new one.

Highlights:

 - More shared code: the daemon gets notified with callbacks instead of
   having to roll its own code to find the notified sessions.

 - Less code to integrate with BFD.

 - Remove hidden commands to configure single / multi hop. Use
   protocol data instead.

   BGP can determine if a peer is single/multi hop according to the
   following criteria:

    a. If the IP address is a link-local address (single hop)

    b. The network is shared with peer (single hop)

    c. BGP is configured for eBGP multi hop / TTL security (multi hop)

 - Respect the configuration hierarchy:

    a. Peer configuration take precendence over peer-group
       configuration.

    b. When peer group configuration is removed, reset peer
       BFD configurations to defaults (unless peer had specific
       configs).

       Example:

         neighbor foo peer-group
         neighbor foo bfd profile X
         neighbor 192.168.0.2 peer-group foo
         neighbor 192.168.0.2 bfd
         ! If peer-group is removed the profile configuration gets
         ! removed from peer 192.168.0.2, but BFD will still enabled
         ! because of the neighbor specific bfd configuration.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agobgpd: remove cumulus specific code
Rafael Zalamena [Fri, 26 Feb 2021 19:51:00 +0000 (16:51 -0300)]
bgpd: remove cumulus specific code

The BFD function `bgp_bfd_is_peer_multihop` will no longer exist and now
both code paths are equal.

Longer explanation:
Cumulus was previously using the BFD function to help determine whether a
peer is multi hop or not, because there is a configuration to set BFD
to use single or multi hop.

Current BFD code can automatically pick between single/multi hop by
using the protocol information and so it is a good idea to have that
tested/used than relying on yet another duplicated information.

(BFD extracts the TTL information from protocol and selects
single/multi hop based on that)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agolib: small BFD session notifier improvement
Rafael Zalamena [Tue, 2 Mar 2021 11:52:35 +0000 (08:52 -0300)]
lib: small BFD session notifier improvement

Cache current monotime to avoid unnecessary calls.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agolib: new BFD integration API
Rafael Zalamena [Wed, 26 Aug 2020 20:08:41 +0000 (17:08 -0300)]
lib: new BFD integration API

New BFD protocol integration API with abstractions to fix most common
protocol integration errors:

 - Set address family together with the source/destination addresses

 - Set the TTL together with the single/multi hop option

 - Set/unset profile/interface easily

 - Keep the arguments so we don't have to rebuild them every time

 - Install/uninstall functions that keep track of current state so the
  daemon doesn't have to

 - Reinstall when critical configuration changes (address, multi hop
   etc...)

 - Reconfigure BFD when the daemon restarts automatically

 - Automatically calls the user defined callback for session update

 - Shutdown handler for all protocols

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoMerge pull request #8253 from opensourcerouting/topotest-python3-backports
Russ White [Tue, 23 Mar 2021 15:25:35 +0000 (11:25 -0400)]
Merge pull request #8253 from opensourcerouting/topotest-python3-backports

tests: iproute2 VRF capability check for topotests

3 years agoMerge pull request #8271 from idryzhov/fix-show-ip-ospf-database
Russ White [Tue, 23 Mar 2021 15:19:32 +0000 (11:19 -0400)]
Merge pull request #8271 from idryzhov/fix-show-ip-ospf-database

ospfd: fix "show ip ospf database" issues

3 years agoMerge pull request #8312 from pjdruddy/update-topotest-snmp-install-doc
Donatas Abraitis [Tue, 23 Mar 2021 14:41:20 +0000 (16:41 +0200)]
Merge pull request #8312 from pjdruddy/update-topotest-snmp-install-doc

doc: add libsnmp-dev install line

3 years agoMerge pull request #8305 from donaldsharp/bgp_ll_ifp_change
Russ White [Tue, 23 Mar 2021 14:08:18 +0000 (10:08 -0400)]
Merge pull request #8305 from donaldsharp/bgp_ll_ifp_change

bgpd: Reset LLA NHT's interface if there is a change

3 years agoMerge pull request #8307 from opensourcerouting/mtypes-cleanup-20210322
Russ White [Tue, 23 Mar 2021 14:07:28 +0000 (10:07 -0400)]
Merge pull request #8307 from opensourcerouting/mtypes-cleanup-20210322

isisd, eigrpd, pathd: clean up & drop *_memory.[ch] files, make a whole bunch static

3 years agoMerge pull request #8120 from ton31337/feature/bgp_ipv6_default_activated
Russ White [Tue, 23 Mar 2021 13:36:43 +0000 (09:36 -0400)]
Merge pull request #8120 from ton31337/feature/bgp_ipv6_default_activated

bgpd: Activate ipv6-unicast for peer automatically if globally defined

3 years agoospfd: fix checkpatch warnings
Rafael Zalamena [Tue, 23 Mar 2021 12:29:24 +0000 (09:29 -0300)]
ospfd: fix checkpatch warnings

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: document new OSPF debug option
Rafael Zalamena [Fri, 5 Mar 2021 10:45:59 +0000 (07:45 -0300)]
doc: document new OSPF debug option

Let user know what does the BFD debug knob does.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospfd: add debug option for BFD
Rafael Zalamena [Thu, 4 Mar 2021 18:15:00 +0000 (15:15 -0300)]
ospfd: add debug option for BFD

Add specialized debug option for BFD which also enables library debugging.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: test OSPF BFD profile
Rafael Zalamena [Thu, 4 Mar 2021 14:11:01 +0000 (11:11 -0300)]
topotests: test OSPF BFD profile

Use BFD profiles in test to make sure it doesn't break.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: update OSPF BFD documentation
Rafael Zalamena [Thu, 4 Mar 2021 13:01:55 +0000 (10:01 -0300)]
doc: update OSPF BFD documentation

Tell users that OSPFv2 now supports BFD profiles.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospfd: support BFD profiles
Rafael Zalamena [Thu, 4 Mar 2021 14:10:20 +0000 (11:10 -0300)]
ospfd: support BFD profiles

Add new command to configure BFD peers to use a specific profile.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospfd: rework BFD integration
Rafael Zalamena [Wed, 3 Mar 2021 20:22:47 +0000 (17:22 -0300)]
ospfd: rework BFD integration

Use new BFD API to integrate with OSPFv2.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agolib: small BFD session notifier improvement
Rafael Zalamena [Tue, 2 Mar 2021 11:52:35 +0000 (08:52 -0300)]
lib: small BFD session notifier improvement

Cache current monotime to avoid unnecessary calls.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agolib: new BFD integration API
Rafael Zalamena [Wed, 26 Aug 2020 20:08:41 +0000 (17:08 -0300)]
lib: new BFD integration API

New BFD protocol integration API with abstractions to fix most common
protocol integration errors:

 - Set address family together with the source/destination addresses

 - Set the TTL together with the single/multi hop option

 - Set/unset profile/interface easily

 - Keep the arguments so we don't have to rebuild them every time

 - Install/uninstall functions that keep track of current state so the
  daemon doesn't have to

 - Reinstall when critical configuration changes (address, multi hop
   etc...)

 - Reconfigure BFD when the daemon restarts automatically

 - Automatically calls the user defined callback for session update

 - Shutdown handler for all protocols

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: add libsnmp-dev install line
Pat Ruddy [Tue, 23 Mar 2021 10:14:08 +0000 (10:14 +0000)]
doc: add libsnmp-dev install line

Do not assume libsnmp-dev is installed.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #8296 from chiragshah6/mdev
Igor Ryzhov [Mon, 22 Mar 2021 21:19:33 +0000 (00:19 +0300)]
Merge pull request #8296 from chiragshah6/mdev

bgpd: convert send-community to transactional cli

3 years agodoc: add missing vrf parameter to "show ip ospf database ..." commands
Igor Ryzhov [Mon, 22 Mar 2021 09:31:15 +0000 (12:31 +0300)]
doc: add missing vrf parameter to "show ip ospf database ..." commands

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>