]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agoMerge pull request #3760 from patrasar/RP_configure_inconsistent_addr_mask
Donald Sharp [Fri, 8 Feb 2019 12:37:43 +0000 (07:37 -0500)]
Merge pull request #3760 from patrasar/RP_configure_inconsistent_addr_mask

pimd: reject inconsistent address/mask "ip pim rp command"

5 years agoMerge pull request #3761 from patrasar/fix_refresh_oil_timer
Donald Sharp [Fri, 8 Feb 2019 12:31:12 +0000 (07:31 -0500)]
Merge pull request #3761 from patrasar/fix_refresh_oil_timer

pimd: Don't refersh the oif_creation timer if S,G already present

5 years agopimd: reject inconsistent address/mask "ip pim rp command"
Sarita Patra [Fri, 8 Feb 2019 09:35:21 +0000 (01:35 -0800)]
pimd: reject inconsistent address/mask "ip pim rp command"

Issue: Configure "ip pim rp x.x.x.x 225.0.0.0/4".
Show running config shows "ip pim rp x.x.x.x 224.0.0.0/4"
This is mis-leading.

Root-cause: Internally 225.0.0.0/4 is getting converted to
224.0.0.0/4 group mask, since the prefix length is 4.

Fix: Restrict the user to configure inconsistent group address
mask by throughing a cli error "Inconsistent address and mask".

Signed-off-by: Sarita Patra <saritap@vmware.com>
5 years agopimd: Don't refersh the oif_creation timer if S,G already present
Sarita Patra [Fri, 8 Feb 2019 07:50:12 +0000 (23:50 -0800)]
pimd: Don't refersh the oif_creation timer if S,G already present

Issue: Shut the RP interface in the router RP. LHR will get to know
RP becomes not-reachable, so it send a prune towards the RP. On
receiving the prune, RP clear the (*, G) entry, but (S, G) should
not get removed if present.
Now no-shut the RP interface in the router RP. LHR will send a (*, G)
join towards the RP. On receiving join FRR create the (*, G) entry.
Along with this, it also add the interface(join received) in the OIL
of (S, G) and also refresh the (S, G) timer.

Fix: Dont refresh the timer for S, G or (*, G), if the flag for the
channel OIL is PIM_OIF_FLAG_PROTO_ANY.

Signed-off-by: Sarita Patra <saritap@vmware.com>
5 years agoMerge pull request #3752 from mjstapp/fix_wq_static_func
Donald Sharp [Thu, 7 Feb 2019 22:24:06 +0000 (17:24 -0500)]
Merge pull request #3752 from mjstapp/fix_wq_static_func

libs: remove useless static work_queue_free helper

5 years agoMerge pull request #3745 from chiragshah6/evpn_dev1
Russ White [Thu, 7 Feb 2019 19:36:46 +0000 (14:36 -0500)]
Merge pull request #3745 from chiragshah6/evpn_dev1

EVPN advertise svi ip as macip route changes via config command

5 years agolibs: remove useless static work_queue_free helper
Mark Stapp [Thu, 7 Feb 2019 18:54:50 +0000 (13:54 -0500)]
libs: remove useless static work_queue_free helper

Collapse the old static free function into the actual public
function that was using it (and the only user of it.)

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #3722 from donaldsharp/static_recursive
David Lamparter [Thu, 7 Feb 2019 18:22:29 +0000 (19:22 +0100)]
Merge pull request #3722 from donaldsharp/static_recursive

Zebra fixes

5 years agoMerge pull request #3744 from mjstapp/wq_deprecated_api
David Lamparter [Thu, 7 Feb 2019 17:52:27 +0000 (18:52 +0100)]
Merge pull request #3744 from mjstapp/wq_deprecated_api

libs: remove deprecated workqueue api

5 years agoMerge pull request #3748 from donaldsharp/sharp_nht_addition
David Lamparter [Thu, 7 Feb 2019 17:48:48 +0000 (18:48 +0100)]
Merge pull request #3748 from donaldsharp/sharp_nht_addition

Sharp cleanups and new cli

5 years agoMerge pull request #3749 from rtrlib/2019-02-07-bugfix-master
David Lamparter [Thu, 7 Feb 2019 17:44:04 +0000 (18:44 +0100)]
Merge pull request #3749 from rtrlib/2019-02-07-bugfix-master

RPKI bug fixes

5 years agobgpd: fix crash when trying to remove non-existing rpki cache
Marcel Röthke [Thu, 7 Feb 2019 16:16:19 +0000 (17:16 +0100)]
bgpd: fix crash when trying to remove non-existing rpki cache

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
5 years agobgpd: fix "show rpki cache-server" for ssh caches
Marcel Röthke [Thu, 7 Feb 2019 16:12:16 +0000 (17:12 +0100)]
bgpd: fix "show rpki cache-server" for ssh caches

Fix #3662

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
5 years agosharpd: Add 'sharp data nexthop' data dump
Donald Sharp [Thu, 7 Feb 2019 14:58:38 +0000 (09:58 -0500)]
sharpd: Add 'sharp data nexthop' data dump

Add some basic data dumping about what we have watched
from the vty/vtysh cli for nexthops.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agosharpd: Add 'sharp data route" dump command
Donald Sharp [Thu, 7 Feb 2019 14:07:32 +0000 (09:07 -0500)]
sharpd: Add 'sharp data route" dump command

When you are using the install/remove routes command, the
output goes to a log file.  This command allows for ease
of dump of timing information from the vty or vtysh.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agosharpd: Move route global variables into the global data structure
Donald Sharp [Thu, 7 Feb 2019 13:57:40 +0000 (08:57 -0500)]
sharpd: Move route global variables into the global data structure

Clean up the route global variables into a global data structure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agosharpd: Add start of global data structures
Donald Sharp [Thu, 7 Feb 2019 13:21:24 +0000 (08:21 -0500)]
sharpd: Add start of global data structures

We have a bit of a mess with globals in the sharp daemon.
Let's start formalizing it a bit.  Future commits will
take advantage of this, as that we need to have the ability
to start dumping stats about commands we have issued.

These changes will be useful for debugging and understanding
what is going on.

Signed-off-by: Donald sharp <sharpd@cumulusnetworks.com>
5 years agosharpd: Allow nhop tracking to specify connected
Donald Sharp [Thu, 7 Feb 2019 03:03:34 +0000 (03:03 +0000)]
sharpd: Allow nhop tracking to specify connected

Allow the sharp daemon to specify whether or not a watched
nexthop should be connected or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: MTYPE_PREFIX_FLOWSPEC should not be exposed by memory.h
Donald Sharp [Thu, 7 Feb 2019 14:35:01 +0000 (09:35 -0500)]
lib: MTYPE_PREFIX_FLOWSPEC should not be exposed by memory.h

This MTYPE should be owned by prefix.c as a STATIC for the file.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: advertise svi ip as macip route changes
Chirag Shah [Tue, 5 Feb 2019 16:38:35 +0000 (08:38 -0800)]
zebra: advertise svi ip as macip route changes

In Asymmetric and symetric routing scenario in EVPN
where each VTEP pair having different set of addresses
for the SVIs.
This knob allows reachability (ping connectivity) of
SVI IPs and resolve ARP resoultion VTEPs across racks.

This knob should not be used when same SVI IPs configured
on VTEPs across racks or when advertise default gateway
is configured.

Ticket:CM-23782
Testing Done:
Bring up EVPN symmetric routing topology with different
SVI IPs on different VTEPs. Enable advertise svi ip
at each VTEP, remote VTEPs installs arp entry for
SVI IPs via EVPN type-2 route exchange.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agobgpd: advertise svi ip as macip config cmd
Chirag Shah [Mon, 4 Feb 2019 02:08:46 +0000 (18:08 -0800)]
bgpd: advertise svi ip as macip config cmd

Ticket:CM-23782

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agobgpd: advertise svi ip as macip zebra parse api
Chirag Shah [Mon, 4 Feb 2019 01:29:59 +0000 (17:29 -0800)]
bgpd: advertise svi ip as macip zebra parse api

Ticket:CM-23782

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agolib: advertise svi ip as macip opcode
Chirag Shah [Mon, 4 Feb 2019 01:24:59 +0000 (17:24 -0800)]
lib: advertise svi ip as macip opcode

This change is used to send configue changes for
advertise svi address as macip (type-2) route.

Ticket:CM-23782

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agolibs: remove deprecated workqueue api
Mark Stapp [Wed, 6 Feb 2019 17:11:19 +0000 (12:11 -0500)]
libs: remove deprecated workqueue api

Remove deprecated api from workqueue module.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #3684 from mjstapp/dplane_pw
Donald Sharp [Tue, 5 Feb 2019 23:41:12 +0000 (18:41 -0500)]
Merge pull request #3684 from mjstapp/dplane_pw

zebra: async dataplane for pseudowires

5 years agoMerge pull request #3737 from qlyoung/doc-move-topotest-to-devdocs
Rafael Zalamena [Tue, 5 Feb 2019 22:32:14 +0000 (20:32 -0200)]
Merge pull request #3737 from qlyoung/doc-move-topotest-to-devdocs

doc: move topotests docs to developers guide

5 years agozebra: Do not display recursive nexthops as installed
Donald Sharp [Sat, 2 Feb 2019 00:56:07 +0000 (19:56 -0500)]
zebra: Do not display recursive nexthops as installed

Recursive nexthops should not be marked as installed

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Fix multiple levels of static recursion
Donald Sharp [Sat, 2 Feb 2019 00:08:16 +0000 (19:08 -0500)]
zebra: Fix multiple levels of static recursion

Allow the nexthop-check code to figure out recursive static routes
in a logical manner.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: add hooks for external logging function
Emanuele Di Pascale [Fri, 25 Jan 2019 13:40:27 +0000 (14:40 +0100)]
lib: add hooks for external logging function

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
5 years agodoc: move topotests docs to developers guide
Quentin Young [Tue, 5 Feb 2019 19:22:38 +0000 (19:22 +0000)]
doc: move topotests docs to developers guide

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #3693 from chiragshah6/ospf_vrf_dev
Russ White [Tue, 5 Feb 2019 16:25:30 +0000 (11:25 -0500)]
Merge pull request #3693 from chiragshah6/ospf_vrf_dev

ospfd: address CVE-2017-3224

5 years agoMerge pull request #3518 from rgirada/routemap_3090
Donald Sharp [Tue, 5 Feb 2019 16:13:22 +0000 (11:13 -0500)]
Merge pull request #3518 from rgirada/routemap_3090

libd: Implemented a cli "show route-map-unused" to track all unused rou…

5 years agoMerge pull request #3733 from donaldsharp/meta_queue_nht_game_over_man_game_over
Russ White [Tue, 5 Feb 2019 16:06:42 +0000 (11:06 -0500)]
Merge pull request #3733 from donaldsharp/meta_queue_nht_game_over_man_game_over

zebra: NHT was being run at least 2 times and missreporting data

5 years agoMerge pull request #3727 from qlyoung/fix-signed-printspec-bgp-as
Russ White [Tue, 5 Feb 2019 16:05:53 +0000 (11:05 -0500)]
Merge pull request #3727 from qlyoung/fix-signed-printspec-bgp-as

bgpd: use correct specifier to print asn

5 years agoMerge pull request #3725 from donaldsharp/eigrp_metric
Russ White [Tue, 5 Feb 2019 15:55:02 +0000 (10:55 -0500)]
Merge pull request #3725 from donaldsharp/eigrp_metric

Eigrp metric

5 years agoMerge pull request #3730 from donaldsharp/send_information
Russ White [Tue, 5 Feb 2019 15:53:50 +0000 (10:53 -0500)]
Merge pull request #3730 from donaldsharp/send_information

Send information

5 years agoMerge pull request #3688 from chiragshah6/evpn_dev
Russ White [Tue, 5 Feb 2019 15:48:33 +0000 (10:48 -0500)]
Merge pull request #3688 from chiragshah6/evpn_dev

zebra: EVPN probe local inactive neigh/arp entry upon mac mobility

5 years agoMerge pull request #3679 from chiragshah6/evpn_dev2
Russ White [Tue, 5 Feb 2019 15:47:35 +0000 (10:47 -0500)]
Merge pull request #3679 from chiragshah6/evpn_dev2

zebra: reinstate bgp evpn remote route on local evpn route delete

5 years agoMerge pull request #3732 from qlyoung/fix-missing-backtic-doc
Renato Westphal [Tue, 5 Feb 2019 15:10:59 +0000 (13:10 -0200)]
Merge pull request #3732 from qlyoung/fix-missing-backtic-doc

doc: fix missing backtick

5 years agozebra: NHT was being run at least 2 times and missreporting data
Donald Sharp [Mon, 4 Feb 2019 20:16:31 +0000 (15:16 -0500)]
zebra: NHT was being run at least 2 times and missreporting data

With the data plane changes that were made, we are now running
nexthop tracking 2 times.  Once at the end of meta-queue insertion
and once at the end of receiving a bunch of data from the dataplane.

The Addition of the data plane code caused flags to not be set
fully for the resolved routes( since we do not know the answer yet ),
This in turn caused the nexthop tracking run after the meta-queue
to think that the route was not `good`.  This would cause it to
tell all interested parties that there was no nexthop.

After the dataplane insertion we are also no running nht code.
This was re-figuring out the nexthop correctly and also
correctly reporting to interested parties that there was a path again.

Example:
donna.cumulusnetworks.com(config)# do 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, f - failed route

K>* 0.0.0.0/0 [0/103] via 10.50.11.1, enp0s3, 00:06:47
S>* 4.5.6.7/32 [1/0] via 192.168.209.1, enp0s8, 00:04:47
C>* 10.50.11.0/24 is directly connected, enp0s3, 00:06:47
C>* 192.168.209.0/24 is directly connected, enp0s8, 00:06:47
C>* 192.168.210.0/24 is directly connected, enp0s9, 00:06:47
donna.cumulusnetworks.com(config)# ip route 4.5.6.7/32 192.168.210.1
donna.cumulusnetworks.com(config)# do 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, f - failed route

K>* 0.0.0.0/0 [0/103] via 10.50.11.1, enp0s3, 00:07:06
S>* 4.5.6.7/32 [1/0] via 192.168.209.1, enp0s8, 00:00:04
  *                  via 192.168.210.1, enp0s9, 00:00:04
C>* 10.50.11.0/24 is directly connected, enp0s3, 00:07:06
C>* 192.168.209.0/24 is directly connected, enp0s8, 00:07:06
C>* 192.168.210.0/24 is directly connected, enp0s9, 00:07:06
donna.cumulusnetworks.com(config)#

Log files for sharp, which is watching 4.5.6.7:
2019/02/04 15:20:54.844288 SHARP: Received update for 4.5.6.7/32
2019/02/04 15:20:54.844820 SHARP: Received update for 4.5.6.7/32
2019/02/04 15:20:54.844836 SHARP:  Nexthop 192.168.209.1, type: 2, ifindex: 3, vrf: 0, label_num: 0
2019/02/04 15:20:54.844853 SHARP:  Nexthop 192.168.210.1, type: 2, ifindex: 4, vrf: 0, label_num: 0

As you can see we have received an update with no nexthops( invalid route )
and a second update immediately after it with 2 nexthops.

What's the big deal you say?  Well we have code in other daemons that reacts
to not having a path for a nexthop.  In BGP this will cause us to tear
down the peer.  In staticd we'll remove the recursively resolved route.
In pim we'll remove all paths to the mroute.  This is not desirable.

The fix is to remove the meta-queue run of nexthop tracking.

While running after data plane notice of routes to handle is not ideal
we will be fixing this in the future with the nexthop group code, which
should know what nexthops are affected by a nexthop group change.

Fixed code debug code:
donna.cumulusnetworks.com(config)# do 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, f - failed route

K>* 0.0.0.0/0 [0/103] via 10.50.11.1, enp0s3, 00:00:46
S>* 4.5.6.7/32 [1/0] via 192.168.209.1, enp0s8, 00:00:02
C>* 10.50.11.0/24 is directly connected, enp0s3, 00:00:46
C>* 192.168.209.0/24 is directly connected, enp0s8, 00:00:46
C>* 192.168.210.0/24 is directly connected, enp0s9, 00:00:46
donna.cumulusnetworks.com(config)# ip route 4.5.6.7/32 192.168.210.1
donna.cumulusnetworks.com(config)# do 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, f - failed route

K>* 0.0.0.0/0 [0/103] via 10.50.11.1, enp0s3, 00:00:59
S>* 4.5.6.7/32 [1/0] via 192.168.209.1, enp0s8, 00:00:02
  *                  via 192.168.210.1, enp0s9, 00:00:02
C>* 10.50.11.0/24 is directly connected, enp0s3, 00:00:59
C>* 192.168.209.0/24 is directly connected, enp0s8, 00:00:59
C>* 192.168.210.0/24 is directly connected, enp0s9, 00:00:59

2019/02/04 15:26:20.656395 SHARP: Received update for 4.5.6.7/32
2019/02/04 15:26:20.656440 SHARP:  Nexthop 192.168.209.1, type: 2, ifindex: 3, vrf: 0, label_num: 0
2019/02/04 15:26:33.688251 SHARP: Received update for 4.5.6.7/32
2019/02/04 15:26:33.688322 SHARP:  Nexthop 192.168.209.1, type: 2, ifindex: 3, vrf: 0, label_num: 0
2019/02/04 15:26:33.688329 SHARP:  Nexthop 192.168.210.1, type: 2, ifindex: 4, vrf: 0, label_num: 0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Pim is not respecting the move of an interface from old->new vrf
Donald Sharp [Sat, 2 Feb 2019 20:52:14 +0000 (15:52 -0500)]
pimd: Pim is not respecting the move of an interface from old->new vrf

PIM needed to be updated to move to the new vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Send interface request after initial hello
Donald Sharp [Mon, 4 Feb 2019 17:22:55 +0000 (12:22 -0500)]
lib: Send interface request after initial hello

Ask for all interface information after we have connected
to zebra and sent the initial hello.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Remove zclient->idinfo restrictions
Donald Sharp [Mon, 4 Feb 2019 16:45:31 +0000 (11:45 -0500)]
zebra: Remove zclient->idinfo restrictions

The restricting of data about interfaces was both inconsistent
in application and allowed protocol developers to get into states where
they did not have the expected data about an interface that they
thought that they would.  These restrictions and inconsistencies
keep causing bugs that have to be sorted through.

The latest iteration of this bug was that commit:
f20b478ef3d25e153939516a473bb2e80603cbd5

Has caused pim to not receive interface up notifications( but
it knows the interface is back in the vrf and it knows the
relevant ip addresses on the interface as they were changed
as part of an ifdown/ifup cycle ).

Remove this restriction and allow the interface events to
be propagated to all clients.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3698 from donaldsharp/netlink_is_serious_business
Renato Westphal [Tue, 5 Feb 2019 13:52:33 +0000 (11:52 -0200)]
Merge pull request #3698 from donaldsharp/netlink_is_serious_business

Netlink is serious business

5 years agoMerge pull request #3602 from donaldsharp/mlag_debug
David Lamparter [Mon, 4 Feb 2019 23:54:16 +0000 (00:54 +0100)]
Merge pull request #3602 from donaldsharp/mlag_debug

zebra cleanup and some mlag additions

5 years agoMerge pull request #3694 from qlyoung/fix-assegment-heap-uaf
David Lamparter [Mon, 4 Feb 2019 17:57:58 +0000 (18:57 +0100)]
Merge pull request #3694 from qlyoung/fix-assegment-heap-uaf

bgpd: fix as-path prepend heap uaf

5 years agodoc: fix missing backtick
Quentin Young [Mon, 4 Feb 2019 17:37:54 +0000 (17:37 +0000)]
doc: fix missing backtick

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: use correct specifier to print asn
Quentin Young [Mon, 4 Feb 2019 16:50:30 +0000 (16:50 +0000)]
bgpd: use correct specifier to print asn

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agobgpd: Added changes to track route-map usage
rgirada [Mon, 4 Feb 2019 13:27:56 +0000 (05:27 -0800)]
bgpd: Added changes to track route-map usage

Made changes and updated the routemap applied counter in the following flows.
1.Increment when route map attached to a list.
2.Decrement when route map removed / modified from a  list.
3.Increment/decrement when route map create/delete callback triggered.
4.Besides ,This counter need not be updated when a route map is got updated.
  i.e changing/adding a match value to the existing routemap.

In BGP , same update api called for all three add/delete/update operation .
But this counter have to be updated only for routemap addition.
Addressed this specific change by identifying the routemap operation based
on routemap pointer.

Signed-off-by: RajeshGirada <rgirada@vmware.com>
5 years agoospfd: Added changes to track route-map usage
rgirada [Mon, 4 Feb 2019 13:22:39 +0000 (05:22 -0800)]
ospfd: Added changes to track route-map usage

Made changes and updated the routemap applied counter in the following flows.
1.Increment the routemap applied counter when route map attached to a
  redistribution list. The counter will be updated if the routemap exists.
2.Decrement when route map removed / modified from a redistribution  list.
3.Increment/decrement when route map create/delete callback triggered.

Signed-off-by: RajeshGirada <rgirada@vmware.com>
5 years agozebrad: Added changes to track route-map usage
rgirada [Mon, 4 Feb 2019 13:19:54 +0000 (05:19 -0800)]
zebrad: Added changes to track route-map usage

Made changes and updated the routemap applied counter in the following flows.
1.Increment when route map attached to a list.
2.Decrement when route map removed / modified from a list.
3.Increment/decrement when route map create/delete callback triggered.
4.Besides ,This counter need not be updated when a route map is got updated.
  i.e changing/adding a match value to the existing routemap.

In Zebra , same update api called for all three add/delete/update operation.
But this counter have to be updated only for routemap addition.
Addressed this specific change by identifying the routemap operation based
on routemap pointer.

Signed-off-by: RajeshGirada <rgirada@vmware.com>
5 years agoospf6d: Added changes to track route-map usage
rgirada [Mon, 4 Feb 2019 13:16:25 +0000 (05:16 -0800)]
ospf6d: Added changes to track route-map usage

Made changes and updated the routemap applied
counter in the following flows.
1.Increment the routemap applied counter when route map
  attached to a redistribution list.
  The counter will be updated if the routemap exists.
2.Decrement when route map removed / modified from a
  redistribution  list.
3.Increment/decrement when route map create/delete
  callback triggered.

Signed-off-by: RajeshGirada <rgirada@vmware.com>
5 years agoripd,ripngd: Added changes to track route-map usage in rip,ripng
rgirada [Mon, 4 Feb 2019 13:14:31 +0000 (05:14 -0800)]
ripd,ripngd: Added changes to track route-map usage in rip,ripng

Updated the routemap applied counter wherever  route map
attached/detached  to a redistribution list.

Signed-off-by: RajeshGirada <rgirada@vmware.com>
5 years agoisisd: Added changes to track route-map usage in isis.
rgirada [Mon, 4 Feb 2019 13:11:36 +0000 (05:11 -0800)]
isisd: Added changes to track route-map usage in isis.

Updated the routemap applied counter wherever
route map attached/detached  to a redistribution list.

Signed-off-by: RajeshGirada <rgirada@vmware.com>
5 years agolib: Implemented a cli "show route-map-unsed" to track all unsed routemaps.
rgirada [Thu, 20 Dec 2018 15:56:21 +0000 (07:56 -0800)]
lib: Implemented a cli "show route-map-unsed" to track all unsed routemaps.

Made the following changes.
1.Defined two apis in routemap-lib, one for increment and another for
  decrement the applied counter.
2.Added a  new configuration “show route-map-unused” to track all unused
  routemaps.
3.called the corresponding route map update api when a route map attached
  or detached from any redistribution list.

Signed-off-by: RajeshGirada <rgirada@vmware.com>
5 years agoeigrpd: Don't crash on a `no network A.B.C.D/M`
Donald Sharp [Mon, 4 Feb 2019 00:24:28 +0000 (19:24 -0500)]
eigrpd: Don't crash on a `no network A.B.C.D/M`

This command was crashing.  This fixes the crash
we are still not behaving quite correctly on
handling routes we have learned from those peers
covered by the network statement.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoeigrpd: Allow A.B.C.D and A.B.C.D/M for topology specification
Donald Sharp [Sun, 3 Feb 2019 21:25:47 +0000 (16:25 -0500)]
eigrpd: Allow A.B.C.D and A.B.C.D/M for topology specification

Allow eigrp to display interesting topo information to the
end user.

Fixes: #3705
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoeigrpd: Abstract display of an individual entry
Donald Sharp [Sun, 3 Feb 2019 20:47:53 +0000 (15:47 -0500)]
eigrpd: Abstract display of an individual entry

Abstract the individual display of a entry in the eigrp
topology table.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoeigrpd: Modify from int to boolean for display
Donald Sharp [Sun, 3 Feb 2019 20:46:31 +0000 (15:46 -0500)]
eigrpd: Modify from int to boolean for display

Track based upon boolean instead of an int

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoeigrpd: Modify code to pass down metric to zebra
Donald Sharp [Sun, 3 Feb 2019 14:56:20 +0000 (09:56 -0500)]
eigrpd: Modify code to pass down metric to zebra

Modify EIGRP code to pass its used metric down to zebra.
Additionally update topotests to pass with these changes.

Fixes: #3703
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoospfd: address CVE-2017-3224
Chirag Shah [Sat, 26 Jan 2019 01:21:24 +0000 (17:21 -0800)]
ospfd: address CVE-2017-3224

Based on the vulnerability mentioned in 793496 an attacker can craft an
LSA with MaxSequence number wtih invalid links and not set age to MAX_AGE
so the lsa would not be flush from the database.

To address the issue, check incoming LSA is MaxSeq but Age is not set
to MAX_AGE 3600, discard the LSA from processing it.
Based on  RFC-2328 , When a LSA update sequence reaches MaxSequence
number, it should be prematurely aged out from the database with age set
to MAX_AGE (3600).

Ticket:CM-18989
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #3714 from donaldsharp/thread_strlcpy
Mark Stapp [Thu, 31 Jan 2019 14:32:38 +0000 (15:32 +0100)]
Merge pull request #3714 from donaldsharp/thread_strlcpy

lib: snprintf to strlcpy in frr_pthread.c

5 years agozebra: Add ability to send to all clients updated capability information
Donald Sharp [Mon, 14 Jan 2019 16:08:19 +0000 (11:08 -0500)]
zebra: Add ability to send to all clients updated capability information

When capability information changes, allow for resending of data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Add hidden 'ip pim active-active` command
Donald Sharp [Mon, 14 Jan 2019 15:43:53 +0000 (10:43 -0500)]
pimd: Add hidden 'ip pim active-active` command

Add a command to track if an interface should be in active-active
mode or not.  This command is hidden at this time because it
is not finished fully.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add code to allow us to add debug for mlag
Donald Sharp [Fri, 11 Jan 2019 21:16:09 +0000 (16:16 -0500)]
zebra: Add code to allow us to add debug for mlag

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add mlag information to zrouter
Donald Sharp [Fri, 11 Jan 2019 18:17:45 +0000 (13:17 -0500)]
zebra: Add mlag information to zrouter

Since this is zebra router global level information
store mlag data in the zrouter structure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Remove `struct zebra_t`
Donald Sharp [Fri, 11 Jan 2019 20:43:17 +0000 (15:43 -0500)]
zebra: Remove `struct zebra_t`

This structure is unused anymore and does not belong in zserv.h

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move packets_to_process to zrouter
Donald Sharp [Fri, 11 Jan 2019 20:35:45 +0000 (15:35 -0500)]
zebra: Move packets_to_process to zrouter

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move lsp_process_q to zrouter
Donald Sharp [Fri, 11 Jan 2019 20:33:20 +0000 (15:33 -0500)]
zebra: Move lsp_process_q to zrouter

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move the mq data structure to zrouter
Donald Sharp [Fri, 11 Jan 2019 20:30:57 +0000 (15:30 -0500)]
zebra: Move the mq data structure to zrouter

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move ribq from zebrad to zrouter
Donald Sharp [Fri, 11 Jan 2019 20:11:38 +0000 (15:11 -0500)]
zebra: Move ribq from zebrad to zrouter

The zrouter should own this data structure and it should not
be defined in zserv.h

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move rtm_table_default to zrouter
Donald Sharp [Fri, 11 Jan 2019 19:59:36 +0000 (14:59 -0500)]
zebra: Move rtm_table_default to zrouter

The zrouter should own this particular piece of data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Make zebrad.sock zserv.c private data
Donald Sharp [Fri, 11 Jan 2019 18:52:09 +0000 (13:52 -0500)]
zebra: Make zebrad.sock zserv.c private data

The zebra.sock data is the listener socket for the zapi protocol.
The rest of the zebra router does not need to see this data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move client_list to the zebra_router data structure
Donald Sharp [Fri, 11 Jan 2019 18:38:19 +0000 (13:38 -0500)]
zebra: Move client_list to the zebra_router data structure

The client_list should be owned by the zebra_router data structure
as that it is part of global state information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move the master thread handler to the zrouter structure
Donald Sharp [Fri, 11 Jan 2019 18:31:46 +0000 (13:31 -0500)]
zebra: Move the master thread handler to the zrouter structure

The master thread handler is really part of the zrouter structure.
So let's move it over to that.  Eventually zserv.h will only be
used for zapi messages.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: snprintf to strlcpy in frr_pthread.c
Donald Sharp [Thu, 31 Jan 2019 12:51:07 +0000 (07:51 -0500)]
lib: snprintf to strlcpy in frr_pthread.c

Convert to using strlcpy to erase those pesky little
gcc warnings->errors

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3699 from donaldsharp/zebra_rib_debugs
David Lamparter [Thu, 31 Jan 2019 00:51:52 +0000 (01:51 +0100)]
Merge pull request #3699 from donaldsharp/zebra_rib_debugs

Zebra Respect my authority

5 years agoRevert "include: Add linux header mroute.h to our build"
David Lamparter [Thu, 31 Jan 2019 00:35:42 +0000 (01:35 +0100)]
Revert "include: Add linux header mroute.h to our build"

This reverts commit 086841cf0bddebc21e72dcb24755c222ed29072c.

Oops, broke the build... shoulda waited for CI...

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #3713 from opensourcerouting/yang-embed-extensions-2
Donald Sharp [Thu, 31 Jan 2019 00:36:18 +0000 (19:36 -0500)]
Merge pull request #3713 from opensourcerouting/yang-embed-extensions-2

[master] yang: embed extensions (v2)

5 years agobuild: fix a whole bunch of *FLAGS
David Lamparter [Wed, 30 Jan 2019 17:11:54 +0000 (18:11 +0100)]
build: fix a whole bunch of *FLAGS

- some target_CFLAGS that needed to include AM_CFLAGS didn't do so
- libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all
- consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@
- 2 dependencies were missing for clippy

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #3712 from donaldsharp/mroute_stuff
David Lamparter [Wed, 30 Jan 2019 17:30:48 +0000 (18:30 +0100)]
Merge pull request #3712 from donaldsharp/mroute_stuff

include: Add linux header mroute.h to our build

5 years agobuild, lib/yang: bake in extensions if possible (v2)
David Lamparter [Fri, 30 Nov 2018 20:42:25 +0000 (21:42 +0100)]
build, lib/yang: bake in extensions if possible (v2)

LIBS<>LDFLAGS was wrong on this one.

Fixes: 02a0df1f22c5cef8e4d3392d56e7db82da0d49cf
Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoinclude: Add linux header mroute.h to our build
Donald Sharp [Wed, 30 Jan 2019 17:28:35 +0000 (12:28 -0500)]
include: Add linux header mroute.h to our build

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3704 from donaldsharp/route_replace
Mark Stapp [Wed, 30 Jan 2019 16:09:52 +0000 (17:09 +0100)]
Merge pull request #3704 from donaldsharp/route_replace

zebra: On route update context is sometimes indeterminate in post-processing

5 years agozebra: On route update context is sometimes indeterminate in post-processing
Donald Sharp [Wed, 30 Jan 2019 14:31:32 +0000 (09:31 -0500)]
zebra: On route update context is sometimes indeterminate in post-processing

When we get into rib_process_result and the operation we are handling
is DPLANE_OP_ROUTE_UPDATE *and* the route entry being looked at
is a route replace, we currently have no way to decode to the old_re
and the re due to how we have stored context.  As such they are the
same pointer.

As such the route replace for the same route type is causing the re
to set the installed flag and then immediately unset the installed
flag, leaving us in a state where the kernel has the route but
the rib thinks we are not installed.

Since the true old_re( the one being replaced by the update operation )
is going away( as that it zebra deletes the old one for us already )
this fix is not optimal but will get us moving forward.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3690 from pguibert6WIND/detach_vrf_labels_del_bgp
Donald Sharp [Wed, 30 Jan 2019 12:36:57 +0000 (07:36 -0500)]
Merge pull request #3690 from pguibert6WIND/detach_vrf_labels_del_bgp

bgpd: detach vrf labels allocated, when removing bgp instance

5 years agozebra: When the kernel passes up a onlink route respect those flags
Donald Sharp [Wed, 30 Jan 2019 02:57:32 +0000 (21:57 -0500)]
zebra: When the kernel passes up a onlink route respect those flags

Read the onlink flag from the kernel for routes and pass them
up and through to zebra so that we are consistent with what
the kernel is telling us.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Trust kernel and System routes
Donald Sharp [Wed, 30 Jan 2019 02:45:02 +0000 (21:45 -0500)]
zebra: Trust kernel and System routes

If we receive a valid message from the kernel that
is either a kernel or system route, we should trust
that the route is legit and just use it.

Old behavior:

K * 172.22.0.0/15 [0/0] via 172.22.2.254, eva_dummy1 inactive, 00:00:16

New Behavior:

K>* 172.22.0.0/15 [0/0] via 172.22.2.254, eva_dummy1, 00:02:35

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Convert route entry id number to string in debugs
Donald Sharp [Wed, 30 Jan 2019 02:35:07 +0000 (21:35 -0500)]
zebra: Convert route entry id number to string in debugs

The route entry being displayed in debugs was displaying
the originating route type as a number.  While numbers
are cool, I for one am not terribly interested in
memorizing them.  Modify the (type %d) to a (%s) to
just list the string type of the route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib, zebra: Fix 'show ip route' char collision
Donald Sharp [Wed, 30 Jan 2019 01:29:20 +0000 (20:29 -0500)]
lib, zebra: Fix 'show ip route' char collision

Apparently 'f' means both OpenFabric and a Failed kernel
route installation.

Let's switch the 'f' for the failed kernel route installation
to 'r - rejected route'.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: some v4 attributes were being written 2 times
Donald Sharp [Wed, 30 Jan 2019 01:17:36 +0000 (20:17 -0500)]
zebra: some v4 attributes were being written 2 times

When the nexthop->type is NEXTHOP_TYPE_IPV4_IFINDEX we
were writing the RTA_PREFSRC 2 times for the build_singlepath
and build_multipath functions.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: some v6 attributes were being written twice
Donald Sharp [Wed, 30 Jan 2019 01:07:49 +0000 (20:07 -0500)]
zebra: some v6 attributes were being written twice

Some v6 attributes for the netlink_route_build_singlepath
code were being written two times for the NEXTHOP_TYPE_IPV6_IFINDEX
nexthop type.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3414 from pguibert6WIND/iprule_any_flowspec_handling_2
Donald Sharp [Tue, 29 Jan 2019 19:01:38 +0000 (14:01 -0500)]
Merge pull request #3414 from pguibert6WIND/iprule_any_flowspec_handling_2

Iprule any flowspec handling

5 years agoMerge pull request #3692 from nitinsoniism/valgrind_errors_fix
David Lamparter [Tue, 29 Jan 2019 18:45:26 +0000 (19:45 +0100)]
Merge pull request #3692 from nitinsoniism/valgrind_errors_fix

bgpd: fix valgrind flagged errors

5 years agozebra: probe local inactive neigh
Chirag Shah [Mon, 28 Jan 2019 23:37:03 +0000 (15:37 -0800)]
zebra: probe local inactive neigh

In extended-mobility case ({IP1, MAC} binding),
when a MAC moves from local to remote, binding
changes to {IP2, MAC}, local neigh (IP1) marked
as inactive in frr.
The evpn draft recommends to probe the entry once
local binding changes from local to remote.
Once the probe is set for the local neigh entry,
kernel will attempt refresh the entry via sending
unicast address resolution message, if host does not
reply, it will mark FAILED state.
For FAILED entry, kernel triggers delete neigh
request, which result in frr to remove inactive entry.

In absence of probing and aging out entry,
if MAC moves back to local with {IP3, MAC},
frr will mark both IP1 and IP3 as active and sends
type-2 update for both.
The IP1 may not be active host and still frr advertises
the route.

Ticket:CM-22864
Testing Done:

Validate the MAC mobilty in extended mobility scenario,
where local inactive entry gets removed once MAC moves
to remote state.
Once probe is set to the local entry, kernel triggers
reachability of the neigh/arp entry, since MAC moved remote,
ARP request goes to remote VTEP where host is not residing,
thus local neigh entry goes to failed state.
Frr receives neighbor delete faster and removes the entry.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #3691 from pguibert6WIND/debug_rule_fwmark
David Lamparter [Tue, 29 Jan 2019 16:38:11 +0000 (17:38 +0100)]
Merge pull request #3691 from pguibert6WIND/debug_rule_fwmark

zebra: add fwmark information at netlink level

5 years agoMerge pull request #3687 from donaldsharp/ifp_flags
Renato Westphal [Tue, 29 Jan 2019 16:35:09 +0000 (14:35 -0200)]
Merge pull request #3687 from donaldsharp/ifp_flags

zebra: Use the kernel flags from the IFA_FLAGS if it is available

5 years agobgpd: fix as-path prepend heap uaf
Quentin Young [Tue, 29 Jan 2019 16:13:39 +0000 (16:13 +0000)]
bgpd: fix as-path prepend heap uaf

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agozebra: add kernel neigh update api
Chirag Shah [Mon, 28 Jan 2019 23:32:45 +0000 (15:32 -0800)]
zebra: add kernel neigh update api

The kernel neigh update api helps update neighbor entry,
using changing state and flags parameters.

Ticket:CM-22864
Reviewed By:
Testing Done:

Signed-off-by:Chirag Shah <chirag@cumulusnetworks.com>

5 years agoMerge pull request #3288 from nitinsoniism/show_intf_brief
David Lamparter [Tue, 29 Jan 2019 15:23:36 +0000 (16:23 +0100)]
Merge pull request #3288 from nitinsoniism/show_intf_brief

zebra: Support "brief" output for "show interface"