]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agoMerge pull request #2897 from donaldsharp/zebra_rnh_fixup
Renato Westphal [Sat, 25 Aug 2018 22:57:58 +0000 (19:57 -0300)]
Merge pull request #2897 from donaldsharp/zebra_rnh_fixup

zebra: When registering a nexthop, we do not always need to re-eval

5 years agoMerge pull request #2895 from donaldsharp/netlink_encap
Renato Westphal [Sat, 25 Aug 2018 22:35:52 +0000 (19:35 -0300)]
Merge pull request #2895 from donaldsharp/netlink_encap

zebra: Add support for static encap mpls labels

5 years agozebra: Add support for static encap mpls labels
Stephen Worley [Sat, 11 Aug 2018 22:36:22 +0000 (18:36 -0400)]
zebra: Add support for static encap mpls labels

We were ignoring mpls labels encapped with static routes.
Added support for single and multipath labels.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agostaticd: refcount the nht add/removal
Donald Sharp [Sat, 25 Aug 2018 00:42:45 +0000 (20:42 -0400)]
staticd: refcount the nht add/removal

When we add / remove a nexthop that we need to track,
keep track of the number of times we have done this
for each nexthop.  Consequently keep track of the
number of available nexthops, so that we can
just install new routes when we get one
that uses a pre-existing nexthop.  Deletion of
nexthops is done on refcount going to 0.
Removal of routes is handled elsewhere for removal.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: When registering a nexthop, we do not always need to re-eval
Donald Sharp [Thu, 23 Aug 2018 20:05:02 +0000 (16:05 -0400)]
zebra: When registering a nexthop, we do not always need to re-eval

The code prior to this change, was allowing clients to register
for nexthop tracking.  Then zebra would look up the rnh and
send to that particular client any known data.  Additionally
zebra was blindly re-evaluating the rnh for every registration.

This leads to interesting behavior in that all people registered
for that nexthop will get callbacks even if nothing changes.

Modify the code to know if we have evaluated the rnh or not
and if so limit the re-evaluation to when absolutely necessary

This is of particular importance to do because of nht callbacks
for protocols cause those protocols to do not insignificant
work and as more protocols are registering for nht callbacks
we will cause more work than is necessary.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #2910 from opensourcerouting/doc-summerclean-20180825
Donald Sharp [Sat, 25 Aug 2018 10:35:14 +0000 (06:35 -0400)]
Merge pull request #2910 from opensourcerouting/doc-summerclean-20180825

protocol vs. OS docs + SMUX leftovers

5 years agoMerge pull request #2911 from opensourcerouting/remove-linux24-tcp-md5
Donald Sharp [Sat, 25 Aug 2018 10:35:02 +0000 (06:35 -0400)]
Merge pull request #2911 from opensourcerouting/remove-linux24-tcp-md5

lib: remove Linux 2.4 TCP-MD5 support

5 years agolib: remove Linux 2.4 TCP-MD5 support
David Lamparter [Sat, 25 Aug 2018 00:54:38 +0000 (02:54 +0200)]
lib: remove Linux 2.4 TCP-MD5 support

Linux 2.6.0 was released in December of 2003... I'm pretty sure we don't
need this Linux 2.4 support anymore.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobuild: drop unused SMUX client OID MIBs
David Lamparter [Sat, 25 Aug 2018 00:21:10 +0000 (02:21 +0200)]
build: drop unused SMUX client OID MIBs

These MIB OIDs were only used to identify clients on the SMUX protocol.
And even for that, they were essentially pointless.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #2870 from AnuradhaKaruppiah/bgp-default-del
Russ White [Sat, 25 Aug 2018 00:19:17 +0000 (20:19 -0400)]
Merge pull request #2870 from AnuradhaKaruppiah/bgp-default-del

bgpd: unregister VNI learning from zebra on default instance delete

5 years agoMerge pull request #2908 from chiragshah6/ospf_vrf_dev
Russ White [Sat, 25 Aug 2018 00:17:16 +0000 (20:17 -0400)]
Merge pull request #2908 from chiragshah6/ospf_vrf_dev

ospfd: interface speed change during intf add

5 years agodoc/user: drop SMUX reference, rework intro
David Lamparter [Sat, 25 Aug 2018 00:16:59 +0000 (02:16 +0200)]
doc/user: drop SMUX reference, rework intro

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agodoc/user: add protocols vs. platform table
David Lamparter [Sat, 25 Aug 2018 00:12:42 +0000 (02:12 +0200)]
doc/user: add protocols vs. platform table

A nicely-formatted colorful table of all our daemons and target OS'.
Based off & intended to replace / extend
https://github.com/FRRouting/frr/wiki/Features-and-Kernel-Support

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #2685 from netravnen/feature/bgpd/documen-use-of-additional-bgp...
Quentin Young [Fri, 24 Aug 2018 23:05:09 +0000 (19:05 -0400)]
Merge pull request #2685 from netravnen/feature/bgpd/documen-use-of-additional-bgp-well-known-communities

Document bgp well-known communities in PR2684

5 years agoospfd: interface speed change during intf add
Chirag Shah [Fri, 24 Aug 2018 22:15:36 +0000 (15:15 -0700)]
ospfd: interface speed change during intf add

The problem is seen where speed mismatch caused ECMP route
not being reflected with correct number paths (NHs).

During cold boot, some interface speed updated by zebra as
part of one shot timer and triggers interface add to clients.
In this case, ospf already have created interface (bond interface),
but speed was not updated, trigger to do interface speed change
as part of interface add, which will trigger all Router LSA to
use updated speed into cost calculation.

Ticket:CM-22170
Testing Done:
Bring up CLOS config with Spine and leafs. Leaf have CLAG pair,
with same VRR ip address.
At spine one of the bond connecting to leaf node was having
higher speed than the paired device, With this fix, at spine (DUT)
bond interface speed is equal from all peer nodes.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agobgp: Add documentation for IANA well-known communities
Christoffer [Fri, 24 Aug 2018 21:57:42 +0000 (23:57 +0200)]
bgp: Add documentation for IANA well-known communities

Coded as part of #2684 and most code written while participating at
BornHack@2018.

bgp_route.c: Changes regarding adding explanations for the IANA
well-known communities added in #2684

Signed-off-by: Christoffer <netravnen@gmail.com>
5 years agodoc: Add documentation for IANA well-known communities
Christoffer [Wed, 22 Aug 2018 23:46:37 +0000 (01:46 +0200)]
doc: Add documentation for IANA well-known communities

Coded as part of #2684 and most code written while participating at
BornHack@2018.

bgp.rst: Explain what the communities does and a summarized edition of
the communities purpose.

Signed-off-by: Christoffer <netravnen@gmail.com>
5 years agoMerge pull request #2891 from opensourcerouting/logging-docs
Quentin Young [Fri, 24 Aug 2018 20:29:46 +0000 (16:29 -0400)]
Merge pull request #2891 from opensourcerouting/logging-docs

doc/developer: logging guide

5 years agoMerge pull request #2907 from donaldsharp/fix_confdate
David Lamparter [Fri, 24 Aug 2018 20:07:55 +0000 (22:07 +0200)]
Merge pull request #2907 from donaldsharp/fix_confdate

bgpd: Fix CONFDATE to 2019 for a couple of items.

5 years agobgpd: Fix CONFDATE to 2019 for a couple of items.
Donald Sharp [Fri, 24 Aug 2018 19:21:04 +0000 (15:21 -0400)]
bgpd: Fix CONFDATE to 2019 for a couple of items.

While perusing CONFDATE I noticed that we had a couple
CONFDATE 201805, which we were not picking up( for other
reasons and fixed in a different PR ).  But upon investigation
of these I noticed that the commits where in 201805, so these
CONFDATES should be in 2019

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #2901 from donaldsharp/remove_zapi_deprecated
David Lamparter [Fri, 24 Aug 2018 17:41:17 +0000 (19:41 +0200)]
Merge pull request #2901 from donaldsharp/remove_zapi_deprecated

Remove zapi deprecated

5 years agodoc, lib, zebra: Remove deprecated encode and decode functionality
Donald Sharp [Fri, 24 Aug 2018 14:56:15 +0000 (10:56 -0400)]
doc, lib, zebra: Remove deprecated encode and decode functionality

The ZEBRA_IPV4_ROUTE_[ADD|DELETE] and ZEBRA_IPV6_ROUTE_[ADD|DELETE] functionality
has been deprecated for a year now, let's remove this code from the system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Remove unmaintained and uncompilable code
Donald Sharp [Fri, 24 Aug 2018 14:49:20 +0000 (10:49 -0400)]
zebra: Remove unmaintained and uncompilable code

The zebra/client_main.c code is not being maintained or used.
Remove from system.  Especially since the encode/decode
zapi functionality it `purports` to be testing is deprecated
and now being removed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #2804 from kssoman/bgp_fix
Donald Sharp [Fri, 24 Aug 2018 11:46:22 +0000 (07:46 -0400)]
Merge pull request #2804 from kssoman/bgp_fix

When redistribute options are changed, call bgp_redistribute_unreg()

5 years agoMerge pull request #2896 from dslicenc/zebra_select_vrf
David Lamparter [Fri, 24 Aug 2018 02:19:02 +0000 (04:19 +0200)]
Merge pull request #2896 from dslicenc/zebra_select_vrf

zebra: if multiple connecteds, select loopback or vrf if present

5 years agozebra: if multiple connecteds, select loopback or vrf if present
Don Slice [Tue, 21 Aug 2018 18:03:00 +0000 (18:03 +0000)]
zebra: if multiple connecteds, select loopback or vrf if present

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoMerge pull request #2893 from qlyoung/fix-rpki-exit-failure
David Lamparter [Thu, 23 Aug 2018 17:50:18 +0000 (19:50 +0200)]
Merge pull request #2893 from qlyoung/fix-rpki-exit-failure

bgpd: fix rpki exit command

5 years agoMerge pull request #2854 from chiragshah6/evpn_dev1
David Lamparter [Thu, 23 Aug 2018 16:21:18 +0000 (18:21 +0200)]
Merge pull request #2854 from chiragshah6/evpn_dev1

zebra: Evpn mark router flag as part of neighbor update from kernel

(Merge in proxy reliant on @srimohans' review.)

5 years agobgpd: fix rpki exit command
Quentin Young [Wed, 22 Aug 2018 20:05:04 +0000 (20:05 +0000)]
bgpd: fix rpki exit command

If a command returns a nonzero exit status and VTYSH has a corresponding
command, VTYSH will skip executing its own version. If this happens in a
command that changes CLI nodes we get node desynchronization.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #2894 from donaldsharp/thread_stuff
David Lamparter [Thu, 23 Aug 2018 16:08:59 +0000 (18:08 +0200)]
Merge pull request #2894 from donaldsharp/thread_stuff

Thread stuff

5 years agoMerge pull request #2855 from donaldsharp/bgp_tough
David Lamparter [Thu, 23 Aug 2018 16:04:12 +0000 (18:04 +0200)]
Merge pull request #2855 from donaldsharp/bgp_tough

Various Cleanups

5 years agoMerge pull request #2677 from rtrlib/2018-07-18-master-bugfix
Quentin Young [Thu, 23 Aug 2018 15:05:00 +0000 (11:05 -0400)]
Merge pull request #2677 from rtrlib/2018-07-18-master-bugfix

bgpd: rpki bugfixes

5 years agolib: Limit depth of unused thread list
Donald Sharp [Thu, 23 Aug 2018 00:59:46 +0000 (20:59 -0400)]
lib: Limit depth of unused thread list

The master->unused list was unbounded during normal operation.
A full BGP feed on my machine left 11k threads on the unused
list, taking up over 2mb of data.  This seemed a bit excessive,
reduce to a limit of 10.

Also fix a crash that this exposed where we assumed that a thread
structure was not deleted.

Future committers can make this configurable? or modify
the value to something better for their system.  I am
dubious of the value of this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Convert debug to error situation
Donald Sharp [Mon, 20 Aug 2018 12:08:28 +0000 (08:08 -0400)]
lib: Convert debug to error situation

This debug should be moved to an error situation since it's a
developmental escape that needs to be fixed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Remove default case statement from a enum driven switch
Donald Sharp [Thu, 16 Aug 2018 17:59:27 +0000 (13:59 -0400)]
lib: Remove default case statement from a enum driven switch

We are using a enum to drive a switch statement and we have
a default case statement that can never be entered because
we know all the enum states have been covered.  Remove it
from the code as that it cannot happen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Remove zlog_warn from some places in buffer.c
Donald Sharp [Thu, 16 Aug 2018 17:56:44 +0000 (13:56 -0400)]
lib: Remove zlog_warn from some places in buffer.c

zlog_warn was being used to inform user of impossible situations
or for normal operations.  Remove these from the code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Remove smux option for snmp
Donald Sharp [Thu, 16 Aug 2018 17:51:13 +0000 (13:51 -0400)]
lib: Remove smux option for snmp

The smux.c code has not been able to compile for 2+ years
and no-one has noticed. Additionally net-snmp has marked
smux integration as deprecated for quite some time as well.

Since no-one has noticed and it's been broken and smux integration
is deprecated let's just remove this from the code base.

From looking at the code, it sure looks like SNMP could use
a decent cleanup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: convert zlog_warns to debugs or errors
Donald Sharp [Thu, 16 Aug 2018 16:21:25 +0000 (12:21 -0400)]
bgpd: convert zlog_warns to debugs or errors

Several zlog_warns were being used to tell the end
user that bgp had detected a bug.  These all look like information
added during development that can be noted as debugs or logged
as an error situation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Remove warn to file an issue
Donald Sharp [Wed, 15 Aug 2018 18:53:51 +0000 (14:53 -0400)]
bgpd: Remove warn to file an issue

A warn with a backtrace does not need another warn
to file an issue with Quagga, so just remove it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Seperate out Poll data from thread memory statistics
Donald Sharp [Thu, 23 Aug 2018 01:05:29 +0000 (21:05 -0400)]
lib: Seperate out Poll data from thread memory statistics

We were storing Poll data for the read and write
memory information in MTYPE_THREAD, so a show run
would not be able to show actual amount of memory
associated with the `struct thread`.

Remove unnecessary NULL checks on malloc.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #2762 from chiragshah6/evpn_dev
Russ White [Wed, 22 Aug 2018 23:50:18 +0000 (19:50 -0400)]
Merge pull request #2762 from chiragshah6/evpn_dev

bgpd: check existing l3vni for any l2vni creation

5 years agozebra: mark router flag for remote neigh update
Chirag Shah [Fri, 17 Aug 2018 20:38:06 +0000 (13:38 -0700)]
zebra: mark router flag for remote neigh update

Handle Remote Neigh entry state change from Router to Host.

Remote MAC-IP update may not continue EVPN NA Extended community,
Zebra need to accomodate if router_flag change for existing neigh
and install with or without Router Flag (R-bit).

Testing:
Have locally run MAC/IP (neigh entry) with R-bit set,
Checke on remote VTEP 'show bgp evpn route ...mac ip' and
'show evpn arp-cache ...' contians router flag.

Change host to remove R-bit, which locally learnt entry removes
Router flag. This results in remote vtep to remove R-bit from
neigh entry.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agozebra: check router_flag change for neigh update
Chirag Shah [Wed, 15 Aug 2018 20:32:03 +0000 (13:32 -0700)]
zebra: check router_flag change for neigh update

Neigh update can have router_flag change, from unset to set and
viceversa. This is the case where MAC, IP and VLAN are same but
entry's flag moved from R to not R bit and reverse case.

Router flag change needs to trigger bgpd to inform all evpn peers
to remove from the evpn route.

Testing Done:
Send GARP with and without R bit from host and validate neigh entry
and evpn neigh and  mac-ip route entry in zebra and bgpd.

Check Peer VTEP evpn route entry where router flag is (un)set.
With R-bit

Route [2]:[0]:[0]:[48]:[00:1f:2f:db:45:a6]:[128]:[2006:33:33:2::10]
VNI 1001
Imported from
27.0.0.16:5:[2]:[0]:[0]:[48]:[00:1f:2f:db:45:a6]:[128]:[2006:33:33:2::10]
   4435 5551
27.0.0.16 from MSP1(uplink-1) (27.0.0.9)
   Origin IGP, valid, external, bestpath-from-AS 4435, best
   Extended Community: RT:5551:1001 ET:8 ND:Router
   Flag
   AddPath ID: RX 0, TX 1261
   Last update: Wed Aug 15 20:52:14 2018

Without R-bit

Route [2]:[0]:[0]:[48]:[00:1f:2f:db:45:a6]:[128]:[2006:33:33:2::10]
VNI 1001
Imported from
27.0.0.16:5:[2]:[0]:[0]:[48]:[00:1f:2f:db:45:a6]:[128]:[2006:33:33:2::10]
   4435 5551
27.0.0.16 from MSP2(uplink-2) (27.0.0.10)
   Origin IGP, valid, external, bestpath-from-AS 4435, best
   Extended Community: RT:5551:1001 ET:8
   AddPath ID: RX 0, TX 1263
   Last update: Wed Aug 15 20:53:10 2018

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agozebra: mark router flag for neigh update
Chirag Shah [Tue, 14 Aug 2018 00:07:22 +0000 (17:07 -0700)]
zebra: mark router flag for neigh update

The neigh update can come prior to mac add update.
In this case, the mac will be auto created for the vni.
set router flag to local neigh update for mac with auto flag.

The neigh update will be informed to bgpd once local mac is learnt.

Unset router flag if the neigh update comes without the router flag
for an existing neigh entry.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agobgpd: check existing l3vni for any l2vni creation
Chirag Shah [Wed, 1 Aug 2018 01:45:39 +0000 (18:45 -0700)]
bgpd: check existing l3vni for any l2vni creation

Scan all bgp vrf instances and respective L3VNI against the VNI which is being configured.

Ticket:CM-21859
Testing Done:
Configure l3vni,
try to configure same vni as l2vni under router bgp, address-family
l2vpn evpn.
The configuration is rejected.

show evpn vni
VNI        Type VxLAN IF              # MACs   # ARPs   # Remote VTEPs Tenant VRF
4001       L3   vx-4001               0        0        n/a vrf1

TOR(config)# router bgp 5546
TOR(config-router)# address-family l2vpn evpn
TOR(config-router-af)# vni 4001
% Failed to create VNI

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #2886 from donaldsharp/stream_resize
Russ White [Wed, 22 Aug 2018 20:04:37 +0000 (16:04 -0400)]
Merge pull request #2886 from donaldsharp/stream_resize

Stream resize

5 years agoMerge pull request #2892 from qlyoung/fix-log-ref-number-signedness
David Lamparter [Wed, 22 Aug 2018 19:21:40 +0000 (21:21 +0200)]
Merge pull request #2892 from qlyoung/fix-log-ref-number-signedness

lib: error codes are uint32_t's

5 years agolib: error codes are uint32_t's
Quentin Young [Wed, 22 Aug 2018 17:27:28 +0000 (17:27 +0000)]
lib: error codes are uint32_t's

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #2890 from patrasar/Fix_2847
Donald Sharp [Wed, 22 Aug 2018 16:26:28 +0000 (12:26 -0400)]
Merge pull request #2890 from patrasar/Fix_2847

bgpd: Fix memory leak show ip bgp json

5 years agobgpd: Fix memory leak show ip bgp json
root [Wed, 22 Aug 2018 23:08:26 +0000 (16:08 -0700)]
bgpd: Fix memory leak show ip bgp json

Root Cause: In the function bgp_show_table(), we are creating a
json object and a json array with the same name as “json_paths”.
First it will create a json object variable "json_paths" pointing
to the memory allocated for the json object. Then it will create
a json array for each bap node rn (if rn->info is available) with
the same name as json_paths. Because of this, json_paths which was
pointing to the memory allocated for the json object earlier, now
will be overwritten with the memory allocated for the json array.
As per the existing code, at the end of each iteration loop of bgp
node, it will deallocate the memory used by the json array and
assigned NULL to the variable json_paths. Since we don’t have the
pointer pointing to the memory allocated for json object, will be
not able to de-allocate the memory, which is a memory leak here.

Fix: Removing this json object since it is never getting used in
this function.

Testing:  Reproduced the memory leak with valgrind.
With the fix, memory leak gets resolved and checked with valgrind.

Signed-off-by: Sarita Patra saritap@vmware.com
5 years agoMerge pull request #2850 from patrasar/Fix_2363
Donald Sharp [Wed, 22 Aug 2018 15:44:15 +0000 (11:44 -0400)]
Merge pull request #2850 from patrasar/Fix_2363

Fix pim_mroute_del crash while killing pimd

5 years agodoc/developer: logging guide
David Lamparter [Wed, 22 Aug 2018 15:39:12 +0000 (17:39 +0200)]
doc/developer: logging guide

This roughly outlines when to use which logging function.  It's
certainly something to have to point people to, so they get things nice
and right - and so we get at least somewhat consistent behaviour for the
user.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobgpd: use correct bgp tables for rpki revalidation
Marcel Röthke [Thu, 19 Jul 2018 15:58:05 +0000 (17:58 +0200)]
bgpd: use correct bgp tables for rpki revalidation

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
5 years agobgpd: fix wrong allocation size in rpki route map
Marcel Röthke [Thu, 19 Jul 2018 15:57:40 +0000 (17:57 +0200)]
bgpd: fix wrong allocation size in rpki route map

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
5 years agobgpd: fix deadlock in rpki code
Marcel Röthke [Wed, 18 Jul 2018 13:41:34 +0000 (15:41 +0200)]
bgpd: fix deadlock in rpki code

In some situations rtrlib does not release the locks for its internal
data structures before calling a callback. This can lead to deadlocks
when a lot of routes must be revalidated because the sync socket buffer
will fill up and block the rtrlib thread. The bgpd main thread then
waits for rtrlibs internal locks to be released indefinitely.

This is fixed by using nonblocking sockets instead of blocking ones and
setting a flag to revalidate everything, if it would block.

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
5 years agoMerge pull request #2884 from opensourcerouting/assorted-20180821
Donald Sharp [Wed, 22 Aug 2018 12:17:32 +0000 (08:17 -0400)]
Merge pull request #2884 from opensourcerouting/assorted-20180821

assorted warning fixes

5 years agobgpd : Change of options in redistribute command does not get applied
kssoman [Wed, 22 Aug 2018 12:00:15 +0000 (05:00 -0700)]
bgpd : Change of options in redistribute command does not get applied

* Added parameter in bgp_redistribute_set() to indicate change
  in redistribute option
* If there is change, call bgp_redistribute_unreg() to withdraw routes

Signed-off-by: kssoman <somanks@vmware.com>
5 years agolib: Convert stream_new to use one malloc
Donald Sharp [Wed, 22 Aug 2018 00:34:42 +0000 (20:34 -0400)]
lib: Convert stream_new to use one malloc

Modify stream.c to have stream_new call one malloc call
instead of two.  Also change stream_resize_orig to
use stream_resize_inplace and to send an error
to the developer to switch over.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoisisd, ospfd, tests: Switch to using stream_resize_inplace
Donald Sharp [Wed, 22 Aug 2018 00:22:28 +0000 (20:22 -0400)]
isisd, ospfd, tests: Switch to using stream_resize_inplace

Switch code and tests to use new stream_resize_inplace functionality.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Add stream_resize_orig and stream_resize_inplace
Donald Sharp [Wed, 22 Aug 2018 00:06:27 +0000 (20:06 -0400)]
lib: Add stream_resize_orig and stream_resize_inplace

Start setup for handling of stream_resize into old
and new functions.

Create a stream_resize_inplace function that takes
a double pointer to allow for a realloc operation
to return the possibly moved pointer.

Add a CONFDATE for removal as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #2818 from kssoman/rmap_fix
Donald Sharp [Wed, 22 Aug 2018 11:50:14 +0000 (07:50 -0400)]
Merge pull request #2818 from kssoman/rmap_fix

Zebra does not properly track which route-maps are changed (#2493)

5 years agoMerge pull request #2888 from pguibert6WIND/misc_fix_static_tableid
Donald Sharp [Wed, 22 Aug 2018 11:40:14 +0000 (07:40 -0400)]
Merge pull request #2888 from pguibert6WIND/misc_fix_static_tableid

Misc fix static tableid

5 years agostatic: remove useless debug variable
Philippe Guibert [Wed, 22 Aug 2018 08:04:49 +0000 (10:04 +0200)]
static: remove useless debug variable

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agostaticd: do not forget to set table id marker on zebra message
Philippe Guibert [Wed, 22 Aug 2018 08:04:06 +0000 (10:04 +0200)]
staticd: do not forget to set table id marker on zebra message

Table identifier is not read if table id marker is not set.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agostaticd: remove usage of vrf_is_backend_netns in staticd
Philippe Guibert [Wed, 22 Aug 2018 07:19:50 +0000 (09:19 +0200)]
staticd: remove usage of vrf_is_backend_netns in staticd

this function had to be used only inside zebra ( this was written in the
header vrf.h). To keep the functionality, a more generic API is used.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agolib: change vrf_is_mapped_on_netns API
Philippe Guibert [Wed, 22 Aug 2018 07:19:04 +0000 (09:19 +0200)]
lib: change vrf_is_mapped_on_netns API

The function handles not a vrf pointer instead of a vrf_id value.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agopimd: Fix pim_mroute_del crash while terminating pimd
root [Wed, 22 Aug 2018 07:00:32 +0000 (00:00 -0700)]
pimd: Fix pim_mroute_del crash while terminating pimd

When pimd is getting terminated, pim_upstream_del() gets called as
part of cleaning process. pim_upstream_del() deletes the route and
assigns NULL to the up->channel_oil. It also deletes each if_channel
by calling the function pim_ifchannel_delete().
pim_ifchannel_delete() internally calls the caller function pim_upstream_del(),
if it is the last ifchannel for that upstream. So pim_upstream_del
is getting called twice, which will access the up->channel_oil which
was already set to NULL before. This results in crash.

Fix:
pim_ifchannel_delete() should call pim_upstream_del (caller function)
only if the up->ref_count > 0. Added an assert(up->ref_count > 0) in
the function pim_upstream_del().

Signed-off-by: Sarita Patra <saritap@vmware.com>
5 years agolib/bgpd: re-fix bgp_info_extra_free()
David Lamparter [Sat, 18 Aug 2018 02:47:27 +0000 (04:47 +0200)]
lib/bgpd: re-fix bgp_info_extra_free()

Make the wart slightly less bad... also there is still a possible write
after free here.  This needs to be fixed again, properly, by some
structure changes.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #2868 from opensourcerouting/snap-rpki
Donald Sharp [Tue, 21 Aug 2018 22:49:24 +0000 (18:49 -0400)]
Merge pull request #2868 from opensourcerouting/snap-rpki

snapcraft: Add RPKI to snap package

5 years agoMerge pull request #2877 from pguibert6WIND/fixup_fs_master
Donald Sharp [Tue, 21 Aug 2018 22:46:42 +0000 (18:46 -0400)]
Merge pull request #2877 from pguibert6WIND/fixup_fs_master

bgpd: avoid memory leak in bgp flowspec list, plus usage of bool

5 years agoMerge pull request #2876 from donaldsharp/lsa_new_and_data
David Lamparter [Tue, 21 Aug 2018 19:22:45 +0000 (21:22 +0200)]
Merge pull request #2876 from donaldsharp/lsa_new_and_data

ospfd: Add ospf_lsa_new_and_data function and abstract away

5 years agoMerge pull request #2882 from qlyoung/fix-zlog-deadlock
David Lamparter [Tue, 21 Aug 2018 19:21:28 +0000 (21:21 +0200)]
Merge pull request #2882 from qlyoung/fix-zlog-deadlock

lib: fix deadlock in log.c

5 years ago*: fix gcc-8 format-overflow warnings
David Lamparter [Sat, 18 Aug 2018 02:33:38 +0000 (04:33 +0200)]
*: fix gcc-8 format-overflow warnings

e.g.
pimd/pim_oil.c: In function ‘pim_channel_oil_dump’:
pimd/pim_oil.c:51:19: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=]

Build on gcc-8.2.0 is warning-free after this patch.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobuild: wrap "fallthrough" attr
David Lamparter [Wed, 15 Aug 2018 03:49:29 +0000 (05:49 +0200)]
build: wrap "fallthrough" attr

This generates a warning on gcc versions before 7.0.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobgpd: pbr entry log message changed to zlog_debug
Philippe Guibert [Tue, 21 Aug 2018 08:43:33 +0000 (10:43 +0200)]
bgpd: pbr entry log message changed to zlog_debug

pbr entry log message changed to zlog_debug.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: simplify fs add pbr entry
Philippe Guibert [Tue, 21 Aug 2018 08:38:27 +0000 (10:38 +0200)]
bgpd: simplify fs add pbr entry

Simplify the fs pbr entry creation.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: avoid memory leak in bgp flowspec list, plus usage of bool
Philippe Guibert [Mon, 20 Aug 2018 16:32:00 +0000 (18:32 +0200)]
bgpd: avoid memory leak in bgp flowspec list, plus usage of bool

Avoid memory leak in bgp flowspec list.
Usage of bool parameter instead of int, to handle the number of entries
PBR.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agolib: fix deadlock in log.c
Quentin Young [Tue, 21 Aug 2018 15:15:38 +0000 (15:15 +0000)]
lib: fix deadlock in log.c

Daemons could deadlock when log file could not be opened during a log
rotation.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #2881 from donaldsharp/external_removal
David Lamparter [Tue, 21 Aug 2018 15:00:28 +0000 (17:00 +0200)]
Merge pull request #2881 from donaldsharp/external_removal

ospfd: Remove unused function

5 years agoMerge pull request #2878 from pguibert6WIND/fix_show_error_all
Donald Sharp [Tue, 21 Aug 2018 14:35:16 +0000 (10:35 -0400)]
Merge pull request #2878 from pguibert6WIND/fix_show_error_all

lib: fix show error all

5 years agoospfd: Remove unused function
Donald Sharp [Tue, 21 Aug 2018 12:40:51 +0000 (08:40 -0400)]
ospfd: Remove unused function

The ospf_external_route_lookup function was not
being used so let's just remove it.

Unfortunately the removal was not quite so simple as
that ospf_asbr.h was being used to generate a reference
for the `struct ospf_route` data structure, so we
need to fix up the compile by fixing up header
inclusions so that ospf_route.h is actually included

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: fix show error all
Philippe Guibert [Tue, 21 Aug 2018 09:09:36 +0000 (11:09 +0200)]
lib: fix show error all

show error all was displaying 0 value for code, whereas real code value
was not displayed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agoMerge pull request #2867 from dslicenc/show-route-leak-json
David Lamparter [Tue, 21 Aug 2018 03:52:30 +0000 (05:52 +0200)]
Merge pull request #2867 from dslicenc/show-route-leak-json

bgpd: add json output to bgp route-leak show command

5 years agoospfd: Add ospf_lsa_new_and_data function and abstract away
Donald Sharp [Tue, 21 Aug 2018 00:41:37 +0000 (20:41 -0400)]
ospfd: Add ospf_lsa_new_and_data function and abstract away

In all but one instance we were following this pattern
with ospf_lsa_new:

ospf_lsa_new()
ospf_lsa_data_new()

so let's create a ospf_lsa_new_and_data to abstract
this bit of fun and cleanup all the places where
it assumes these function calls can fail.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #2874 from opensourcerouting/fix-doc-bfdd-index
Donald Sharp [Mon, 20 Aug 2018 23:39:27 +0000 (19:39 -0400)]
Merge pull request #2874 from opensourcerouting/fix-doc-bfdd-index

doc: address multiple warnings related to bfdd's docs

5 years agobfdd: fix documentation warnings
Rafael Zalamena [Fri, 17 Aug 2018 14:34:22 +0000 (11:34 -0300)]
bfdd: fix documentation warnings

* Extend dashes on 'OSPF BFD Configuration' title;
* Add JSON output code indentation;

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobgpd: fix additional issue with bgp route-leak json commit
Don Slice [Mon, 20 Aug 2018 21:05:57 +0000 (21:05 +0000)]
bgpd:  fix additional issue with bgp route-leak json commit

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agodoc: bfdd manpage should be included in the manpage index
Christian Franke [Mon, 20 Aug 2018 20:44:13 +0000 (22:44 +0200)]
doc: bfdd manpage should be included in the manpage index

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years agobgpd: fix issues with bgp route-leak json commit
Don Slice [Mon, 20 Aug 2018 19:36:11 +0000 (19:36 +0000)]
bgpd: fix issues with bgp route-leak json commit

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoMerge pull request #2872 from donaldsharp/tcp_zebra
David Lamparter [Mon, 20 Aug 2018 18:53:26 +0000 (20:53 +0200)]
Merge pull request #2872 from donaldsharp/tcp_zebra

doc, debianpkg: Cleanup tcp-zebra configure options

5 years agodoc, debianpkg: Cleanup tcp-zebra configure options
Donald Sharp [Mon, 20 Aug 2018 17:17:34 +0000 (13:17 -0400)]
doc, debianpkg: Cleanup tcp-zebra configure options

Since we removed --enable-tcp-zebra cleanup the last
remaining vestiges of that code from the system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #2814 from qlyoung/fix-ospf6d-lsa-uaf-test
David Lamparter [Mon, 20 Aug 2018 16:16:46 +0000 (18:16 +0200)]
Merge pull request #2814 from qlyoung/fix-ospf6d-lsa-uaf-test

ospf6d: fix use after free on LSA

5 years agobgpd: unregister VNI learning from zebra on default instance delete
Anuradha Karuppiah [Mon, 20 Aug 2018 14:51:34 +0000 (07:51 -0700)]
bgpd: unregister VNI learning from zebra on default instance delete

The code for this was always there but was not kicking in because of an
incorrect dependency on is_evpn_enabled. This API attempts to locate the
default instance from bgp_master's instance list. Only the instance
currently being deleted has already been removed from the instance list
by the time bgp_delete->bgp_zebra_instance_deregister is executed.

Symptom of this bug used to show up when a default instance is deleted
and created again. In that case bgp_zebra_instance_register would not be
effective as zebra ignores the register as dup (dereg didn't happen in the
first place) so bgpd wouldn't reload already configured L2-VNIs.
root@cel-sea-03:~# net show bgp l2vpn evpn vni |grep 1000
* 1000       L2   169.253.0.11:9   6646:1000  6646:1000 vrf1
root@cel-sea-03:~# grep "router bgp"  /etc/frr/frr.conf
router bgp 6646
root@cel-sea-03:~# sed -i 's/6646/6656/' /etc/frr/frr.conf
root@cel-sea-03:~# grep "router bgp"  /etc/frr/frr.conf
router bgp 6656
root@cel-sea-03:~# systemctl reload frr
root@cel-sea-03:~# net show bgp l2vpn evpn vni |grep 1000
root@cel-sea-03:~#

Fix simply changes the order of dereg to make
bgp_zebra_instance_deregister actually happen (by doing it before the
default instance is removed from the master list).

Ticket: CM-21566

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agosnapcraft: Add RPKI to snap package
Martin Winter [Sat, 11 Aug 2018 01:35:06 +0000 (18:35 -0700)]
snapcraft: Add RPKI to snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 years agobgpd: add json output to bgp route-leak show command
Don Slice [Fri, 17 Aug 2018 19:22:55 +0000 (19:22 +0000)]
bgpd: add json output to bgp route-leak show command

Ticket: CM-20259
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agozebra : routemap "match ipv6 address prefix list" does not work
kssoman [Fri, 17 Aug 2018 15:53:28 +0000 (08:53 -0700)]
zebra : routemap "match ipv6 address prefix list" does not work

* Added code for "match ipv6 address prefix list" command
* Added common function route_match_address_prefix_list() to process
  routemap for AFI_IP and AFI_IP6 address family

Signed-off-by: kssoman <somanks@vmware.com>
5 years agoMerge pull request #2829 from donaldsharp/more_upstream
Lou Berger [Fri, 17 Aug 2018 15:49:44 +0000 (11:49 -0400)]
Merge pull request #2829 from donaldsharp/more_upstream

bgpd: Check for L3VNI before sending RMAC/L3 RTs

5 years agozebra : Zebra does not properly track which route-maps are changed (#2493)
kssoman [Fri, 17 Aug 2018 15:47:48 +0000 (08:47 -0700)]
zebra : Zebra does not properly track which route-maps are changed (#2493)

* Check for the modified routemap in zebra_route_map_process_update_cb()
* Added zebra_rib_table_rm_update() for RIB routemap processing
* Added zebra_nht_rm_update() for NHT routemap processing

Signed-off-by: kssoman <somanks@vmware.com>
5 years agoMerge pull request #2834 from dslicenc/import-vrf-fixes
Russ White [Fri, 17 Aug 2018 13:16:26 +0000 (09:16 -0400)]
Merge pull request #2834 from dslicenc/import-vrf-fixes

bgpd: issues with vrf imports when switchd or networking restarted

5 years agoMerge pull request #2858 from Jafaral/sphinx
Quentin Young [Fri, 17 Aug 2018 03:45:14 +0000 (23:45 -0400)]
Merge pull request #2858 from Jafaral/sphinx

configure.ac: emit a config  warning if sphinx-build is missing