]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agoMerge pull request #4677 from mruprich/master
David Lamparter [Mon, 12 Aug 2019 15:09:14 +0000 (17:09 +0200)]
Merge pull request #4677 from mruprich/master

ospfd,ripd: Enabling openssl library for md5 authentication in RIP and OSPF

4 years agoMerge pull request #4793 from qlyoung/fix-bgp-labeled-unicast-addpath
Mark Stapp [Mon, 12 Aug 2019 12:51:36 +0000 (08:51 -0400)]
Merge pull request #4793 from qlyoung/fix-bgp-labeled-unicast-addpath

bgpd: tx addpath info for labeled unicast

4 years agoMerge pull request #4817 from NaveenThanikachalam/652
Donald Sharp [Mon, 12 Aug 2019 12:45:51 +0000 (08:45 -0400)]
Merge pull request #4817 from NaveenThanikachalam/652

bgpd: Optimizing route-map's processing of dependencies.

4 years agobgpd: Optimizing route-map's processing of dependencies.
Naveen Thanikachalam [Sun, 11 Aug 2019 11:24:15 +0000 (04:24 -0700)]
bgpd: Optimizing route-map's processing of dependencies.

Say for eg., 256 prefix-list entries are pasted to VTYSH.
This results in BGP processing the events for several minutes.

BGPD starts a timer for 5 seconds when the first dependency configuraion
is received. On timer expiry, BGP process dependent route-maps.
After this processing, BGPD reads the configurations received in the
next 5 seconds and then re-processes the route-maps from the beginning.
This cyclic re-processing consumes time and CPU cycles.

Instead of starting a timer when the first configuration is received,
everytime a configuration is received, the existing timer is reset.
This would mean that all the configurations are read first before the timer
expires. This eliminates the cyclic re-processing.

Signed-off-by: NaveenThanikachalam nthanikachal@vmware.com
4 years agoMerge pull request #4813 from NaveenThanikachalam/604
Donald Sharp [Sun, 11 Aug 2019 20:46:33 +0000 (16:46 -0400)]
Merge pull request #4813 from NaveenThanikachalam/604

bgpd: Standard large-communities CLI does not return error when it's configured with reg-ex.

4 years agoMerge pull request #4816 from NaveenThanikachalam/610
Donald Sharp [Sun, 11 Aug 2019 15:58:36 +0000 (11:58 -0400)]
Merge pull request #4816 from NaveenThanikachalam/610

bgpd: Assertion failed during shutdown.

4 years agobgpd: Assertion failed during shutdown.
Naveen Thanikachalam [Sun, 11 Aug 2019 10:56:12 +0000 (03:56 -0700)]
bgpd: Assertion failed during shutdown.

A race condition causes the failure.
The function "make_info()" sets the path info's peer to
bgp instance's "peer_self" which is created when BGP is first
configured and deleted only when BGP is brought down completely.
A race condition causes the bgp instances's "peer_self" to be
removed before the routes are being pulled off from the aggregate
address.

If the bgp instance's "peer_self" is NULL or, if BGP is being deleted,
the aggregate route must not be reinstalled.

Signed-off-by: NaveenThanikachalam nthanikachal@vmware.com
4 years agobgpd: Standard large-communities CLI does not return error when it's configured with...
Naveen Thanikachalam [Sun, 11 Aug 2019 07:29:32 +0000 (00:29 -0700)]
bgpd: Standard large-communities CLI does not return error when it's configured with reg-ex.

The CLI to configure the standard format large-communities attribute
accepts regular expressions as well.
For ex., the below configuration is accepted.
         "bgp large-community-list standard TEST permit 1:1 100:*"

The code to parse the large-communities does identify the configuration
as invalid however, error returned isn't processed.
The code has to be modified to handle the error.

Signed-off-by: NaveenThanikachalam nthanikachal@vmware.com
4 years agoMerge pull request #4803 from ddutt/master
Donald Sharp [Sat, 10 Aug 2019 19:41:18 +0000 (15:41 -0400)]
Merge pull request #4803 from ddutt/master

Support for display of received and advertised EVPN routes from neigh…

4 years agoMerge pull request #4811 from adharkar/frr-master-rtm_vni
Donald Sharp [Sat, 10 Aug 2019 00:39:34 +0000 (20:39 -0400)]
Merge pull request #4811 from adharkar/frr-master-rtm_vni

Zebra: Incorrect L3VNI for FPM rtmsg for EVPN RT-5 prefix

4 years agoZebra: Incorrect L3VNI for FPM rtmsg for EVPN RT-5 prefix
Ameya Dharkar [Fri, 9 Aug 2019 22:21:27 +0000 (15:21 -0700)]
Zebra: Incorrect L3VNI for FPM rtmsg for EVPN RT-5 prefix

We used the vrf_id in the rtm_table field of the netlink rtmsg to fetch L3VNI.
But, now we program table_id to rtm_table field instead of vrf_id.
Thus, L3VNI fetched using rtm_table is incorrect.

Instead, use nexthop->vrf_id to fetch the L3VNI.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
4 years agoMerge pull request #4806 from chiragshah6/evpn_dev1
Russ White [Fri, 9 Aug 2019 11:32:57 +0000 (07:32 -0400)]
Merge pull request #4806 from chiragshah6/evpn_dev1

zebra: fix advertise svi ip as macip route

4 years agozebra: fix advertise svi ip as macip route
Chirag Shah [Thu, 8 Aug 2019 17:43:49 +0000 (10:43 -0700)]
zebra: fix advertise svi ip as macip route

PR #3745 added EVPN feature to advertise individual
SVI-IPs as MAC-IP routes.
Fix a condition in zebra to send MAC and IP pair
to bgpd when the feature is enabled.

Testing Done:

Originator VTEP:
TORC11:~# ip -br addr show VxU-1002
VxU-1002         UP             45.0.2.2/24 2001:fee1:0:2::2/64

show bgp l2vpn evpn vni 1004
VNI: 1004 (known to the kernel)
  Type: L2
  Tenant-Vrf: default
  RD: 27.0.0.11:3
  Advertise-svi-macip : Yes
  Import Route Target:
    10:1004
  Export Route Target:
    10:1004

Remote vtep evpn route output for 45.0.4.2:

BGP routing table entry for 27.0.0.11:3:[2]:[0]:[48]:[00:02:00:00:00:2f]:[32]:[45.0.4.2]
Paths: (2 available, best #1)
  Advertised to non peer-group peers:
  MSP1(uplink-1) MSP2(uplink-2)
  Route [2]:[0]:[48]:[00:02:00:00:00:2f]:[32]:[45.0.4.2] VNI 1004
  64435 65546
    36.0.0.11 from MSP1(uplink-1) (27.0.0.9)
      Origin IGP, valid, external, bestpath-from-AS 64435, best (First path received)
      Extended Community: RT:10:1004 ET:8
      Last update: Thu Aug  8 18:09:13 2019

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoMerge pull request #4724 from satheeshkarra/pim_fixes
Sri Mohana Singamsetty [Thu, 8 Aug 2019 16:57:18 +0000 (09:57 -0700)]
Merge pull request #4724 from satheeshkarra/pim_fixes

pimd: NH Updates are missing at PIM during boot up

4 years agoospfd,ripd: Enabling build with openssl
Michal Ruprich [Thu, 11 Jul 2019 09:28:15 +0000 (11:28 +0200)]
ospfd,ripd: Enabling build with openssl

Enabling openssl library for md5 authentication in RIP and OSPF

Signed-off-by: Michal Ruprich <michalruprich@gmail.com>
4 years agoMerge pull request #4497 from opensourcerouting/rcu
Donald Sharp [Thu, 8 Aug 2019 12:41:07 +0000 (08:41 -0400)]
Merge pull request #4497 from opensourcerouting/rcu

RCU support

4 years agobgpd: Display received and advertised EVPN routes from neighbors
Dinesh Dutt [Thu, 8 Aug 2019 02:58:18 +0000 (02:58 +0000)]
bgpd: Display received and advertised EVPN routes from neighbors

"show bgp l2vpn evpn neighbors <neighbor> [advertised-routes|routes]' did
not work due to various bugs. First, the command only accepted IPv4
addresses as valid neighbor ID, thereby rejecting unnumbered BGP and IPv6
neighbor address. Second, the SAFI was hardcoded to MPLS_VPN even though
we were passing the safi. Third, "all" made no sense in the command context
and to make the command uniform across all address families, I removed the
"all" keyword from the command.

Signed-off-by: Dinesh G Dutt <ddps4u@gmail.com>
4 years agoMerge pull request #4763 from opensourcerouting/ds-work
Donald Sharp [Wed, 7 Aug 2019 20:45:02 +0000 (16:45 -0400)]
Merge pull request #4763 from opensourcerouting/ds-work

lib: get rid of pqueue_*, use DECLARE_HEAP in thread.c

4 years agoMerge pull request #4781 from opensourcerouting/eigrpd-northbound
Donald Sharp [Tue, 6 Aug 2019 23:38:30 +0000 (19:38 -0400)]
Merge pull request #4781 from opensourcerouting/eigrpd-northbound

eigrpd: migrate to northbound

4 years agobgpd: tx addpath info for labeled unicast
Quentin Young [Tue, 6 Aug 2019 21:18:42 +0000 (21:18 +0000)]
bgpd: tx addpath info for labeled unicast

Labeled unicast needs path IDs too!

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #4792 from opensourcerouting/doc_libcap
Quentin Young [Tue, 6 Aug 2019 19:51:30 +0000 (15:51 -0400)]
Merge pull request #4792 from opensourcerouting/doc_libcap

doc: suggest the installation of the libcap development library

4 years agoMerge pull request #4791 from mjstapp/fix_doc_te_limits
Quentin Young [Tue, 6 Aug 2019 19:50:24 +0000 (15:50 -0400)]
Merge pull request #4791 from mjstapp/fix_doc_te_limits

docs: Add notes about limited MPLS-TE support

4 years agodocs: Add notes about limited MPLS-TE support
Mark Stapp [Tue, 6 Aug 2019 18:59:01 +0000 (14:59 -0400)]
docs: Add notes about limited MPLS-TE support

Add notes to several docs about the limits to FRR's current
MPLS-TE support, which is limited to some routing protocol
LSA/TLV support. It wasn't very clear that FRR does not offer
a complete TE/RSVP-TE solution at this time.

Also removed some stale info about configure script options.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agodoc: suggest the installation of the libcap development library
Renato Westphal [Tue, 6 Aug 2019 18:53:42 +0000 (15:53 -0300)]
doc: suggest the installation of the libcap development library

All FRR Linux packages are built using libcap-dev (or libcap-devel)
installed in the system. Update the build instructions to suggest
FRR developers to do the same. The main motivation for this is that
the seteuid() system call is too expensive and overall less secure
compared to using the Linux capabilities framework.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoMerge pull request #4790 from opensourcerouting/ctype-cast
Quentin Young [Tue, 6 Aug 2019 17:21:13 +0000 (13:21 -0400)]
Merge pull request #4790 from opensourcerouting/ctype-cast

*: fix ctype casts

4 years agodebian: add .gitignore file
David Lamparter [Wed, 24 Jul 2019 21:42:46 +0000 (17:42 -0400)]
debian: add .gitignore file

Ignore the build results when dpkg-buildpackage was run in the source
directory.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years ago*: fix ctype (isalpha & co.) casts
David Lamparter [Tue, 6 Aug 2019 14:54:52 +0000 (16:54 +0200)]
*: fix ctype (isalpha & co.) casts

The correct cast for these is (unsigned char), because "char" could be
signed and thus have some negative value.  isalpha & co. expect an int
arg that is positive, i.e. 0-255.  So we need to cast to (unsigned char)
when calling any of these.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agoall: remove logical-router functionality (#4774)
David Lamparter [Tue, 6 Aug 2019 14:45:56 +0000 (16:45 +0200)]
all: remove logical-router functionality (#4774)

all: remove logical-router functionality

4 years agoMerge pull request #4776 from pogojotz/write-config-fix
Donald Sharp [Tue, 6 Aug 2019 13:58:42 +0000 (09:58 -0400)]
Merge pull request #4776 from pogojotz/write-config-fix

Replace internal linked-list in vtysh_config with RB-tree

4 years agoMerge pull request #4733 from opensourcerouting/route-map-yang
Russ White [Tue, 6 Aug 2019 13:20:37 +0000 (09:20 -0400)]
Merge pull request #4733 from opensourcerouting/route-map-yang

yang: models for route map and filters

4 years agoMerge pull request #4742 from opensourcerouting/ospfd-default-originate
Russ White [Tue, 6 Aug 2019 12:26:54 +0000 (08:26 -0400)]
Merge pull request #4742 from opensourcerouting/ospfd-default-originate

ospfd: fix & clean up default origination

4 years agoMerge pull request #4785 from mjstapp/fix_notif_queued_flag
David Lamparter [Tue, 6 Aug 2019 09:03:48 +0000 (11:03 +0200)]
Merge pull request #4785 from mjstapp/fix_notif_queued_flag

zebra: clear route QUEUED flag in async notification handler

4 years agoMerge pull request #4777 ("Fix VRRP rarely getting stuck in Initialize")
David Lamparter [Tue, 6 Aug 2019 08:52:30 +0000 (10:52 +0200)]
Merge pull request #4777 ("Fix VRRP rarely getting stuck in Initialize")

... with a one-char typo fix.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agozebra: fix typo
David Lamparter [Tue, 6 Aug 2019 08:52:07 +0000 (10:52 +0200)]
zebra: fix typo

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agobgpd: resolve memleak on show bgp vrf all ipv6 unicast summary… (#4772)
David Lamparter [Tue, 6 Aug 2019 08:49:09 +0000 (10:49 +0200)]
bgpd: resolve memleak on show bgp vrf all ipv6 unicast summary… (#4772)

bgpd: resolve memleak on show bgp vrf all ipv6 unicast summary json

4 years agoMerge pull request #4705 from ton31337/fix/set_comm-list_delete_into_config
Quentin Young [Mon, 5 Aug 2019 20:53:45 +0000 (16:53 -0400)]
Merge pull request #4705 from ton31337/fix/set_comm-list_delete_into_config

bgpd: Strip `delete` keyword when looking up for large communities

4 years agovrrpd: eliminate potential null deref
Quentin Young [Mon, 5 Aug 2019 16:24:45 +0000 (16:24 +0000)]
vrrpd: eliminate potential null deref

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agozebra: clear route QUEUED flag in async notification handler
Mark Stapp [Mon, 5 Aug 2019 14:07:26 +0000 (10:07 -0400)]
zebra: clear route QUEUED flag in async notification handler

Ensure that the route-entry QUEUED flag is cleared in the async
notification path, as it is in the normal results processing
code path.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agobgpd: simplify json create/free for memleak fix
Don Slice [Mon, 5 Aug 2019 11:48:20 +0000 (04:48 -0700)]
bgpd: simplify json create/free for memleak fix

Ticket: CM-25616
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agoMerge pull request #4779 from donaldsharp/sharp_repeat_fix
Mark Stapp [Mon, 5 Aug 2019 12:40:10 +0000 (08:40 -0400)]
Merge pull request #4779 from donaldsharp/sharp_repeat_fix

sharpd: Fix repeat sub-command to work

4 years agoeigrpd: implement configuration reload
Rafael Zalamena [Thu, 1 Aug 2019 19:13:34 +0000 (16:13 -0300)]
eigrpd: implement configuration reload

Reload configuration on SIGHUP using the northbound.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoeigrpd: migrate old CLI to northbound
Rafael Zalamena [Tue, 30 Jul 2019 15:44:13 +0000 (12:44 -0300)]
eigrpd: migrate old CLI to northbound

Move all configuration commands to the new CLI code (`eigrp_cli.c`),
implement the northbound and do all the necessary wiring to get it
working.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoyang: change EIGRP authentication enum name
Rafael Zalamena [Fri, 2 Aug 2019 18:53:16 +0000 (15:53 -0300)]
yang: change EIGRP authentication enum name

In order to keep compatibility with the initial CLI, the enumeration
name for sha2 was changed. No CLI code workarounds required.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agosharpd: Fix repeat sub-command to work
Donald Sharp [Sat, 3 Aug 2019 00:35:16 +0000 (20:35 -0400)]
sharpd: Fix repeat sub-command to work

The repeat sub-command was not properly repeating.  It was starting
the removal during the install:

2019/08/03 00:10:14.351 SHARP: Inserting 300000 routes
2019/08/03 00:13:01.556 SHARP: Installed All Items 167.204747
2019/08/03 00:13:01.556 SHARP: Removing 300000 routes
2019/08/03 00:13:03.126 SHARP: Inserting 300000 routes
2019/08/03 00:14:34.794 SHARP: Removed all Items 91.668040
2019/08/03 00:16:11.743 SHARP: Installed All Items 188.616462
2019/08/03 00:16:11.743 SHARP: Removing 300000 routes
2019/08/03 00:16:14.256 SHARP: Inserting 300000 routes

This command allows the remove to wait till the install is fully
finished and vice versa:

2019/08/03 00:22:54 SHARP: Inserting 10000 routes
2019/08/03 00:22:55 SHARP: Installed All Items 0.572028
2019/08/03 00:22:55 SHARP: Removing 10000 routes
2019/08/03 00:22:55 SHARP: Removed all Items 0.568284
2019/08/03 00:22:55 SHARP: Inserting 10000 routes
2019/08/03 00:22:56 SHARP: Installed All Items 0.567687
2019/08/03 00:22:56 SHARP: Removing 10000 routes
2019/08/03 00:22:56 SHARP: Removed all Items 0.551011

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #4752 from chiragshah6/evpn_dev1
Sri Mohana Singamsetty [Fri, 2 Aug 2019 22:56:57 +0000 (15:56 -0700)]
Merge pull request #4752 from chiragshah6/evpn_dev1

zebra: del auto mac when vni is down

4 years agoMerge pull request #4775 from sworleys/Log-Double-Unlock
Mark Stapp [Fri, 2 Aug 2019 17:33:18 +0000 (13:33 -0400)]
Merge pull request #4775 from sworleys/Log-Double-Unlock

lib: Remove double log mutex unlock

4 years agovrrpd: try to bind interfaces on if_down notifications
Quentin Young [Thu, 1 Aug 2019 17:38:46 +0000 (17:38 +0000)]
vrrpd: try to bind interfaces on if_down notifications

Normally we only opportunistically try to bind interfaces to VRRP
instances upon getting if_add and if_up notifications; now that Zebra
sends if_down notifications when interfaces change while they are down,
we should try to bind when we get those as well.

This solves a bug where VRRP would not bind and activate virtual routers
to valid interfaces because their MACs were changed to VRRP macs while
the interface was down.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agozebra: send interface updates when down
Quentin Young [Thu, 1 Aug 2019 17:37:05 +0000 (17:37 +0000)]
zebra: send interface updates when down

When interfaces change while they are up, Zebra sends if_up
notifications with the updated interface info. Change Zebra to send
if_down notifications with interface info when the interface changes
while it is down.

VRRP, at the least, needs these to know about MAC changes while an
interface is down.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agovrrpd: add more dbg logs around interfaces
Quentin Young [Thu, 1 Aug 2019 17:35:09 +0000 (17:35 +0000)]
vrrpd: add more dbg logs around interfaces

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agovtysh: Replace linked-list in vtysh_config with RB-tree
Juergen Werner [Fri, 2 Aug 2019 15:45:13 +0000 (17:45 +0200)]
vtysh: Replace linked-list in vtysh_config with RB-tree

...for faster look-ups

Fixes: 4673
Signed-off-by: Juergen Werner <juergen@opensourcerouting.org>
4 years agolib: Remove double log mutex unlock
Stephen Worley [Fri, 2 Aug 2019 15:12:33 +0000 (11:12 -0400)]
lib: Remove double log mutex unlock

Coverity report caught this log mutex being unlocked twice.
Removing the extra one before the goto statement.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agoall: remove logical-router functionality
Igor Ryzhov [Fri, 2 Aug 2019 14:10:11 +0000 (17:10 +0300)]
all: remove logical-router functionality

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
4 years agobgpd: resolve memleak on show bgp vrf all ipv6 unicast summary json
Don Slice [Wed, 31 Jul 2019 16:38:49 +0000 (12:38 -0400)]
bgpd: resolve memleak on show bgp vrf all ipv6 unicast summary json

Problem reported with memory leak when the command "show bgp vrf all
ipv6 unicast summary json" is issued.  Found that the problem only
occurs if the configuration does not actually include the ipv6
address-family but does contain ipv4 unicast peers. If we didn't
match a peer in the address-family being displayed, we would create
the json object but never free it.  This fix actually stops creating
the json object in this section of code and lets the create happen
in the area where the match occurs.

Ticket: CM-25616
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agoMerge pull request #4766 from donaldsharp/redist_small_fix
Mark Stapp [Fri, 2 Aug 2019 11:44:31 +0000 (07:44 -0400)]
Merge pull request #4766 from donaldsharp/redist_small_fix

zebra: Redistribution should be told about the old route

4 years agoospfd: clean up default route logic
David Lamparter [Mon, 29 Jul 2019 12:46:05 +0000 (14:46 +0200)]
ospfd: clean up default route logic

What a mess...

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoospfd: don't ASE with router-ID 0
David Lamparter [Mon, 29 Jul 2019 12:44:44 +0000 (14:44 +0200)]
ospfd: don't ASE with router-ID 0

The ASEs will be generated later by ospf_external_lsa_rid_change().

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoospfd: unset default route external_info
David Lamparter [Mon, 29 Jul 2019 10:43:46 +0000 (12:43 +0200)]
ospfd: unset default route external_info

Need to clear out the external_info for the "always" default route that
we installed in ospf_redistribute_default_set().

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoospfd: remove LSA reorigin on NSM change
David Lamparter [Mon, 29 Jul 2019 10:28:26 +0000 (12:28 +0200)]
ospfd: remove LSA reorigin on NSM change

This is a "workaround" for something broken in LSDB sync that has been
kept around since the beginning of our git history...

(It works correctly without this "workaround".)

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoospfd: re-fix default origination check
David Lamparter [Mon, 29 Jul 2019 12:44:26 +0000 (14:44 +0200)]
ospfd: re-fix default origination check

ospf->external[DEFAULT_ROUTE] and zclient->default_information don't
line up with each other; the former is only used for "originate always".

Fixes: #4237
Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoRevert "ospfd: default route got flushed after lsa refresh timer."
David Lamparter [Mon, 29 Jul 2019 12:04:06 +0000 (14:04 +0200)]
Revert "ospfd: default route got flushed after lsa refresh timer."

This reverts commit a6b4e1fdedb290e8d86f73b0d7f842f7042b26af.

This fix is wrong too.  The zclient->redist & ->mi_redist arrays are
accessed past their size for any external route that is not 0.0.0.0/0.
Also, it is incorrect to check default_information for DEFAULT_ROUTE
since that's "originate always".

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoRevert "ospfd: remove default origin max age lsa"
David Lamparter [Mon, 29 Jul 2019 10:32:32 +0000 (12:32 +0200)]
Revert "ospfd: remove default origin max age lsa"

This reverts commit 313919d6e3db67eedef77960ea4e2ba2a6018ee1.

This is not the correct way to fix this.

- touching the LSDB to explicitly remove a MaxAge LSA is always wrong
  and results in desynchronization of the entire routing domain
- the LSDB code correctly handles replacing a MaxAge LSA with a newly
  issued one
- removing the old LSA resets the sequence numbers, which may cause
  other routers to reject the new LSA as old
- the function was horribly misnamed

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoospfd: kill totally misnamed "timers"
David Lamparter [Mon, 29 Jul 2019 10:27:25 +0000 (12:27 +0200)]
ospfd: kill totally misnamed "timers"

Neither ospf_external_lsa_originate_timer() nor
ospf_default_originate_timer() are actually timers.  They're only
executed on router-ID changes to refresh a particular LSA type.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoospfd: remove t_external_lsa
David Lamparter [Mon, 29 Jul 2019 10:26:23 +0000 (12:26 +0200)]
ospfd: remove t_external_lsa

It's unused...

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #4713 from ton31337/fix/set_comm-list_delete_into_config_memcpy
Sri Mohana Singamsetty [Fri, 2 Aug 2019 04:19:43 +0000 (21:19 -0700)]
Merge pull request #4713 from ton31337/fix/set_comm-list_delete_into_config_memcpy

 bgpd: Strip `delete` keyword when looking up for communities

4 years agozebra: Redistribution should be told about the old route
Donald Sharp [Thu, 1 Aug 2019 23:09:59 +0000 (19:09 -0400)]
zebra: Redistribution should be told about the old route

When we are sending a redistribute_update, pass the old_re in
so that if we still have it around we can update the calling protocol.

Test:

router ospf
  redistribute sharp
!

sharp install route 4.5.6.7 nexthop 192.168.201.1 1

Now add a `ip route 4.5.6.7/32 192.168.201.1`.
This causes zebra to replace the sharp route with the static route.
No update is sent to ospf and debug:
2019/08/01 19:02:38.271998 ZEBRA: 0:4.5.6.7/32: Redist update re 0x12fdbda0 (static), old 0x0 (None)

With fix:

2019/08/01 19:15:09.644499 ZEBRA: 0:4.5.6.7/32: Redist update re 0x1ba5bce0 (static), old 0x1beea4e0 (sharp)
2019/08/01 19:15:09.645462 OSPF: ospf_zebra_read_route: from client sharp: vrf_id 0, p 4.5.6.7/32

Ticket: CM-25847
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoyang: simplify filter choice by removing cases
Rafael Zalamena [Thu, 1 Aug 2019 22:56:46 +0000 (19:56 -0300)]
yang: simplify filter choice by removing cases

Based on @rwestphal feedback, lets remove `case`s where we don't expect
to add more items or items with more than one `leaf`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoyang: use filter types in route-map
Rafael Zalamena [Thu, 25 Jul 2019 20:01:07 +0000 (17:01 -0300)]
yang: use filter types in route-map

Import the new YANG model filter and use its types.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoyang: initial filter YANG model import
Rafael Zalamena [Fri, 5 Jul 2019 14:07:30 +0000 (11:07 -0300)]
yang: initial filter YANG model import

This model contains the description of access-list, prefix-list and
other lists used by route map and other filtering interfaces.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoyang: initial route-map YANG model import
Rafael Zalamena [Tue, 2 Jul 2019 15:13:44 +0000 (12:13 -0300)]
yang: initial route-map YANG model import

New model based on FRR's CLI and data structures.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
4 years agoMerge pull request #4672 from abrahambinu83/ldp_label_release
Renato Westphal [Thu, 1 Aug 2019 22:05:12 +0000 (19:05 -0300)]
Merge pull request #4672 from abrahambinu83/ldp_label_release

ldpd: Fix to release MPLS label if its not used anymore

4 years agozebra: del auto mac when vni is down
Chirag Shah [Fri, 26 Jul 2019 21:57:59 +0000 (14:57 -0700)]
zebra: del auto mac when vni is down

Delete an auto MAC with no neighbor associated,
when its VNI is down.

In Following sequence stale MAC entry retained in
FRR (zebra).
- Local MAC-IP pair
- MAC is deleted in bridge fdb table
- VNI is down, triggers IP (neigh) entries removed
from FRR DB.
- MAC retained as AUTO MAC with neigh list count 0.
- When VNI is UP again, stale MAC entry retained in FRR
DB.
When the MAC-IP pair moves behind remote VTEP, local VTEP
fails to add remote entry as its MAC is in auto state.

Ticket:CM-25504
Reviewed By:
Testing Done:

Validated the sequence with fix and auto MAC is deleted
when VNI is down.
When VNI comes up, the remote MAC-IP is added to FRR (Zebra)
and kernel.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: add info evpn to debugs
Chirag Shah [Thu, 4 Jul 2019 00:03:15 +0000 (17:03 -0700)]
zebra: add info evpn to debugs

Add info info in local mac del debug,
the local sequence and assoicated neigh count.

remote_mac_ip_add modify debug to display
flags value to cover local, remote and auto flags
for the MAC.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoMerge pull request #4764 from donaldsharp/doc_v6_doc
Mark Stapp [Thu, 1 Aug 2019 18:50:12 +0000 (14:50 -0400)]
Merge pull request #4764 from donaldsharp/doc_v6_doc

doc: Add warning to doc about v6 ecmp route deletion

4 years agodoc: Add warning to doc about v6 ecmp route deletion
Donald Sharp [Thu, 1 Aug 2019 16:53:15 +0000 (12:53 -0400)]
doc: Add warning to doc about v6 ecmp route deletion

Add a warning to the user documentation about v6 ecmp route
deletion and what version of the linux kernel that you should
be using.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #4760 from chiragshah6/evpn_dev2
Mark Stapp [Thu, 1 Aug 2019 16:24:30 +0000 (12:24 -0400)]
Merge pull request #4760 from chiragshah6/evpn_dev2

zebra: fix evpn dad clear cmd mac parsing

4 years agoMerge pull request #4758 from donaldsharp/test_epoch
David Lamparter [Thu, 1 Aug 2019 15:07:43 +0000 (17:07 +0200)]
Merge pull request #4758 from donaldsharp/test_epoch

tests: Do not use peerUptime as a measure of if a clear worked

4 years agolib: remove pqueue_* (again)
David Lamparter [Thu, 31 Jan 2019 02:09:45 +0000 (03:09 +0100)]
lib: remove pqueue_* (again)

All users of the pqueue_* implementations have been migrated to use
some new data structure (TYPEDSKIP for ospf, HEAP for thread.c).

Remove.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib: use DECLARE_HEAP for timers instead of pqueue
David Lamparter [Thu, 31 Jan 2019 01:30:35 +0000 (02:30 +0100)]
lib: use DECLARE_HEAP for timers instead of pqueue

Replaces the use of pqueue_* for the thread_master's timer list with an
instance of DECLARE_HEAP_*.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agodoc: add a small FAQ for the typesafe datastructs
David Lamparter [Thu, 1 Aug 2019 14:54:18 +0000 (16:54 +0200)]
doc: add a small FAQ for the typesafe datastructs

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agoMerge pull request #4757 from donaldsharp/import_check_fixup
Renato Westphal [Thu, 1 Aug 2019 14:40:52 +0000 (11:40 -0300)]
Merge pull request #4757 from donaldsharp/import_check_fixup

Import check fixup

4 years agoMerge pull request #4723 from sworleys/List-Del-API
David Lamparter [Thu, 1 Aug 2019 14:31:09 +0000 (16:31 +0200)]
Merge pull request #4723 from sworleys/List-Del-API

List API add const and return object on `*_del`

4 years agoMerge pull request #4755 from donaldsharp/ospf_router_id_doc
Donatas Abraitis [Thu, 1 Aug 2019 07:30:59 +0000 (10:30 +0300)]
Merge pull request #4755 from donaldsharp/ospf_router_id_doc

doc: Fix ospf router-id doc suggestion

4 years agozebra: fix evpn dad clear cmd mac parsing
Chirag Shah [Wed, 31 Jul 2019 01:58:44 +0000 (18:58 -0700)]
zebra: fix evpn dad clear cmd mac parsing

The changes came as part of PR #4730, checks
only variable mac, which is never null. Even
for ip version of cli hits "mac" case statement
and failing the clear cli.

Testing Done:

Before Fix:

VTEP-03# show evpn arp-cache vni 1002 duplicate
VNI 1002 #ARP (IPv4 and IPv6, local and remote) 1

IP                        Type   State    MAC               Remote VTEP
Seq #'s
11.11.11.11               remote active   aa:22:aa:aa:aa:aa 27.0.0.16
7/8

VTEP-03# clear evpn dup-addr vni 1002 ip 11.11.11.11
% Requested MAC does not exist in VNI 1002

Post fix:

VTEP-03# clear evpn dup-addr vni 1002 ip 11.11.11.11
VTEP-03#

VTEP-03# show evpn mac vni all duplicat
VNI 1002 #MACs (local and remote) 1

MAC               Type   Intf/Remote VTEP      VLAN  Seq #'s
aa:aa:aa:aa:aa:aa remote 27.0.0.16                   7/8

Post fix:

VTEP-03# clear evpn dup-addr vni 1002 mac aa:aa:aa:aa:aa:aa
VTEP-03#

VTEP-03# clear evpn dup-addr vni 1002 ip 11.11.11.11
VTEP-03#

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoMerge pull request #4690 from donaldsharp/staticstuff
Mark Stapp [Wed, 31 Jul 2019 18:38:00 +0000 (14:38 -0400)]
Merge pull request #4690 from donaldsharp/staticstuff

Improve staticd handling of nexthops and nht to improve scale

4 years agoMerge pull request #4754 from opensourcerouting/gen-northbound-improvements
Donald Sharp [Wed, 31 Jul 2019 18:28:45 +0000 (14:28 -0400)]
Merge pull request #4754 from opensourcerouting/gen-northbound-improvements

tools: improve gen_northbound_callbacks

4 years agotests: Do not use peerUptime as a measure of if a clear worked
Donald Sharp [Wed, 31 Jul 2019 16:29:32 +0000 (12:29 -0400)]
tests: Do not use peerUptime as a measure of if a clear worked

The peerUptime data received from a `show bgp ipv4 uni summ json`
gives you the time in seconds since the peer has come up.
The clear_bgp_and_verify function is checking the peerUptime
for before and after and if they are the same then the test
was declaring a clear failure.

The problem with this is of course that the tests can run fast
enough that the peerUptime is the same for before and after the clear.

Modify the test case to use peerUptimeEstablishedEpoch.
This value is the seconds since the epoch since the establishment
of the peer.  This will allow us to know that a clear happened.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: Add const to _count() in new list APIs
Stephen Worley [Wed, 31 Jul 2019 00:26:31 +0000 (20:26 -0400)]
lib: Add const to _count() in new list APIs

Add const to the datastructure being passed to the new list APIs
for the `_count()` calls.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Add identifiers to RB declarations
Stephen Worley [Wed, 24 Jul 2019 15:37:08 +0000 (11:37 -0400)]
lib: Add identifiers to RB declarations

Checkpatch was complaining about the lack of identifiers here, so
added some.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agotests: Add asserts to check return on list *_del
Stephen Worley [Tue, 23 Jul 2019 20:33:48 +0000 (16:33 -0400)]
tests: Add asserts to check return on list *_del

Add some asserts where `list_del()` is called to verify they object
was found when it was deleted.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agolib: Impelement the `*_del` list API.
Stephen Worley [Tue, 23 Jul 2019 16:23:25 +0000 (12:23 -0400)]
lib: Impelement the `*_del` list API.

The new list api did not implement the `*_del` endpoint as
it was described in the docs here:

http://docs.frrouting.org/projects/dev-guide/en/latest/lists.html#c.Z_del

This patch implements the endpoints to return the object deleted if
found, otherwise NULL for all but the atomic lists.

The atomic list `*_del` code is marked as TODO and will remain undefined
for now.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Fix display of `show ip import-check A.B.C.D`
Donald Sharp [Wed, 31 Jul 2019 15:07:58 +0000 (11:07 -0400)]
zebra: Fix display of `show ip import-check A.B.C.D`

The 'show ip import-check A.B.C.D` code was generating
a /32 prefix for comparison.  Except import-check was
being used by bgp to track networks.  So they could
have received a /24( or anything the `network A.B.C.D/M`
statement specifies ).

Consequently when we do a `show ip import-check A.B.C.D`
we would never find the network but a `show ip import-check |
grep A.B.C.D` would find it.

Fix the exact comparison to a match.

For the `show ip nht A.B.C.D` case we are comparing
a /32 to a /32 so prefix_match will work still.
While a `show ip import-check A.B.C.D` will now show
the expected behavior as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agodoc: Update documentation to reflect new `sharp watch import` changes
Donald Sharp [Wed, 31 Jul 2019 14:50:24 +0000 (10:50 -0400)]
doc: Update documentation to reflect new `sharp watch import` changes

Update the documentation to reflect the reality on the ground.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agosharpd: Update 'sharp watch import` to allow prefix
Donald Sharp [Wed, 31 Jul 2019 14:47:46 +0000 (10:47 -0400)]
sharpd: Update 'sharp watch import` to allow prefix

Instead of defaulting the import-check to a /32
allow the tester to specify any prefix that they want
when doing an import-check.

Test:

donna.cumulusnetworks.com# sharp watch import
  A.B.C.D/M   The v4 prefix for import check to watch
  X:X::X:X/M  The v6 prefix to signal for watching
donna.cumulusnetworks.com# sharp watch import 4.5.6.0/24
donna.cumulusnetworks.com# show ip import-check
4.5.6.0
 resolved via kernel
 via 10.50.11.1, enp0s3
 Client list: sharp(fd 21)
donna.cumulusnetworks.com# sharp watch import 4:5:6::0/64
donna.cumulusnetworks.com# show ipv6 import-check
4:5:6::
 resolved via kernel
 fe80::cad7:19ff:fe0a:fdfd, via enp0s3
 fe80::ce37:abff:fe4f:a601, via enp0s3
 Client list: sharp(fd 21)
donna.cumulusnetworks.com# sharp watch nexthop
  A.B.C.D   The v4 address to signal for watching
  X:X::X:X  The v6 nexthop to signal for watching
donna.cumulusnetworks.com# sharp watch nexthop 4.5.6.7
donna.cumulusnetworks.com# sharp watch nexthop 4:5::6:7
donna.cumulusnetworks.com# show ip nht
4.5.6.7
 unresolved
 Client list: sharp(fd 21)
donna.cumulusnetworks.com# show ipv6 nht
4:5::6:7
 unresolved
 Client list: sharp(fd 21)

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #4756 from vincentbernat/fix/doc-aspath
Donald Sharp [Wed, 31 Jul 2019 14:45:35 +0000 (10:45 -0400)]
Merge pull request #4756 from vincentbernat/fix/doc-aspath

doc: fix "match as-path" documentation

4 years agodoc: fix "match as-path" documentation
Vincent Bernat [Wed, 31 Jul 2019 14:40:02 +0000 (16:40 +0200)]
doc: fix "match as-path" documentation

The documentation says "match aspath" to match an AS path in a
route-map while the directive is "match as-path".

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
4 years agolib: RCU
David Lamparter [Sun, 2 Apr 2017 22:51:20 +0000 (00:51 +0200)]
lib: RCU

Please refer to doc/developer/rcu.rst for documentation.

Signed-off-by: David Lamparter <equinox@diac24.net>
4 years agolib/seqlock: add a few more comments
David Lamparter [Tue, 25 Jun 2019 18:33:02 +0000 (20:33 +0200)]
lib/seqlock: add a few more comments

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agolib/seqlock: add timed-wait operation
David Lamparter [Wed, 19 Jun 2019 10:52:38 +0000 (12:52 +0200)]
lib/seqlock: add timed-wait operation

seqlock_timedwait() puts an (absolute, CLOCK_MONOTONIC) deadline on how
long we wait.  The RCU code uses this for its watchdog implementation.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agolib/seqlock: avoid syscalls in no-waiter cases
David Lamparter [Wed, 19 Jun 2019 10:52:38 +0000 (12:52 +0200)]
lib/seqlock: avoid syscalls in no-waiter cases

When we have no contention on the seqlock, we shouldn't incur the cost
of syscalls.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
4 years agolib: make SA_SIGINFO use unconditional
David Lamparter [Fri, 21 Jun 2019 05:45:50 +0000 (07:45 +0200)]
lib: make SA_SIGINFO use unconditional

This has been in POSIX for ages & there's no OS left that doesn't
support this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>