]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agozebra: fix memory leak
Philippe Guibert [Wed, 25 Sep 2019 06:51:06 +0000 (08:51 +0200)]
zebra: fix memory leak

the if_lookup_by_name_per_ns keeps a lock on the node where the
searched ifp is stored. Then this node can not be freed even if
the ifp is removed from the node. Just add the missing unlock
(as for the if_lookup_by_index_per_ns lookup function)

Fixes: b8af3fbbafc8 ("zebra: fix detection of interface renames")
Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agolibs: add yang models for zebra and nexthop
Mark Stapp [Tue, 24 Sep 2019 20:31:12 +0000 (16:31 -0400)]
libs: add yang models for zebra and nexthop

Add a yang model for some of zebra's functionality,
but the model is not integrated into the build at all yet. Also
add a model for nexthop and nexthop-group.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #5050 from LabNConsulting/working/lb/tt-update
Donald Sharp [Tue, 24 Sep 2019 20:07:35 +0000 (16:07 -0400)]
Merge pull request #5050 from LabNConsulting/working/lb/tt-update

topotest: bgp_l3vpn_to_bgp_vrf allow for different interface output

5 years agoMerge pull request #4972 from mjstapp/fix_notif_installed
Donald Sharp [Tue, 24 Sep 2019 18:31:58 +0000 (14:31 -0400)]
Merge pull request #4972 from mjstapp/fix_notif_installed

zebra: route updates from dataplane need to check all nexthops

5 years agoMerge pull request #5040 from opensourcerouting/isisd-fix-validation-crash
Donald Sharp [Tue, 24 Sep 2019 18:14:56 +0000 (14:14 -0400)]
Merge pull request #5040 from opensourcerouting/isisd-fix-validation-crash

isisd: fix crash during candidate validation

5 years ago*: fix missing VRF autocompletions
Igor Ryzhov [Tue, 24 Sep 2019 16:51:46 +0000 (19:51 +0300)]
*: fix missing VRF autocompletions

Current autocompletion works only for simple "vrf NAME" case.

This commit expands it also for the following cases:
- "nexthop-vrf NAME" in staticd
- usage of $varname in many daemons

All daemons are updated to use single varname "$vrf_name".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
5 years agoMerge pull request #4959 from pguibert6WIND/zebra_inform_layer
Russ White [Tue, 24 Sep 2019 15:46:13 +0000 (11:46 -0400)]
Merge pull request #4959 from pguibert6WIND/zebra_inform_layer

zebra: inform upper layer error when reading correct speed interface

5 years agoMerge pull request #4822 from vishaldhingra/route_agg
Russ White [Tue, 24 Sep 2019 15:40:01 +0000 (11:40 -0400)]
Merge pull request #4822 from vishaldhingra/route_agg

bgpd : route aggregation optimisation

5 years agoMerge pull request #5044 from chiragshah6/evpn_dev2
Russ White [Tue, 24 Sep 2019 14:45:56 +0000 (10:45 -0400)]
Merge pull request #5044 from chiragshah6/evpn_dev2

bgpd: fix advertise-svi-ip upon vni-svi up-down

5 years agoMerge pull request #5045 from satheeshkarra/pim_tos
Russ White [Tue, 24 Sep 2019 14:44:01 +0000 (10:44 -0400)]
Merge pull request #5045 from satheeshkarra/pim_tos

pimd: Mark Default TOS Values for PIM & IGMP Outgoing packets

5 years agoMerge pull request #4995 from opensourcerouting/ospf6d-iftype
Russ White [Tue, 24 Sep 2019 14:38:10 +0000 (10:38 -0400)]
Merge pull request #4995 from opensourcerouting/ospf6d-iftype

ospf6d: fix interface type handling

5 years agoMerge pull request #5046 from donaldsharp/sa_issues_found
Donatas Abraitis [Tue, 24 Sep 2019 14:22:46 +0000 (17:22 +0300)]
Merge pull request #5046 from donaldsharp/sa_issues_found

Sa issues found

5 years agobgpd: rmap_type is 8 bit but we have 9 bits of flags
Donald Sharp [Tue, 24 Sep 2019 12:24:10 +0000 (08:24 -0400)]
bgpd: rmap_type is 8 bit but we have 9 bits of flags

The newly added PEER_RMAP_TYPE_AGGREGATE flag is setup to
be the 9th bit:

But the flag we are putting it into:
uint8_t rmap_type;

is 8 bits.  Adjust the size.

Found by Coverity SA Scan
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopbrd: We should be looking for v4 and v6 nexthop types
Donald Sharp [Tue, 24 Sep 2019 12:20:34 +0000 (08:20 -0400)]
pbrd: We should be looking for v4 and v6 nexthop types

The code should be looking for both v4 and v6 nexthop types
instead of v4 nexthop types 2 times.

Found by Coverity SA
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4912 from lucize/carescross
Donald Sharp [Tue, 24 Sep 2019 12:14:45 +0000 (08:14 -0400)]
Merge pull request #4912 from lucize/carescross

clippy: don't fail on CARES and libcap when clippy-only selected

5 years agoMerge pull request #5039 from opensourcerouting/isisd-yang-state-data
Donald Sharp [Tue, 24 Sep 2019 11:35:34 +0000 (07:35 -0400)]
Merge pull request #5039 from opensourcerouting/isisd-yang-state-data

isisd: start implementing yang-modeled state data

5 years agobgpd : route agg. with aspath attribute is consuming lot of cycles.
vdhingra [Mon, 19 Aug 2019 07:50:56 +0000 (00:50 -0700)]
bgpd : route agg. with aspath attribute is consuming lot of cycles.

While configuring aggregate route prepare the hash table first,
then prepare the aggregated aspath value just like lcomm,
ecomm and standard community.

Signed-off-by: vishaldhingra<vdhingra@vmware.com>
5 years agobgpd : route agg. with ecomm attribute is consuming lot of cycles.
vdhingra [Mon, 19 Aug 2019 07:50:15 +0000 (00:50 -0700)]
bgpd : route agg. with ecomm attribute is consuming lot of cycles.

While configuring aggregate route prepare the hash table first,
then prepare the aggregated ecomm value and then do the
unique sort once for ecommunity.

Signed-off-by: vishaldhingra<vdhingra@vmware.com>
5 years agobgpd : route agg. with comm attr is consuming lot of cycles.
vdhingra [Mon, 19 Aug 2019 07:47:50 +0000 (00:47 -0700)]
bgpd : route agg. with comm attr is consuming lot of cycles.

While configuring aggregate route prepare the hash table
first, then prepare the aggregated standard comm value
and then do the unique sort once for standard community.

Signed-off-by: vishaldhingra<vdhingra@vmware.com>
5 years agobgpd : route agg. with lcomm attribute is consuming lot of cycles.
vdhingra [Mon, 12 Aug 2019 12:13:14 +0000 (05:13 -0700)]
bgpd : route agg. with lcomm attribute is consuming lot of cycles.

While configuring aggregate route prepare the hash table first,
then prepare the aggregated lcomm value and then do the unique
sort once for large community.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
5 years agoMerge pull request #5042 from opensourcerouting/vtysh-nb-cmds
Quentin Young [Tue, 24 Sep 2019 09:11:00 +0000 (05:11 -0400)]
Merge pull request #5042 from opensourcerouting/vtysh-nb-cmds

vtysh: add two commands from the northbound

5 years agoMerge pull request #5043 from donaldsharp/update_groups_and_coalesce_timer
Donatas Abraitis [Tue, 24 Sep 2019 07:07:40 +0000 (10:07 +0300)]
Merge pull request #5043 from donaldsharp/update_groups_and_coalesce_timer

Update groups and coalesce timer

5 years agopimd: Mark Default TOS Values for PIM & IGMP Outgoing packets
Satheesh Kumar K [Tue, 24 Sep 2019 03:45:05 +0000 (20:45 -0700)]
pimd: Mark Default TOS Values for PIM & IGMP Outgoing packets

This will facilitate the Hardware to prefer control packets over
Normal Data packets while queuing, so that during congestion, the
chance of dropping control packet will be minimised.

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
5 years agobgpd: fix advertise-svi-ip upon vni-svi up-down
Chirag Shah [Thu, 12 Sep 2019 00:29:04 +0000 (17:29 -0700)]
bgpd: fix advertise-svi-ip upon vni-svi up-down

When a VxLAN interface comes up new vni up event is sent
to bgpd, which triggers bgpd to sync advertise-svi-macip
to zebra. At this point, vni is present but the associated
SVI may not be present.
When SVI comes up, vni add event sent to bgpd (with associated
vrf update). Bgpd already has vni present so
advertise-svi-macip is not synced to Zebra.

To fix,
When advertise-svi-macip flag is synced first time, cache it in
zebra context even though vni associated SVI is not present.
when SVI comes up, interface address add event triggers
new MAC-IP route add to bgpd.

Ticket:CM-26038
Reviewed By:CCR-9254
Testing Done:

Validated via running a sequence of steps in symmetric
routing topology.
- Enable advertise-svi-macip at l2vni level under bgp default
instance (afi/safi, l2vpn/evpn)
- Flap l2vni associated SVI interface.
- Check the output of 'show bgp l2vpn evpn route' command for
MAC-IP route of the SVI's (MAC and IP address).

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #5034 from opensourcerouting/rm-topotest-cruft
Donald Sharp [Mon, 23 Sep 2019 19:52:32 +0000 (15:52 -0400)]
Merge pull request #5034 from opensourcerouting/rm-topotest-cruft

tests: remove more topotest backward-compatibility cruft

5 years agodoc: Update bgp docs to have `show bgp update-group...` commands
Donald Sharp [Mon, 23 Sep 2019 18:26:03 +0000 (14:26 -0400)]
doc: Update bgp docs to have `show bgp update-group...` commands

Update the user docs to have information about the `show bgp update-group..
group of commands.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5037 from idryzhov/fix-vtysh-no-log-facility
Donatas Abraitis [Mon, 23 Sep 2019 18:23:21 +0000 (21:23 +0300)]
Merge pull request #5037 from idryzhov/fix-vtysh-no-log-facility

vtysh: fix "no log facility" command

5 years agobgpd: When displaying update group information include coalesce time
Donald Sharp [Mon, 23 Sep 2019 17:49:11 +0000 (13:49 -0400)]
bgpd: When displaying update group information include coalesce time

Include the coalesce time for the update group `show bgp update-group`
command as well as print out how long the coalesce timer waited
for on the timer pop.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Do not display 'X' as part of outgoing route-map name
Donald Sharp [Mon, 23 Sep 2019 17:46:55 +0000 (13:46 -0400)]
bgpd: Do not display 'X' as part of outgoing route-map name

The peer's outgoing routemap should not be displaying a 'X'
appended to the front of the name.  This will create
confusion.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5021 from donaldsharp/neigh_proto
Renato Westphal [Mon, 23 Sep 2019 17:45:33 +0000 (14:45 -0300)]
Merge pull request #5021 from donaldsharp/neigh_proto

Neigh proto

5 years agoisisd: fix crash during candidate validation
Renato Westphal [Mon, 23 Sep 2019 12:37:49 +0000 (09:37 -0300)]
isisd: fix crash during candidate validation

The "abort_if_not_found" parameter of nb_running_get_entry()
should be set to true only when this function is called during the
NB_EV_APPLY phase of a northbound callback. Failure to respect this
can lead to crashes when multiple configuration changes are being
committed at the same time.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agovtysh: fix "no log facility" command
Igor Ryzhov [Mon, 23 Sep 2019 16:01:58 +0000 (19:01 +0300)]
vtysh: fix "no log facility" command

Actual command from the library accepts only supported facilities, not
any random word.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
5 years agoissue/5035: Remove warning for missing pytest during build phase and add libcap-dev...
Ronny Trommer [Mon, 23 Sep 2019 14:39:29 +0000 (16:39 +0200)]
issue/5035: Remove warning for missing pytest during build phase and add libcap-dev dependency

Signed-off-by: Ronny Trommer <ronny@opennms.org>
5 years agoissue/5035: Install pytest with pip to get the Alpine packages built
Ronny Trommer [Mon, 23 Sep 2019 14:14:41 +0000 (16:14 +0200)]
issue/5035: Install pytest with pip to get the Alpine packages built

Signed-off-by: Ronny Trommer <ronny@opennms.org>
5 years agoisisd, yang: implement interface counters
Renato Westphal [Mon, 23 Sep 2019 12:38:02 +0000 (09:38 -0300)]
isisd, yang: implement interface counters

The new "event-counters" grouping is almost a 1:1 copy of the same
grouping from the IETF IS-IS module, except for the "lan-dis-changes"
leaf which was skipped (more work needs to be done to support it).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agovtysh: add the "show yang operational-data" command
Renato Westphal [Mon, 23 Sep 2019 12:38:03 +0000 (09:38 -0300)]
vtysh: add the "show yang operational-data" command

The right way to implement this command in vtysh is the following:
* Send the command to each running FRR daemon;
* Collect the command output from each daemon;
* Parse the text outputs into libyang lyd_node structures. Then merge
  all these data trees into a single one. Finally, print the merged
  data trees to the standard output (libyang will take care of
  combining duplicate nodes as necessary).

What this commit does is to allow vtysh to send the "show yang
operational-data" command to a single daemon only (the last
parameter).  It's a quick workaround to allow us to write topotests
using YANG-modeled data until we do the real thing (full vtysh
northbound integration).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agotests: remove more topotest backward-compatibility cruft
Renato Westphal [Mon, 23 Sep 2019 12:37:55 +0000 (09:37 -0300)]
tests: remove more topotest backward-compatibility cruft

This isn't necessary anymore since topotest was integrated into
the FRR repo.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoisisd, yang: implement read-only list of adjacencies
Renato Westphal [Mon, 23 Sep 2019 12:38:01 +0000 (09:38 -0300)]
isisd, yang: implement read-only list of adjacencies

The new "adjacency-state" grouping is almost a 1:1 copy of the
same grouping from the IETF IS-IS module, except for the "usage"
and "lastuptime" leafs that were skipped (more work needs to be
done to support those).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agovtysh: add the "debug northbound" command
Renato Westphal [Mon, 23 Sep 2019 12:38:02 +0000 (09:38 -0300)]
vtysh: add the "debug northbound" command

This command is defined in the lib/northbound_cli.c file, which
is not being parsed by vtysh since most commands from there need
special handling in the context of vtysh. The "debug northbound"
command, however, can be made available to vtysh without problems.
Introduce a new DEFUNSH to do that.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoyang: create new interface-config grouping in the frr-isisd module
Renato Westphal [Mon, 23 Sep 2019 12:37:57 +0000 (09:37 -0300)]
yang: create new interface-config grouping in the frr-isisd module

Do this to better separate config data from state data (coming in
the next commits) like done in the IETF IS-IS module.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agotopotest: bgp_l3vpn_to_bgp_vrf allow for different interface output
Lou Berger [Sun, 22 Sep 2019 17:06:48 +0000 (13:06 -0400)]
topotest: bgp_l3vpn_to_bgp_vrf allow for different interface output

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agoMerge pull request #5031 from donaldsharp/ip_protocol_doc_update
Donatas Abraitis [Sun, 22 Sep 2019 08:23:02 +0000 (11:23 +0300)]
Merge pull request #5031 from donaldsharp/ip_protocol_doc_update

user: Update `ip protocol...` command documentation

5 years agouser: Update `ip protocol...` command documentation
Donald Sharp [Fri, 20 Sep 2019 19:16:36 +0000 (15:16 -0400)]
user: Update `ip protocol...` command documentation

Update documentation to reflect on the ground behavior.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4893 from pguibert6WIND/interface_zapi_update
Donald Sharp [Fri, 20 Sep 2019 18:59:01 +0000 (14:59 -0400)]
Merge pull request #4893 from pguibert6WIND/interface_zapi_update

Interface zapi update

5 years agoconfigure: Update versioning
Donald Sharp [Fri, 20 Sep 2019 18:32:02 +0000 (14:32 -0400)]
configure: Update versioning

We have pulled the 7.2 branch let's update the master branch
to say it's 7.3

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4529 from donaldsharp/vrf_conversions
Renato Westphal [Fri, 20 Sep 2019 17:56:44 +0000 (14:56 -0300)]
Merge pull request #4529 from donaldsharp/vrf_conversions

Vrf conversions

5 years agoMerge pull request #5024 from donaldsharp/send_that_error_bgp
Martin Winter [Fri, 20 Sep 2019 13:58:51 +0000 (15:58 +0200)]
Merge pull request #5024 from donaldsharp/send_that_error_bgp

bgpd: Invalid NH's should send an apropriate reason code

5 years agobgpd: Invalid NH's should send an apropriate reason code
Donald Sharp [Fri, 20 Sep 2019 10:41:02 +0000 (06:41 -0400)]
bgpd: Invalid NH's should send an apropriate reason code

RFC 4271 sec 6.3 p33, In the case of a BGP_NEXTHOP attribute with an
incorrect value, FRR is supposed to send a notification
and include 'Corresponding type, length and value of the NEXT_HOP
attribute in the notification data.

Fixes: #4997
Signed-off-by: Nikos <ntriantafillis@gmail.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5019 from karamalla0406/vrf_name_json
Donald Sharp [Thu, 19 Sep 2019 23:14:06 +0000 (19:14 -0400)]
Merge pull request #5019 from karamalla0406/vrf_name_json

zebra: Added vrfname to route prefix dictionary

5 years agozebra: Added vrfname to route prefix dictionary
Kishore Aramalla [Thu, 19 Sep 2019 21:28:11 +0000 (14:28 -0700)]
zebra: Added vrfname to route prefix dictionary

Route prefix dictionary contains vrf ID only.
Added vrfName to the route prefix dictionary.

Signed-off-by: Kishore Aramalla <karamalla@vmware.com>
5 years agozebra: Send RTPROT_ZEBRA for netlink messages missing this data
Donald Sharp [Thu, 19 Sep 2019 20:05:39 +0000 (16:05 -0400)]
zebra: Send RTPROT_ZEBRA for netlink messages missing this data

Update neighbor entries and rule entries to have the RTPROT_ZEBRA
protocol value.  So we can tell where things come from.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoinclude: update include/linux
Donald Sharp [Thu, 19 Sep 2019 19:39:13 +0000 (15:39 -0400)]
include: update include/linux

Newer versions of the linux kernel have made their way into the wild.
Update some headers.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #4875 from vishaldhingra/blackhole_type
Donatas Abraitis [Thu, 19 Sep 2019 17:41:00 +0000 (20:41 +0300)]
Merge pull request #4875 from vishaldhingra/blackhole_type

Zebra: Rectifying the log messages.

5 years agolib: delete interface if you can in upper level protocol
Donald Sharp [Thu, 19 Sep 2019 13:59:00 +0000 (09:59 -0400)]
lib: delete interface if you can in upper level protocol

In an upper level protocol, delete the interface on notification
about deletion.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years ago*: Convert zapi->interface_delete to ifp callback
Donald Sharp [Thu, 19 Sep 2019 13:40:57 +0000 (09:40 -0400)]
*: Convert zapi->interface_delete to ifp callback

Convert the callback of the interface_delete to the new
ifp callback.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years ago*: Convert interface_down to interface down callback
Donald Sharp [Thu, 19 Sep 2019 03:55:34 +0000 (23:55 -0400)]
*: Convert interface_down to interface down callback

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 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>
5 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>
5 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>
5 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>
5 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>
5 years agoZebra: Rectifying the log messages.
vdhingra [Fri, 23 Aug 2019 12:28:43 +0000 (05:28 -0700)]
Zebra: Rectifying the log messages.

This change addresses the following :
1. Ensures zlog_debug should be under DEBUG macro check
2. Ensures zlog_err and zlog_warn wherever applicable.
3. Removed few posivite logs from fpm handling, whose frequency is high.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
5 years agobgpd: Fixed 'show bgp l2vpn evpn json' to display all routes
Kishore Aramalla [Thu, 19 Sep 2019 03:35:04 +0000 (20:35 -0700)]
bgpd: Fixed 'show bgp l2vpn evpn json' to display all routes

Fixed the following:
1. Print the complete header for 'show bgp l2vpn evpn' command
2. Print the Route Distinguisher header
3. Print all relevant routes in json (some were being skipped)

Signed-off-by: Kishore Aramalla <karamalla@vmware.com>
5 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

5 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

5 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

5 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>
5 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

5 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>
5 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>
5 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>
5 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.

5 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>
5 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>
5 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

5 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>
5 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

5 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>
5 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)

5 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>
5 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>
5 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

5 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

5 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"

5 years agozebra: inform upper layer error when reading correct speed interface
Julien Floret [Tue, 6 Aug 2019 09:15:05 +0000 (11:15 +0200)]
zebra: inform upper layer error when reading correct speed interface

speed interface is done 15 seconds after interface creation. during that
time, the vrf or the interface may have disappeared. to protect this,
return an error in case it is not possible to create a vrf socket or it
is not possible to get speed of an interface because of a missing
device.

Signed-off-by: Julien Floret <julien.floret@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 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>
5 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>
5 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.

5 years agostaticd: register to interface events related with non default vrf
Philippe Guibert [Mon, 26 Aug 2019 11:36:16 +0000 (13:36 +0200)]
staticd: register to interface events related with non default vrf

in addition to non default vrf, once a new vrf is available, the static
daemon registers to events from that vrf, including presence of
interfaces. this permits to create static route with nexthop=interface.
Reversely, an unregistration is scheduled too when vrf disappears.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 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

5 years agozebra: check all dplane nexthops when processing
Mark Stapp [Thu, 12 Sep 2019 19:24:52 +0000 (15:24 -0400)]
zebra: check all dplane nexthops when processing

When processing route updates from the dataplane, we were
terminating the checking of nexthops prematurely, and we could
miss meaningful changes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 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>
5 years agoospf6d: track explicit interface type config
David Lamparter [Tue, 17 Sep 2019 14:19:45 +0000 (16:19 +0200)]
ospf6d: track explicit interface type config

If the interface doesn't exist in system, we'll default to broadcast and
then later not change that when the interface comes up.  Explicitly
track whether the user configured the type and properly auto-set it if
they didn't.

Fixes: #3930
Fixes: #4873
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 years agoospf6d: fix mistaken if_is_* instead of oi->type
David Lamparter [Tue, 17 Sep 2019 14:18:26 +0000 (16:18 +0200)]
ospf6d: fix mistaken if_is_* instead of oi->type

If the user configured an interface to be in a particular mode, we need
to be consistent about that.  No looking at if_is_pointopoint() or
if_is_broadcast().

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 years agoospf6d: interface state needs update even w/o area
David Lamparter [Tue, 17 Sep 2019 14:15:32 +0000 (16:15 +0200)]
ospf6d: interface state needs update even w/o area

We can't skip reading interface state if there's no area yet, we'll be
missing information later when the interface is configured.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
5 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

5 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

5 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

5 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

5 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