]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
6 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

6 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…

6 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

6 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

6 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

6 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

6 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

6 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

6 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

6 years agozebra: NHT was being run at least 2 times and missreporting data 3733/head
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>
6 years agopimd: Pim is not respecting the move of an interface from old->new vrf 3730/head
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>
6 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>
6 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>
6 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

6 years agoMerge pull request #3602 from donaldsharp/mlag_debug 3734/head
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

6 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

6 years agodoc: fix missing backtick 3732/head
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>
6 years agobgpd: use correct specifier to print asn 3727/head
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>
6 years agobgpd: Added changes to track route-map usage 3518/head
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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agoeigrpd: Don't crash on a `no network A.B.C.D/M` 3725/head
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>
6 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>
6 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>
6 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>
6 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>
6 years agoospfd: address CVE-2017-3224 3693/head
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>
6 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

6 years agozebra: Add ability to send to all clients updated capability information 3602/head
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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agolib: snprintf to strlcpy in frr_pthread.c 3714/head
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>
6 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

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

6 years agobuild: fix a whole bunch of *FLAGS 3713/head
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>
6 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

6 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>
6 years agoinclude: Add linux header mroute.h to our build 3712/head
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>
6 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

6 years agozebra: On route update context is sometimes indeterminate in post-processing 3704/head
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>
6 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

6 years agozebra: When the kernel passes up a onlink route respect those flags 3699/head
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>
6 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>
6 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>
6 years agolib, zebra: Fix 'show ip route' char collision 3698/head
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>
6 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>
6 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>
6 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

6 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

6 years agozebra: probe local inactive neigh 3688/head
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>
6 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

6 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

6 years agobgpd: fix as-path prepend heap uaf 3694/head
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>
6 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>

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

6 years agoMerge pull request #3681 from donaldsharp/onlink
Russ White [Tue, 29 Jan 2019 15:09:44 +0000 (10:09 -0500)]
Merge pull request #3681 from donaldsharp/onlink

*: The onlink attribute should be owned by the nexthop not the route.

6 years agoMerge pull request #3678 from chiragshah6/evpn_dev1
Russ White [Tue, 29 Jan 2019 15:05:50 +0000 (10:05 -0500)]
Merge pull request #3678 from chiragshah6/evpn_dev1

zebra: EVPN fix duplicate address detection remote macip add case

6 years agoMerge pull request #3659 from nitinsoniism/route_map_type_5_filter
Russ White [Tue, 29 Jan 2019 15:02:59 +0000 (10:02 -0500)]
Merge pull request #3659 from nitinsoniism/route_map_type_5_filter

bgpd: route-map fails to filter type-5 routes

6 years agoMerge pull request #3657 from nitinsoniism/ospf_mtu_crash
Russ White [Tue, 29 Jan 2019 14:58:53 +0000 (09:58 -0500)]
Merge pull request #3657 from nitinsoniism/ospf_mtu_crash

ospfd: ospfd core if hello packet exceeds link MTU

6 years agoMerge pull request #3653 from dslicenc/bgpd-remote-as
Russ White [Tue, 29 Jan 2019 14:58:02 +0000 (09:58 -0500)]
Merge pull request #3653 from dslicenc/bgpd-remote-as

bgpd: improve peer-group remote-as definitions

6 years agoMerge pull request #3616 from donaldsharp/route_notification
Russ White [Tue, 29 Jan 2019 14:55:41 +0000 (09:55 -0500)]
Merge pull request #3616 from donaldsharp/route_notification

Route notification

6 years agoMerge pull request #3395 from donaldsharp/bgp_interface
Russ White [Tue, 29 Jan 2019 14:38:16 +0000 (09:38 -0500)]
Merge pull request #3395 from donaldsharp/bgp_interface

Bgp interface

6 years agobgpd: fix valgrind flagged errors 3692/head
Nitin Soni [Tue, 29 Jan 2019 14:29:57 +0000 (06:29 -0800)]
bgpd: fix valgrind flagged errors

Executed some evpn related tests with valgrind and saw some errors
related to uninitialized memory and overlapping memcpy. This commit
fixes those.

Ticket: CM-21218
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8249
6 years agoMerge pull request #3686 from qlyoung/fix-termtable-overflow
Renato Westphal [Tue, 29 Jan 2019 14:01:16 +0000 (12:01 -0200)]
Merge pull request #3686 from qlyoung/fix-termtable-overflow

lib: protect termtable from bad fmt string

6 years agoMerge pull request #3621 from donaldsharp/modules_doc_update
Renato Westphal [Tue, 29 Jan 2019 13:58:55 +0000 (11:58 -0200)]
Merge pull request #3621 from donaldsharp/modules_doc_update

doc: Update modules.rst to better represent what is needed

6 years agozebra: add fwmark information at netlink level 3691/head
Philippe Guibert [Thu, 29 Nov 2018 14:22:27 +0000 (15:22 +0100)]
zebra: add fwmark information at netlink level

ip rule configuration is being equipped with extra log information for
fwmark information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: display the list of iprules attached to a fs entry 3414/head
Philippe Guibert [Fri, 30 Nov 2018 13:56:40 +0000 (14:56 +0100)]
bgpd: display the list of iprules attached to a fs entry

the list of iprules is displayed in the 'show bgp ipv4 flowspec detail'
The list of iprules is displayed, only if it is installed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: change priority of fs pbr rules
Philippe Guibert [Fri, 30 Nov 2018 13:13:37 +0000 (14:13 +0100)]
bgpd: change priority of fs pbr rules

two kind of rules are being set from bgp flowspec: ipset based rules,
and ip rule rules. default route rules may have a lower priority than
the other rules ( that do not support default rules). so, if an ipset
rule without fwmark is being requested, then priority is arbitrarily set
to 1. the other case, priority is set to 0.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: notify callback when ip rule from/to rule has been configured
Philippe Guibert [Thu, 29 Nov 2018 13:35:41 +0000 (14:35 +0100)]
bgpd: notify callback when ip rule from/to rule has been configured

because ip rule creation is used to not only handle traffic marked by
fwmark; but also for conveying traffic with from/to rules, a check of
the creation must be done in the linked list of ip rules.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: conversion from fs to pbr: support for ip rule from/to
Philippe Guibert [Thu, 29 Nov 2018 14:17:36 +0000 (15:17 +0100)]
bgpd: conversion from fs to pbr: support for ip rule from/to

adding/suppressing flowspec to pbr is supported. the add and the remove
code is being added. now,bgp supports the hash list of ip rule list.
The removal of bgp ip rule is done via search. The search uses the
action field. the reason is that when a pbr rule is added, to replace an
old one, the old one is kept until the new one is installed, so as to
avoid traffic to be cut. This is why at one moment, one can have two
same iprules with different actions. And this is why the algorithm
covers this case.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: ip rule zebra layer adapted to handle both cases
Philippe Guibert [Thu, 29 Nov 2018 14:14:41 +0000 (15:14 +0100)]
bgpd: ip rule zebra layer adapted to handle both cases

now, ip rule can be created from two differnt ways; however a single
zebra API has been defined. so make it consistent by adding a parameter
to the bgp zebra layer. the function will handle the rest.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: the fs entry is valid for any rule only, by using ipruleset cmd
Philippe Guibert [Thu, 29 Nov 2018 14:08:36 +0000 (15:08 +0100)]
bgpd: the fs entry is valid for any rule only, by using ipruleset cmd

Before, it was not possible to create any rules. Now, it is possible to
have flowspec rules relying only on ip rule command. The check is done
here.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: an hash list of pbr iprule is created
Philippe Guibert [Thu, 29 Nov 2018 14:12:03 +0000 (15:12 +0100)]
bgpd: an hash list of pbr iprule is created

that iprule list stands for the list of fs entries that are created,
based only on ip rule from/to rule.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: upon bgp fs study, determine if iprule can be used
Philippe Guibert [Thu, 29 Nov 2018 14:04:52 +0000 (15:04 +0100)]
bgpd: upon bgp fs study, determine if iprule can be used

instead of using ipset based mechanism to forward packets, there are
cases where it is possible to use ip rule based mechanisms (without
ipset). Here, this applies to simple fs rules with only 'from any' or
'to any'.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: remove useless fields in bgp_pbr_entry_main
Philippe Guibert [Thu, 29 Nov 2018 14:03:03 +0000 (15:03 +0100)]
bgpd: remove useless fields in bgp_pbr_entry_main

main bgp structure that contains fs information is being cleaned.
some fields are removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: detach vrf labels allocated, when removing bgp instance 3690/head
Philippe Guibert [Mon, 28 Jan 2019 16:54:50 +0000 (17:54 +0100)]
bgpd: detach vrf labels allocated, when removing bgp instance

bgp instance is disabling the label allocated to reach vrf entity.
previously, only vrf disabling was removing the label. now, when bgp
leaves, bgp instance also frees the label used.

PR=62306
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Acked-by: Julien Floret <julien.floret@6wind.com>
6 years agozebra: Use the kernel flags from the IFA_FLAGS if it is available 3687/head
Donald Sharp [Mon, 28 Jan 2019 21:14:03 +0000 (16:14 -0500)]
zebra: Use the kernel flags from the IFA_FLAGS if it is available

The ifa_flags value in the netlink message was originally a uint8_t
value.  The linux kernel quickly ran out of 8 bits of data to
pass and the IFA_FLAGS value was added to the netlink message to allow
more than 8 bits of data to be passed.  So replace the ifa_flags
with the IFA_FLAGS value if it exists in the interface netlink
message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: protect termtable from bad fmt string 3686/head
Quentin Young [Mon, 28 Jan 2019 20:44:20 +0000 (20:44 +0000)]
lib: protect termtable from bad fmt string

Termtable can write out-of-bounds if given a format string with too many
column separators.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #3664 from opensourcerouting/yang-embed-extensions
Donald Sharp [Mon, 28 Jan 2019 15:38:56 +0000 (10:38 -0500)]
Merge pull request #3664 from opensourcerouting/yang-embed-extensions

yang: embed extensions

6 years agoMerge pull request #3680 from opensourcerouting/ospf6-fix-mcast
Donald Sharp [Mon, 28 Jan 2019 14:45:30 +0000 (09:45 -0500)]
Merge pull request #3680 from opensourcerouting/ospf6-fix-mcast

ospf6d: fix multicast join race on FreeBSD

6 years agoospfd: ospfd core if hello packet exceeds link MTU 3657/head
Nitin Soni [Thu, 24 Jan 2019 08:44:42 +0000 (00:44 -0800)]
ospfd: ospfd core if hello packet exceeds link MTU

Ospfd cored because of an assert when we try to write more than the MTU
size to the ospf packet buffer stream. The problem is - we allocate only MTU
sized buffer. The expectation is that Hello packets are never large
enough to approach MTU. Instead of crashing, this fix discards hello and
logs an error. One should not have so many neighbors behind an
interface.

Ticket: CM-22380
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8204
6 years ago*: The onlink attribute should be owned by the nexthop not the route. 3681/head
Donald Sharp [Sun, 27 Jan 2019 01:44:42 +0000 (20:44 -0500)]
*: The onlink attribute should be owned by the nexthop not the route.

The onlink attribute was being passed from upper level protocols
as an attribute of the route *not* the individual nexthop.  When
we pass this data to the kernel, we treat the onlink as a attribute
of the nexthop.  This commit modifies the code base to allow
us to pass the ONLINK attribute as an attribute of the nexthop.

This commit also fixes static routes that have multiple nexthops
some onlink and some not.

ip route 4.5.6.7/32 192.168.41.1 eveth1 onlink
ip route 4.5.6.7/32 192.168.42.2

S>* 4.5.6.7/32 [1/0] via 192.168.41.1, eveth1 onlink, 00:03:04
  *                  via 192.168.42.2, eveth2, 00:03:04

sharpd@robot ~/frr2> sudo ip netns exec EVA ip route show
4.5.6.7 proto 196 metric 20
nexthop via 192.168.41.1 dev eveth1 weight 1 onlink
nexthop via 192.168.42.2 dev eveth2 weight 1

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoospf6d: fix FreeBSD IPv6 multicast group join race 3680/head
Rafael Zalamena [Sat, 26 Jan 2019 15:49:35 +0000 (13:49 -0200)]
ospf6d: fix FreeBSD IPv6 multicast group join race

Avoid a IPv6 multicast group join race by delaying the group install
before processing all event queue.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
6 years agobgpd: interface based peers should automatically override it's peer group 3395/head
Donald Sharp [Wed, 28 Nov 2018 23:46:36 +0000 (18:46 -0500)]
bgpd: interface based peers should automatically override it's peer group

When a interface based peer is setup and if it is part of a peer
group we should ignore this and just use the PEER_FLAG_CAPABILITY_ENHE
no matter what.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix crash in various 'show bgp neighbor json' commands
Donald Sharp [Wed, 28 Nov 2018 23:21:08 +0000 (18:21 -0500)]
bgpd: Fix crash in various 'show bgp neighbor json' commands

bgp would crash with various `show bgp neighbor json` commands
based upon whether or not it did a pretty print of the output
or not.  This is because we were freeing the data 2 times.
Cleanup so that we free the json data 1 time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>