]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years ago*: Convert from ->interface_up to the interface callback
Donald Sharp [Thu, 19 Sep 2019 03:07:44 +0000 (23:07 -0400)]
*: Convert from ->interface_up to the interface callback

For all the places we have a zclient->interface_up convert
them to use the interface ifp_up callback instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years ago*: Switch all zclient->interface_add to interface create callback
Donald Sharp [Thu, 19 Sep 2019 02:26:55 +0000 (22:26 -0400)]
*: Switch all zclient->interface_add to interface create callback

Switch the zclient->interface_add functionality to have everyone
use the interface create callback in lib/if.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years ago*: Add infrastructure to support zapi interface callbacks
Donald Sharp [Wed, 18 Sep 2019 20:20:04 +0000 (16:20 -0400)]
*: Add infrastructure to support zapi interface callbacks

Start the conversion to allow zapi interface callbacks to be
controlled like vrf creation/destruction/change callbacks.

This will allow us to consolidate control into the interface.c
instead of having each daemon read the stream and react accordingly.
This will hopefully reduce a bunch of cut-n-paste stuff

Create 4 new callback functions that will be controlled by
lib/if.c

create -> A upper level protocol receives an interface creation event
The ifp is brand spanking newly created in the system.
up -> A upper level protocol receives a interface up event
This means the interface is up and ready to go.
down -> A upper level protocol receives a interface down
destroy -> A upper level protocol receives a destroy event
This means to delete the pointers associated with it.

At this point this is just boilerplate setup for future commits.
There is no new functionality.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib, zebra: Allow for interface deletion when kernel event happens
Donald Sharp [Wed, 18 Sep 2019 17:42:46 +0000 (13:42 -0400)]
lib, zebra: Allow for interface deletion when kernel event happens

When zebra gets a callback from the kernel that an interface has
actually been deleted *and* the end users has not configured
the interface, then allow for deletion of the interface from zebra.

This is especially important in a docker environment where containers
and their veth interfaces are treated as ephermeal.  FRR can quickly
have an inordinate amount of interfaces sitting around that are
not in the kernel and we have no way to clean them up either.

My expectation is that this will cause a second order crashes
in upper level protocols, but I am not sure how to catch these
and fix them now ( suggestions welcome ).  There are too many
use patterns and order based events that I cannot know for certain
that we are going to see any at all, until someone sees this problem
as a crash :(  I do not recommend that this be put in the current
stabilization branch and allow this to soak in master for some time
first.

Testing:

sharpd@donna ~/frr4> sudo ip link add vethdj type veth peer name vethjd
sharpd@donna ~/frr4> sudo ip link add vethaa type veth peer name vethab
sharpd@donna ~/frr4> sudo vtysh -c "show int brief"
Interface       Status  VRF             Addresses
---------       ------  ---             ---------
dummy1          down    default
enp0s3          up      default         10.0.2.15/24
enp0s8          up      default         192.168.209.2/24
enp0s9          up      default         192.168.210.2/24
enp0s10         up      default         192.168.212.4/24
lo              up      default         10.22.89.38/32
vethaa          down    default
vethab          down    default
vethdj          down    default
vethjd          down    default
virbr0          up      default         192.168.122.1/24
virbr0-nic      down    default

sharpd@donna ~/frr4> sudo ip link set vethaa up
sharpd@donna ~/frr4> sudo ip link set vethab up
sharpd@donna ~/frr4> sudo ip link del vethdj
sharpd@donna ~/frr4> sudo vtysh -c "show int brief"
Interface       Status  VRF             Addresses
---------       ------  ---             ---------
dummy1          down    default
enp0s3          up      default         10.0.2.15/24
enp0s8          up      default         192.168.209.2/24
enp0s9          up      default         192.168.210.2/24
enp0s10         up      default         192.168.212.4/24
lo              up      default         10.22.89.38/32
vethaa          up      default
vethab          up      default
virbr0          up      default         192.168.122.1/24
virbr0-nic      down    default

sharpd@donna ~/frr4> sudo ip link del vethaa
sharpd@donna ~/frr4> sudo vtysh -c "show int brief"
Interface       Status  VRF             Addresses
---------       ------  ---             ---------
dummy1          down    default
enp0s3          up      default         10.0.2.15/24
enp0s8          up      default         192.168.209.2/24
enp0s9          up      default         192.168.210.2/24
enp0s10         up      default         192.168.212.4/24
lo              up      default         10.22.89.38/32
virbr0          up      default         192.168.122.1/24
virbr0-nic      down    default

sharpd@donna ~/frr4> sudo ip link add vethaa type veth peer name vethab
sharpd@donna ~/frr4> sudo vtysh -c "show int brief"
Interface       Status  VRF             Addresses
---------       ------  ---             ---------
dummy1          down    default
enp0s3          up      default         10.0.2.15/24
enp0s8          up      default         192.168.209.2/24
enp0s9          up      default         192.168.210.2/24
enp0s10         up      default         192.168.212.4/24
lo              up      default         10.22.89.38/32
vethaa          down    default
vethab          down    default
virbr0          up      default         192.168.122.1/24
virbr0-nic      down    default

sharpd@donna ~/frr4> sudo vtysh -c "show run"
Building configuration...

Current configuration:
!
frr version 7.2-dev
frr defaults datacenter
hostname donna.cumulusnetworks.com
log stdout
no ipv6 forwarding
!
ip route 192.168.3.0/24 192.168.209.1
ip route 192.168.4.0/24 blackhole
ip route 192.168.5.0/24 192.168.209.1
ip route 192.168.6.0/24 192.168.209.1
ip route 192.168.7.0/24 99.99.99.99 nexthop-vrf EVA
ip route 192.168.8.0/24 192.168.209.1
ip route 4.5.6.7/32 12.13.14.15
!
interface dummy1
 ip address 12.13.14.15/32
!
interface vethaa
 description FROO
!
line vty
!
end
sharpd@donna ~/frr4> sudo ip link del vethaa
sharpd@donna ~/frr4> sudo vtysh -c "show int brief"
Interface       Status  VRF             Addresses
---------       ------  ---             ---------
dummy1          down    default
enp0s3          up      default         10.0.2.15/24
enp0s8          up      default         192.168.209.2/24
enp0s9          up      default         192.168.210.2/24
enp0s10         up      default         192.168.212.4/24
lo              up      default         10.22.89.38/32
vethaa          down    default
virbr0          up      default         192.168.122.1/24
virbr0-nic      down    default

sharpd@donna ~/frr4> sudo vtysh -c "show run"
Building configuration...

Current configuration:
!
frr version 7.2-dev
frr defaults datacenter
hostname donna.cumulusnetworks.com
log stdout
no ipv6 forwarding
!
ip route 192.168.3.0/24 192.168.209.1
ip route 192.168.4.0/24 blackhole
ip route 192.168.5.0/24 192.168.209.1
ip route 192.168.6.0/24 192.168.209.1
ip route 192.168.7.0/24 99.99.99.99 nexthop-vrf EVA
ip route 192.168.8.0/24 192.168.209.1
ip route 4.5.6.7/32 12.13.14.15
!
interface dummy1
 ip address 12.13.14.15/32
!
interface vethaa
 description FROO
!
line vty
!
end

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Saving interface description makes no sense on deletion
Donald Sharp [Thu, 19 Sep 2019 17:27:04 +0000 (13:27 -0400)]
zebra: Saving interface description makes no sense on deletion

We were storing the interface description irrelevant of whether
or not it was a newlink or dellink.  This makes no sense.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #4731 from mjstapp/fix_redist_update
Donald Sharp [Wed, 18 Sep 2019 23:43:43 +0000 (19:43 -0400)]
Merge pull request #4731 from mjstapp/fix_redist_update

zebra: redistribute deletes when updating selected route

4 years agoMerge pull request #4990 from qlyoung/yang-iface-operdata
Renato Westphal [Wed, 18 Sep 2019 22:41:27 +0000 (19:41 -0300)]
Merge pull request #4990 from qlyoung/yang-iface-operdata

lib: add oper data cbs for ifaces

4 years agoMerge pull request #5004 from idryzhov/fix-vtysh-prefix-list
Donald Sharp [Wed, 18 Sep 2019 21:38:00 +0000 (17:38 -0400)]
Merge pull request #5004 from idryzhov/fix-vtysh-prefix-list

vtysh: fix multiple "no ip/ipv6 prefix-list sequence-number" lines in running-config

4 years agolib: add oper data cbs for ifaces
Quentin Young [Thu, 12 Sep 2019 21:35:04 +0000 (21:35 +0000)]
lib: add oper data cbs for ifaces

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5008 from opensourcerouting/nb-improvements
Quentin Young [Wed, 18 Sep 2019 19:42:06 +0000 (15:42 -0400)]
Merge pull request #5008 from opensourcerouting/nb-improvements

northbound fixes and enhancements

4 years agolib: add an exception in the northbound for operational data callbacks
Renato Westphal [Wed, 18 Sep 2019 13:55:55 +0000 (10:55 -0300)]
lib: add an exception in the northbound for operational data callbacks

During initialization, the northbound detects if any required
callback is missing (fatal error) or if any unneeded callback is
present (warning).

There are three callbacks, however, that should require special
handling: get_next(), get_keys() and lookup_entry().

These callbacks are normally unneeded for configuration lists. But,
if a configuration list is augmented with new state nodes by another
module, then the three callbacks mentioned above become required. In
this case, never log a warning when these callbacks are implemented
when they are not needed, since this depends on context (e.g. some
daemons might augment "frr-interface" while others don't).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: fix ordering issues in the northbound
Renato Westphal [Tue, 27 Aug 2019 01:31:21 +0000 (22:31 -0300)]
lib: fix ordering issues in the northbound

When a configuration transaction is being performed, the northbound
uses a red-black tree to store the configuration changes that need to
be processed. The problem is that we were sorting the configuration
changes based on their XPaths (and callback priorities). This means
the original order of the changes wasn't being respected, which is
a problem for lists that use the "ordered-by user" statement. To
fix this, add a new "seq" member to the "nb_config_cb" structure
so that we can preserve the order of the configuration changes as
told by libyang.

Since none of the FRR modules use "ordered-by user" lists so far,
no daemon was affected by this problem.

Reported-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: fix corner case when iterating over YANG-modeled operational data
Renato Westphal [Tue, 17 Sep 2019 01:57:10 +0000 (22:57 -0300)]
lib: fix corner case when iterating over YANG-modeled operational data

When updating the XPath during the iteration of operational data,
include the namespace of the augmenting module when necessary.

Reported-by: Quentin Young <qlyoung@cumulusnetworks.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoRevert "lib: introduce a read-write lock for northbound configurations"
Renato Westphal [Tue, 17 Sep 2019 00:51:11 +0000 (21:51 -0300)]
Revert "lib: introduce a read-write lock for northbound configurations"

Adding a lock to protect the global running configuration doesn't
help much since the FRR daemons are not prepared to process
configuration changes in a pthread that is not the main one (a
whole lot of new protections would be necessary to prevent race
conditions).

This means the lock added by commit 83981138 only adds more
complexity for no benefit. Remove it now to simplify the code.

All northbound clients, including the gRPC one, should either run
in the main pthread or use synchronization primitives to process
configuration transactions in the main pthread.

This reverts commit 83981138fe8c1e0a40b8dede74eca65449dda5de.

4 years agolib: introduce new 'pre_validate' northbound callback
Renato Westphal [Thu, 12 Sep 2019 22:07:54 +0000 (19:07 -0300)]
lib: introduce new 'pre_validate' northbound callback

This callback can be used to validate subsections of the
configuration being committed before validating the configuration
changes themselves. It's useful to perform more complex validations
that depend on the relationship between multiple nodes.

Only YANG-level validation (performed by libyang) and the
NB_EV_VALIDATE validation (that can be used to validate individual
configuration changes) proved to be insufficient in some cases.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib: add yang wrappers for IP prefixes
Renato Westphal [Wed, 7 Aug 2019 15:24:43 +0000 (12:24 -0300)]
lib: add yang wrappers for IP prefixes

We had wrappers for IPv4 and IPv6 prefixes, but not for IP (version
agnostic) prefixes. This commit addresses this issue.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoMerge pull request #5006 from manuhalo/fix_ftn_uninstall
Donald Sharp [Wed, 18 Sep 2019 16:09:08 +0000 (12:09 -0400)]
Merge pull request #5006 from manuhalo/fix_ftn_uninstall

zebra: fix mpls ftn uninstall

4 years agozebra: fix mpls ftn uninstall
Emanuele Di Pascale [Wed, 18 Sep 2019 14:01:36 +0000 (16:01 +0200)]
zebra: fix mpls ftn uninstall

when a client disconnects, we iterate over the routing table to
remove any label that originated from that client. However we
were erroneously passing the route type to the function, while
it was expecting the lsp type. As a result, for example, killing
ldpd would not remove the ldp labels from the routes.

Kudos to @rwestphal for pointing me to the source of the issue.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agoMerge pull request #5003 from manuhalo/fix_bgp_bmp_oot_build
Renato Westphal [Wed, 18 Sep 2019 13:59:43 +0000 (10:59 -0300)]
Merge pull request #5003 from manuhalo/fix_bgp_bmp_oot_build

bgpd: fix include path for bgp_bmp_clippy.c

4 years agovtysh: fix multiple "no ip/ipv6 prefix-list sequence-number" lines in running-config
Igor Ryzhov [Wed, 18 Sep 2019 11:19:55 +0000 (14:19 +0300)]
vtysh: fix multiple "no ip/ipv6 prefix-list sequence-number" lines in running-config

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agoMerge pull request #4984 from Alexis-ROYER/pim-doc#4965
Donald Sharp [Wed, 18 Sep 2019 10:40:09 +0000 (06:40 -0400)]
Merge pull request #4984 from Alexis-ROYER/pim-doc#4965

[PIM] Confusing documentation for `ip pim sm` command (#4965)

4 years agobgpd: fix include path for bgp_bmp_clippy.c
Emanuele Di Pascale [Wed, 18 Sep 2019 09:49:24 +0000 (11:49 +0200)]
bgpd: fix include path for bgp_bmp_clippy.c

not using a relative path was breaking out-of-tree compilation

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
4 years agodoc/user: Confusing documentation for `ip pim sm`
Alexis Royer [Mon, 16 Sep 2019 09:33:50 +0000 (10:33 +0100)]
doc/user: Confusing documentation for `ip pim sm`

Modification of the documentation for the `ip pim sm` command in order to avoid the understanding of an incompatibility with IGMP on the interface.

Signed-off-by: Alexis Royer <alexis.royer@gmail.com>
4 years agoMerge pull request #4966 from Orange-OpenSource/isis-TE
Renato Westphal [Tue, 17 Sep 2019 23:49:52 +0000 (20:49 -0300)]
Merge pull request #4966 from Orange-OpenSource/isis-TE

isisd: Update TLVs processing for TE, RI & SR

4 years agoMerge pull request #5001 from qlyoung/fix-frr-pthread-reachable-blocks
Russ White [Tue, 17 Sep 2019 23:21:16 +0000 (19:21 -0400)]
Merge pull request #5001 from qlyoung/fix-frr-pthread-reachable-blocks

lib: clean up frr_pthread structs at exit

4 years agoMerge pull request #4996 from opensourcerouting/build-tags
Donald Sharp [Tue, 17 Sep 2019 23:07:39 +0000 (19:07 -0400)]
Merge pull request #4996 from opensourcerouting/build-tags

build: fix "make tags"

4 years agolib: clean up frr_pthread structs at exit
Quentin Young [Tue, 17 Sep 2019 16:12:28 +0000 (16:12 +0000)]
lib: clean up frr_pthread structs at exit

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoisisd: Update TLVs processing for TE, RI & SR
Olivier Dugeon [Fri, 26 Jul 2019 14:07:39 +0000 (16:07 +0200)]
isisd: Update TLVs processing for TE, RI & SR

In preparation to Segment Routing:
 - Update the management of Traffic Engineering subTLVs to the new tlvs parser
 - Add Router Capability TLV 242 as per RFC 4971 & 7981
 - Add Segment Routing subTLVs as per draft-isis-segment-routing-extension-25

Modified files:
 - isis_tlvs.h: add new structure to manage TE subTLVs, TLV 242 & SR subTLVs
 - isis_tlvs.c: add new functions (pack, copy, free, unpack & print) to process
   TE subTLVs, Router Capability TLV and SR subTLVs
 - isis_circuit.[c,h] & isis_lsp.[c,h]: update to new subTLVs & TLV processing
 - isis_te.[c,h]: remove all old TE structures and managment functions,
   and add hook call to set local and remote IP addresses as wellas update TE
   parameters
 - isis_zebra.[c,h]: add hook call when new interface is up
 - isis_mt.[c,h], isis_pdu.c & isis_northbound.c: adjust to new TE subTLVs
 - tests/isisd/test_fuzz_isis_tlv_tests.h.gz: adapte fuuz tests to new parser

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
4 years agoMerge pull request #4861 from NaveenThanikachalam/logs
Lou Berger [Tue, 17 Sep 2019 15:33:43 +0000 (11:33 -0400)]
Merge pull request #4861 from NaveenThanikachalam/logs

BGP: Rectifying the log messages.

4 years agoMerge pull request #4992 from opensourcerouting/isisd-assorted-changes
Olivier Dugeon [Tue, 17 Sep 2019 15:30:01 +0000 (17:30 +0200)]
Merge pull request #4992 from opensourcerouting/isisd-assorted-changes

isisd: assorted changes

4 years agobuild: fix "make tags"
David Lamparter [Tue, 17 Sep 2019 14:32:26 +0000 (16:32 +0200)]
build: fix "make tags"

Anything we list in a xxx_SOURCES variable will be included for "make
tags", including filess marked as nodist_xxx_SOURCES.  So if we don't
have Protobuf enabled, even though the entire library isn't built, "make
tags" will still try to process these files... which we can't
autogenerate because Protobuf is disabled.  Same for gRPC.

Fixes: #3266
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agoMerge pull request #4993 from ton31337/fix/remove_trailing_whitespaces
Donald Sharp [Tue, 17 Sep 2019 11:49:51 +0000 (07:49 -0400)]
Merge pull request #4993 from ton31337/fix/remove_trailing_whitespaces

bgpd: Remove trailing whitespaces from some header files

4 years agoMerge pull request #4988 from donaldsharp/watchfrr_ignore_daemon
Russ White [Tue, 17 Sep 2019 11:48:14 +0000 (07:48 -0400)]
Merge pull request #4988 from donaldsharp/watchfrr_ignore_daemon

Watchfrr ignore daemon

4 years agoMerge pull request #4981 from donaldsharp/bgp_distance
Russ White [Tue, 17 Sep 2019 11:45:29 +0000 (07:45 -0400)]
Merge pull request #4981 from donaldsharp/bgp_distance

Bgp distance

4 years agoMerge pull request #4980 from sworleys/PBR-Check-NHT-GW-Ifindex
Russ White [Tue, 17 Sep 2019 11:39:36 +0000 (07:39 -0400)]
Merge pull request #4980 from sworleys/PBR-Check-NHT-GW-Ifindex

pbrd: Handle GATEWAY_IFINDEX nht conflicts

4 years agoMerge pull request #4970 from shikenghua/prefer_global
Russ White [Tue, 17 Sep 2019 11:33:05 +0000 (07:33 -0400)]
Merge pull request #4970 from shikenghua/prefer_global

bgpd: prefer-global command not working on IPv4 peers

4 years agoMerge pull request #4887 from vishaldhingra/lcomm_json
Russ White [Tue, 17 Sep 2019 11:30:17 +0000 (07:30 -0400)]
Merge pull request #4887 from vishaldhingra/lcomm_json

lib: rmap dep table is not correct in case of exact-match clause

4 years agoMerge pull request #4810 from qlyoung/fix-pthread-bad-pointer
Russ White [Tue, 17 Sep 2019 11:27:12 +0000 (07:27 -0400)]
Merge pull request #4810 from qlyoung/fix-pthread-bad-pointer

Fix potential frr_pthread.c stale pointer

4 years agoMerge pull request #4564 from pguibert6WIND/misc_vrf_update_name
Russ White [Tue, 17 Sep 2019 11:22:22 +0000 (07:22 -0400)]
Merge pull request #4564 from pguibert6WIND/misc_vrf_update_name

Misc vrf update name

4 years agoMerge pull request #4985 from qlyoung/fix-bgp-zero-keepalive-timer
Donatas Abraitis [Tue, 17 Sep 2019 09:39:50 +0000 (12:39 +0300)]
Merge pull request #4985 from qlyoung/fix-bgp-zero-keepalive-timer

bgpd: do not send keepalives when KA timer is 0

4 years agobgpd: Remove trailing whitespaces from some header files
Donatas Abraitis [Tue, 17 Sep 2019 08:27:03 +0000 (11:27 +0300)]
bgpd: Remove trailing whitespaces from some header files

This is annoying when editing a file and saving the file. IDEs like
VSCode can automatically remove trailing whitespaces, hence it would be better
having a clean code before pushing other changes.

I step onto this not the first time.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoMerge pull request #4991 from qlyoung/readme-add-apt-repo
Donatas Abraitis [Tue, 17 Sep 2019 05:35:03 +0000 (08:35 +0300)]
Merge pull request #4991 from qlyoung/readme-add-apt-repo

README.md: add reference to apt repo

4 years agoisisd: fix validation of prefix-sid flags
Renato Westphal [Fri, 9 Aug 2019 17:18:52 +0000 (14:18 -0300)]
isisd: fix validation of prefix-sid flags

The original check would always evaluate to false since
ISIS_PREFIX_SID_VALUE and ISIS_PREFIX_SID_LOCAL have different
values.  Use !! to normalize the return value of the individual
checks to either 0 or 1, making the code do what was intended
(ensure the V/L flags are both 0 or 1).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoREADME.md: add reference to apt repo
Quentin Young [Tue, 17 Sep 2019 03:53:17 +0000 (03:53 +0000)]
README.md: add reference to apt repo

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoisisd: introduce new route update hook
Renato Westphal [Wed, 7 Aug 2019 22:44:11 +0000 (19:44 -0300)]
isisd: introduce new route update hook

This hook will be called whenever a route is added, updated or
deleted.  It will be used, for instance, by the SR code to keep
Prefix-SIDs in sync with their associated routes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoisisd: move management of route flags out of isis_zebra.c
Renato Westphal [Wed, 7 Aug 2019 22:42:18 +0000 (19:42 -0300)]
isisd: move management of route flags out of isis_zebra.c

For better modularity, isis_zebra.c should only contain code used
to communicate with zebra. The management of route flags belongs
to isis_route.c.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoisisd: remove leftover from old dict code
Renato Westphal [Wed, 14 Aug 2019 16:31:48 +0000 (13:31 -0300)]
isisd: remove leftover from old dict code

This is unnecessary since commit 4bef0ec4fbe was merged.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoMerge pull request #4987 from mjstapp/fix_unused_nht_api
Donald Sharp [Mon, 16 Sep 2019 21:19:46 +0000 (17:19 -0400)]
Merge pull request #4987 from mjstapp/fix_unused_nht_api

zebra: remove empty, unused internal api

4 years agowatchfrr: Convert `wtf` to a more meaningful message
Donald Sharp [Mon, 16 Sep 2019 18:25:55 +0000 (14:25 -0400)]
watchfrr: Convert `wtf` to a more meaningful message

There is a fairly common state we are seeing where watchfrr
has decided that something is not right and is printing out
a `wtf` message.  At this point I am not sure what is going on
or how we are getting here, but let's add a bit more data dump
to the message so that we can figure out what is going on.

This is mainly being done because at this point in time I have no
clue the what/how of how we got here and I cannot reproduce.
Maybe by adding more useful information here I can figure out what is
going on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
4 years agodoc: Add watchfrr documentation
Donald Sharp [Mon, 16 Sep 2019 18:22:22 +0000 (14:22 -0400)]
doc: Add watchfrr documentation

Start the documentation for watchfrr.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agowatchfrr: Allow end users to turn off watchfrr for a particular daemon
Donald Sharp [Mon, 16 Sep 2019 17:47:50 +0000 (13:47 -0400)]
watchfrr: Allow end users to turn off watchfrr for a particular daemon

Allow an end user who is debugging behavior, with say gdb, to turn
off watchfrr and it's attempts to keep control of a daemons up/responsiveness

With code change:
donna.cumulusnetworks.com# show watchfrr
watchfrr global phase: Idle
  zebra                Up
  bgpd                 Up/Ignoring Timeout
  staticd              Up

Now grab bgpd with gdb:

sharpd@donna ~/frr4> date ; sudo gdb -p 27893
Mon 16 Sep 2019 01:44:57 PM EDT
GNU gdb (GDB) Fedora 8.3-6.fc30
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 27893
[New LWP 27894]
[New LWP 27895]
[New LWP 27896]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f1787a3e5c7 in poll () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install glibc-2.29-15.fc30.x86_64 gperftools-libs-2.7-5.fc30.x86_64 json-c-0.13.1-4.fc30.x86_64 libcap-2.26-5.fc30.x86_64 libgcc-9.1.1-1.fc30.x86_64 libgcrypt-1.8.4-3.fc30.x86_64 libgpg-error-1.33-2.fc30.x86_64 libstdc++-9.1.1-1.fc30.x86_64 libxcrypt-4.4.6-2.fc30.x86_64 libyang-0.16.105-1.fc30.x86_64 lua-libs-5.3.5-5.fc30.x86_64 lz4-libs-1.8.3-2.fc30.x86_64 pcre-8.43-2.fc30.x86_64 xz-libs-5.2.4-5.fc30.x86_64
(gdb)

In another window we can see when watchfrr thinks it's not responding:

donna.cumulusnetworks.com# show watchfrr
watchfrr global phase: Idle
  zebra                Up
  bgpd                 Unresponsive/Ignoring Timeout
  staticd              Up

Finally exit gdb and watchfrr now believes bgpd is good to go again:

donna.cumulusnetworks.com# show watchfrr
watchfrr global phase: Idle
  zebra                Up
  bgpd                 Up/Ignoring Timeout
  staticd              Up

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: do not send keepalives when KA timer is 0
Quentin Young [Mon, 16 Sep 2019 15:33:49 +0000 (15:33 +0000)]
bgpd: do not send keepalives when KA timer is 0

RFC4271 specifies behavior when the hold timer is sent to zero - we
should not send keepalives or run a hold timer. But FRR, and other
vendors, allow the keepalive timer to be set to zero with a nonzero hold
timer. In this case we were sending keepalives constantly and maxing out
a pthread to do so. Instead behave similarly to other vendors and do not
send keepalives.

Unsure what the utility of this is, but blasting keepalives is
definitely the wrong thing to do.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agotests: update tests for pthread init changes
Quentin Young [Mon, 12 Aug 2019 18:15:05 +0000 (18:15 +0000)]
tests: update tests for pthread init changes

Need to init frr_pthreads manually in tests now.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: handle frr_pthread_init/fini in libfrr init
Quentin Young [Fri, 9 Aug 2019 18:03:01 +0000 (18:03 +0000)]
lib: handle frr_pthread_init/fini in libfrr init

Make sure we are always cleaning init'ing and cleaning up pthread infra.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agolib: delete pthread from tracking list on delete
Quentin Young [Fri, 9 Aug 2019 18:01:06 +0000 (18:01 +0000)]
lib: delete pthread from tracking list on delete

Pthreads were not being deleted from the list after destruction. This
isn't causing any bugs currently but that's just by dumb luck.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agozebra: remove empty, unused internal api
Mark Stapp [Mon, 16 Sep 2019 16:00:14 +0000 (12:00 -0400)]
zebra: remove empty, unused internal api

Remove a leftover, empty nht api call from zebra.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agolib: rmap dep table is not correct in case of exact-match clause
vdhingra [Tue, 27 Aug 2019 10:45:54 +0000 (03:45 -0700)]
lib: rmap dep table is not correct in case of exact-match clause

User pass the string match large-community 1 exact-match from CLI.
Now route map lib has got the string as "1 exact-match". It passes the string
to call back for compilation. BGP will parse this string and came to know
that for "1" it has to do exact match. Routemap lib has to save "1" in it’s
dependency table. Here routemap is saving this as a “1 exact-match”
which is wrong. The solution is used the compiled data.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
4 years agoMerge pull request #4834 from srimohans/support_bundle
Donald Sharp [Sat, 14 Sep 2019 11:47:26 +0000 (07:47 -0400)]
Merge pull request #4834 from srimohans/support_bundle

 tools: Modifications to copy support bundle files

4 years agoMerge pull request #4975 from opensourcerouting/disable-ecmp2-test
Donald Sharp [Sat, 14 Sep 2019 11:43:31 +0000 (07:43 -0400)]
Merge pull request #4975 from opensourcerouting/disable-ecmp2-test

Disable bgp-ecmp-topo2 topotest until proper fix is developed

4 years agodoc: Update documentation for 'set distance XX` command for bgp
Donald Sharp [Fri, 13 Sep 2019 20:37:45 +0000 (16:37 -0400)]
doc: Update documentation for 'set distance XX` command for bgp

Allow bgp to store and pass through a different distance than
normal for installing into the rib.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Create `set distance XXX` command for routemaps
Donald Sharp [Fri, 13 Sep 2019 20:43:16 +0000 (16:43 -0400)]
bgpd: Create `set distance XXX` command for routemaps

Allow bgp to set a local Administrative distance to use
for installing routes into the rib.

Example:
!
router bgp 9323
 bgp router-id 1.2.3.4
 neighbor enp0s8 interface remote-as external
 !
 address-family ipv4 unicast
  neighbor enp0s8 route-map DISTANCE in
 exit-address-family
!
route-map DISTANCE permit 10
 set distance 153
!
line vty
!
end
eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route

B   0.0.0.0/0 [153/0] via fe80::a00:27ff:fe84:c2d6, enp0s8, 00:00:06
K>* 0.0.0.0/0 [0/100] via 10.0.2.2, enp0s3, 00:06:31
B>* 1.1.1.1/32 [153/0] via fe80::a00:27ff:fe84:c2d6, enp0s8, 00:00:06
B>* 1.1.1.2/32 [153/0] via fe80::a00:27ff:fe84:c2d6, enp0s8, 00:00:06
B>* 1.1.1.3/32 [153/0] via fe80::a00:27ff:fe84:c2d6, enp0s8, 00:00:06
C>* 10.0.2.0/24 is directly connected, enp0s3, 00:06:31
K>* 169.254.0.0/16 [0/1000] is directly connected, enp0s3, 00:06:31
eva#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #4969 from ton31337/feature/rewrite_bgp_aggregate-address_route...
Sri Mohana Singamsetty [Fri, 13 Sep 2019 18:03:36 +0000 (11:03 -0700)]
Merge pull request #4969 from ton31337/feature/rewrite_bgp_aggregate-address_route-map_test

tests: Improve bgp_aggregate-address_route-map test

4 years agotools: Adding new commands to the list of support bundle commands
Sri Mohana Singamsetty [Tue, 13 Aug 2019 21:55:21 +0000 (14:55 -0700)]
tools: Adding new commands to the list of support bundle commands

Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
4 years agotools: Modifications to copy support bundle files
Sri Mohana Singamsetty [Tue, 13 Aug 2019 21:53:08 +0000 (14:53 -0700)]
tools: Modifications to copy support bundle files

This commit is to copy the support bundle scripts to appropriate directories during installation

Signed-off-by: Sri Mohana Singamsetty <msingamsetty@vmware.com>
4 years agopbrd: Handle GATEWAY_IFINDEX nht conflicts
Stephen Worley [Wed, 11 Sep 2019 18:22:55 +0000 (14:22 -0400)]
pbrd: Handle GATEWAY_IFINDEX nht conflicts

In pbrd we did not care if the nexthop interface nexthop tracking
sent us back did not match the one specified with `nexthop [GATEWAY]
[INTERFACE]`. This happened if the gateway was resolvable via a
different interface and the inteface we specified in the config was
unnumbered (no ipv4 address on it) since the default route gets forced
onlink when it gets into zebra.

This patch adds a check to not install the rule if the interface we got
back was different from the specified.

This patch also reworks the nexthop update path to make it a little more
clear what its doing.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #4949 from opensourcerouting/mpls-zapi-improvements
Olivier Dugeon [Fri, 13 Sep 2019 15:36:16 +0000 (17:36 +0200)]
Merge pull request #4949 from opensourcerouting/mpls-zapi-improvements

MPLS zapi improvements

4 years agoMerge pull request #4948 from opensourcerouting/show-mpls-table
Olivier Dugeon [Fri, 13 Sep 2019 15:24:52 +0000 (17:24 +0200)]
Merge pull request #4948 from opensourcerouting/show-mpls-table

zebra: improve the output of "show mpls table"

4 years agoMerge pull request #4973 from qlyoung/yang-ipaddr-user-type
Mark Stapp [Fri, 13 Sep 2019 13:24:16 +0000 (09:24 -0400)]
Merge pull request #4973 from qlyoung/yang-ipaddr-user-type

yang: add user type for ip-address

4 years agoMerge pull request #4978 from ton31337/fix/replace_static_integers_with_macros
Donald Sharp [Fri, 13 Sep 2019 13:13:37 +0000 (09:13 -0400)]
Merge pull request #4978 from ton31337/fix/replace_static_integers_with_macros

bgpd: Use defined constants for NHLEN instead of numeric values

4 years agobgpd: Use defined constants for NHLEN instead of numeric values
Donatas Abraitis [Fri, 13 Sep 2019 08:43:44 +0000 (11:43 +0300)]
bgpd: Use defined constants for NHLEN instead of numeric values

This is better in cases when you need to find specific pattern and/or
replacing.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotests: Improve bgp_aggregate-address_route-map test
Donatas Abraitis [Thu, 12 Sep 2019 07:04:56 +0000 (10:04 +0300)]
tests: Improve bgp_aggregate-address_route-map test

Rewrite some parts to add more visibility what's going on if test fails.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agotests: Disable bgp-ecmp-topo2 topotest until proper fix is developed
Martin Winter [Thu, 12 Sep 2019 23:58:58 +0000 (01:58 +0200)]
tests: Disable bgp-ecmp-topo2 topotest until proper fix is developed

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agoyang: add user type for ip-address
Quentin Young [Wed, 11 Sep 2019 20:22:31 +0000 (20:22 +0000)]
yang: add user type for ip-address

Convert ietf-inet-types:ip-address to struct ipaddr.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agozebra: revise redistribution delete to improve update case
Mark Stapp [Wed, 14 Aug 2019 17:30:24 +0000 (13:30 -0400)]
zebra: revise redistribution delete to improve update case

When selecting a new best route, zebra sends a redist update
when the route is installed. There are cases where redist
clients may not see that redist add - clients who are not
subscribed to the new route type, e.g. In that case, attempt
to send a redist delete for the old/previous route type.

Revised the redist delete api to accomodate both cases;
also tightened up the const-ness of a few internal redist apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agobgpd: prefer-global command not working on IPv4 peers
kh_shi [Thu, 12 Sep 2019 09:07:25 +0000 (09:07 +0000)]
bgpd: prefer-global command not working on IPv4 peers

`set ipv6 next-hop prefer-global` is not working on IPv4 peers.
In MP-BGP, bgp routers can advertising IPv6 routes over IPv4 peers.
Remove the peer's remote address AFI type checking.

Signed-off-by: shikenghua <kh_shi@edge-core.com>
4 years agoMerge pull request #4968 from rubenk/fix-surname
Donald Sharp [Thu, 12 Sep 2019 00:29:20 +0000 (20:29 -0400)]
Merge pull request #4968 from rubenk/fix-surname

doc: Djikstra -> Dijkstra

4 years agodoc: Djikstra -> Dijkstra
Ruben Kerkhof [Wed, 11 Sep 2019 18:35:06 +0000 (20:35 +0200)]
doc: Djikstra -> Dijkstra

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
4 years agoMerge pull request #4722 from ak503/static
Donald Sharp [Wed, 11 Sep 2019 17:36:55 +0000 (13:36 -0400)]
Merge pull request #4722 from ak503/static

staticd: correct update static route when specify nexthop-vrf

4 years agoMerge pull request #4302 from rgirada/fix_pim_upstream
Donald Sharp [Wed, 11 Sep 2019 17:35:32 +0000 (13:35 -0400)]
Merge pull request #4302 from rgirada/fix_pim_upstream

staticd: static route config should get fail if nexthop configured as  its local connected ip.

4 years agoMerge pull request #4950 from donaldsharp/table_summary
Renato Westphal [Wed, 11 Sep 2019 15:34:07 +0000 (12:34 -0300)]
Merge pull request #4950 from donaldsharp/table_summary

Table summary

4 years agoMerge pull request #4954 from qlyoung/yang-interface-ref
Renato Westphal [Wed, 11 Sep 2019 15:31:49 +0000 (12:31 -0300)]
Merge pull request #4954 from qlyoung/yang-interface-ref

yang: create interface reference type

4 years agoMerge pull request #4962 from donaldsharp/large_admin_distance_tests
Mark Stapp [Wed, 11 Sep 2019 14:46:40 +0000 (10:46 -0400)]
Merge pull request #4962 from donaldsharp/large_admin_distance_tests

Large admin distance tests and documentation

4 years agodoc: Add `show ip route summary` documentation
Donald Sharp [Sat, 7 Sep 2019 00:36:28 +0000 (20:36 -0400)]
doc: Add `show ip route summary` documentation

Add a bit of doc for the `show ip route summary` command

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agozebra: Modify `show ip route summary` to allow you to specify a table
Donald Sharp [Sat, 7 Sep 2019 00:31:41 +0000 (20:31 -0400)]
zebra: Modify `show ip route summary` to allow you to specify a table

Add a bit of extra command `show ip route summary table XXX`
To allow end user to specify a specific table that they want
summary information on.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agotests: Add admin distance 255 static routes
Donald Sharp [Tue, 10 Sep 2019 23:48:21 +0000 (19:48 -0400)]
tests: Add admin distance 255 static routes

Add a couple of test cases to ensure that admin distance of
255 actually causes the route to be accepted by zebra but
not installed into the linux kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agodoc: Update documentation to talk about Administrative Distance
Donald Sharp [Tue, 10 Sep 2019 23:43:36 +0000 (19:43 -0400)]
doc: Update documentation to talk about Administrative Distance

The FRR documentation had no discussion about how Administrative
Distance is used.  Update the documentation to reflect the reality
on the ground.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #4963 from donaldsharp/fix_topotests_due_to_json
Donatas Abraitis [Wed, 11 Sep 2019 06:15:23 +0000 (09:15 +0300)]
Merge pull request #4963 from donaldsharp/fix_topotests_due_to_json

tests: Fix topotests due to json error

4 years agotests: Fix topotests due to json error
Donald Sharp [Wed, 11 Sep 2019 03:16:01 +0000 (23:16 -0400)]
tests: Fix topotests due to json error

Recent commit: 5fba22485b added a new topotest that used
an older version of FRR that referenced some json code
that was changed in between when the PR was submitted
and when it got in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoyang: create interface reference type
Quentin Young [Mon, 9 Sep 2019 16:59:09 +0000 (16:59 +0000)]
yang: create interface reference type

Instead of copy-pasting a 16 character string type for use as an
interface reference, create a new typedef that leafref's the name node
of an interface. This way the constraints change with the constraints on
an interface name itself, and it's self documenting.

Incidentally ripd and ripngd forgot the 16 character constraint in their
offset-list configs and IS-IS forgot it entirely, so this also fixes
minor bugs.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #4958 from donaldsharp/pim_assert_a_saurus
Jafar Al-Gharaibeh [Tue, 10 Sep 2019 18:21:29 +0000 (13:21 -0500)]
Merge pull request #4958 from donaldsharp/pim_assert_a_saurus

pimd: Slightly loosen pim assert message length tests

4 years agoMerge pull request #4866 from ton31337/feature/apply_route-map_for_aggregate-address
Lou Berger [Tue, 10 Sep 2019 15:59:10 +0000 (11:59 -0400)]
Merge pull request #4866 from ton31337/feature/apply_route-map_for_aggregate-address

bgpd: Apply route-map for aggregate-address

4 years agoMerge pull request #4933 from chiragshah6/evpn_dev2
Russ White [Tue, 10 Sep 2019 15:53:08 +0000 (11:53 -0400)]
Merge pull request #4933 from chiragshah6/evpn_dev2

bgpd: clear l3vni prefix-only flag upon deletion

4 years agoMerge pull request #4955 from sworleys/GW-IFINDEX-Verify-Resolve
Russ White [Tue, 10 Sep 2019 15:06:34 +0000 (11:06 -0400)]
Merge pull request #4955 from sworleys/GW-IFINDEX-Verify-Resolve

zebra: Don't resolve to diff interface if given

4 years agopimd: Slightly loosen pim assert message length tests
Donald Sharp [Tue, 10 Sep 2019 14:53:15 +0000 (10:53 -0400)]
pimd: Slightly loosen pim assert message length tests

The Pim RFC does not appear to state any length requirements
of pim, other than the checksum must be correct.

Certain vendors are sending extra data at the end of a pim assert
message.  This while not explicitly against the rules was a bit
of surprise to pim when we threw the assert message on the floor
for being too long.

Modify the test to see if length left will allow us to read
the 8 bytes of data that we need.  If it is sufficient for
that allow the packet to be used.

Fixes: #4957
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoBGP: Rectifying the log messages.
Naveen Thanikachalam [Wed, 21 Aug 2019 03:16:20 +0000 (20:16 -0700)]
BGP: Rectifying the log messages.

This change addresses the following:
1) Ensures logs under DEBUG macro checks are categorized
   as zlog_debug instead of zlog_info.
2) Error logs are categorized as zlog_err instead of zlog_info.
3) Rephrasing certain logs to make them appear more intuitive.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
4 years agoMerge pull request #4951 from qlyoung/doc-fix-edgar-dijkstra-spelling
Renato Westphal [Tue, 10 Sep 2019 04:15:39 +0000 (01:15 -0300)]
Merge pull request #4951 from qlyoung/doc-fix-edgar-dijkstra-spelling

doc: Edgar -> Edsger

4 years agoospfd: avoid installing SR FTNs twice
Renato Westphal [Tue, 10 Sep 2019 03:30:33 +0000 (00:30 -0300)]
ospfd: avoid installing SR FTNs twice

There's no need to install MPLS FTNs using the ZEBRA_ROUTE_ADD
message since the ZEBRA_MPLS_LABELS_ADD message already does that
(in addition to installing an MPLS LSP).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agolib, zebra: add new MPLS zapi message with route replace semantics
Renato Westphal [Thu, 8 Aug 2019 18:57:13 +0000 (15:57 -0300)]
lib, zebra: add new MPLS zapi message with route replace semantics

This new message makes it possible to install/reinstall LSPs with
multiple nexthops using a single ZAPI message.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agozebra: Don't resolve to diff interface if given
Stephen Worley [Mon, 9 Sep 2019 21:20:17 +0000 (17:20 -0400)]
zebra: Don't resolve to diff interface if given

If the nexthop is of type `GATEWAY_IFINDEX` then the nexthop
should not resolve to a nexthop that has a different ifindex
from the one given.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoMerge pull request #4952 from mjstapp/fix_bgp_peer_hook
Quentin Young [Mon, 9 Sep 2019 19:12:36 +0000 (15:12 -0400)]
Merge pull request #4952 from mjstapp/fix_bgp_peer_hook

bgpd: fix build breakage after hook re-definition