]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agobgpd: fix race condition in build system regarding bgp_rpki_clippy.c
Marcel Röthke [Tue, 14 Nov 2017 08:29:32 +0000 (09:29 +0100)]
bgpd: fix race condition in build system regarding bgp_rpki_clippy.c

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
6 years agoMerge pull request #1442 from msablic/msablic_frr_cm00001
Quentin Young [Mon, 13 Nov 2017 21:22:26 +0000 (16:22 -0500)]
Merge pull request #1442 from msablic/msablic_frr_cm00001

frr: COMMUNITY.md updated link to to kernel.org

6 years agofrr: COMMUNITY.md updated link to to kernel.org
Mladen Sablic [Mon, 13 Nov 2017 20:34:50 +0000 (21:34 +0100)]
frr: COMMUNITY.md updated link to to kernel.org

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
6 years agoMerge pull request #1436 from rtrlib/rpki
Donald Sharp [Mon, 13 Nov 2017 18:35:22 +0000 (13:35 -0500)]
Merge pull request #1436 from rtrlib/rpki

bgpd: Add RPKI/RTR support

6 years agoMerge pull request #1437 from dwalton76/frr-reload
Renato Westphal [Mon, 13 Nov 2017 15:53:37 +0000 (13:53 -0200)]
Merge pull request #1437 from dwalton76/frr-reload

frr-reload.py: misc fixes

6 years agobgpd: fix build against rtrlib versions without ssh support
Marcel Röthke [Mon, 13 Nov 2017 14:50:50 +0000 (15:50 +0100)]
bgpd: fix build against rtrlib versions without ssh support

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
6 years agodoc: add rpki.texi to makefile
Marcel Röthke [Fri, 10 Nov 2017 14:24:45 +0000 (15:24 +0100)]
doc: add rpki.texi to makefile

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
6 years agolib: Fix command `copy running-config startup-config` to alias `write file`
pogojotz [Mon, 6 Nov 2017 21:43:32 +0000 (22:43 +0100)]
lib: Fix command `copy running-config startup-config` to alias `write file`

Fixes: #1412
Signed-off-by: Juergen Werner <pogojotz@gmx.net>
6 years agotools: frr-reload do not attempt deleting lines that cannot be deleted
Daniel Walton [Fri, 10 Nov 2017 18:30:25 +0000 (18:30 +0000)]
tools: frr-reload do not attempt deleting lines that cannot be deleted

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
There are several lines that we cannot do a "no" on
- frr version
- frr defaults
- password
- line vty

frr-reload should ignore these if asked to do a "no" on them

6 years agotools: frr-reload remove Cumulus Linux release numbers from comments
Daniel Walton [Fri, 10 Nov 2017 17:57:42 +0000 (17:57 +0000)]
tools: frr-reload remove Cumulus Linux release numbers from comments

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
The "3.0", etc in the comments were referring to Cumulus Linux 3.0 which
was confusing now that FRR has a 3.0

6 years agotools: frr-reload combine "'router bgp' and line" checks
Daniel Walton [Fri, 10 Nov 2017 17:47:13 +0000 (17:47 +0000)]
tools: frr-reload combine "'router bgp' and line" checks

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
We had multiple places checking for

    if ctx_keys[0].startswith('router bgp') and line

Combine these into a single check

6 years agotools: frr-reload avoid del/add of BGP table-map
Daniel Walton [Fri, 10 Nov 2017 17:41:43 +0000 (17:41 +0000)]
tools: frr-reload avoid del/add of BGP table-map

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
6 years agotools: frr-reload.py ignore multiple whitespaces
Daniel Walton [Fri, 10 Nov 2017 17:19:08 +0000 (17:19 +0000)]
tools: frr-reload.py ignore multiple whitespaces

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Without this fix frr-reload would do a del/add even if the only
difference were bogus whitespaces.

root@cel-redxp-10[nclu]# /usr/lib/frr/frr-reload.py --test
/etc/frr/frr.conf

Lines To Delete
===============

router bgp 100
 no bgp router-id 1.1.1.1

Lines To Add
============

router bgp 100
 bgp   router-id 1.1.1.1
root@cel-redxp-10[nclu]#

6 years agoMerge pull request #1426 from donaldsharp/prefixlistafi
Jafar Al-Gharaibeh [Fri, 10 Nov 2017 15:11:53 +0000 (09:11 -0600)]
Merge pull request #1426 from donaldsharp/prefixlistafi

lib: Only apply prefix's to the same family

6 years agobgpd: Add RPKI/RTR support
Marcel Röthke [Fri, 10 Nov 2017 12:56:24 +0000 (13:56 +0100)]
bgpd: Add RPKI/RTR support

This commit adds support for the RTR protocol to receive ROA
information from a RPKI cache server. That information can than be used
to validate the BGP origin AS of IP prefixes.
Both features are implemented using [rtrlib](http://rtrlib.realmv6.org/).

Signed-off-by: Marcel Röthke <marcel.roethke@haw-hamburg.de>
6 years agoospf6d: Fix setting interface ipv6 ospf6 cost value (LSA hooks were never called)
Juergen Kammer [Tue, 7 Nov 2017 08:38:22 +0000 (09:38 +0100)]
ospf6d: Fix setting interface ipv6 ospf6 cost value (LSA hooks were never called)

Fixes: #1420
Signed-off-by: Juergen Kammer <j.kammer@eurodata.de>
If the ipv6 ospf6 cost on an interface is changed, no recalculation of routes happens, though the interface structure is updated with the new value. The new cost will be used later, when LSA hooks are called for any other reason.

Diagnosis:
The DEFUN for the config command sets oi->cost and calls ospf6_interface_recalculate_cost(oi) whenever there is a change in the supplied value. ospf6_interface_recalculate_cost then gets the new cost for the interface by calling ospf6_interface_get_cost(oi), which returns oi->cost if a cost is manually set (i.e. we get the value we just set). ospf6_interface_recalculate_cost only calls the LSA hooks if there is a change - which obviously never happens if we compare the new value with itself.

6 years agoMerge pull request #1391 from LabNConsulting/working/master/patch-set/vnc-vrf-export
Donald Sharp [Thu, 9 Nov 2017 13:53:24 +0000 (08:53 -0500)]
Merge pull request #1391 from LabNConsulting/working/master/patch-set/vnc-vrf-export

Support vrf export/import based on vrf-policy

6 years ago.dir-locals.el: show trailing whitespace
Lou Berger [Fri, 3 Nov 2017 21:48:26 +0000 (17:48 -0400)]
.dir-locals.el: show trailing whitespace

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: document that export mode applies to vrf-policy groups
Lou Berger [Sat, 4 Nov 2017 14:01:27 +0000 (10:01 -0400)]
bgpd: document that export mode applies to vrf-policy groups

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: fun with whitespace conventions
Lou Berger [Fri, 3 Nov 2017 21:36:06 +0000 (17:36 -0400)]
bgpd: fun with whitespace conventions

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: rfapi - fix error output
Lou Berger [Tue, 31 Oct 2017 15:52:36 +0000 (11:52 -0400)]
bgpd: rfapi - fix error output

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agoMerge pull request #1359 from donaldsharp/rhel_startup
Martin Winter [Tue, 7 Nov 2017 17:03:37 +0000 (09:03 -0800)]
Merge pull request #1359 from donaldsharp/rhel_startup

redhat: Fix redhat startup to actually read in unified config

6 years agobgpd: rfapi - don't do debug related work when debug not
Lou Berger [Sat, 28 Oct 2017 19:03:34 +0000 (15:03 -0400)]
bgpd: rfapi - don't do debug related work when debug not
      enabled and other minor tweaks

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: rfapi - open rfd for vrf groups on export config,
Lou Berger [Mon, 30 Oct 2017 02:43:19 +0000 (22:43 -0400)]
bgpd: rfapi - open rfd for vrf groups on export config,
      keep open until group deleted

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agolib: Only apply prefix's to the same family
Donald Sharp [Tue, 7 Nov 2017 15:54:03 +0000 (10:54 -0500)]
lib: Only apply prefix's to the same family

When we have a v4 or v6 prefix list, only
apply it via a match when the address families
are the same.

Fixes: #1339
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1417 from qlyoung/mfa-fix
Russ White [Tue, 7 Nov 2017 01:55:19 +0000 (20:55 -0500)]
Merge pull request #1417 from qlyoung/mfa-fix

bgpd: fix mishandled attribute length

6 years agobgpd: fix mishandled attribute length
Quentin Young [Mon, 23 Oct 2017 20:43:32 +0000 (16:43 -0400)]
bgpd: fix mishandled attribute length

A crafted BGP UPDATE with a malformed path attribute length field causes
bgpd to dump up to 65535 bytes of application memory and send it as the
data field in a BGP NOTIFY message, which is truncated to 4075 bytes
after accounting for protocol headers. After reading a malformed length
field, a NOTIFY is generated that is supposed to contain the problematic
data, but the malformed length field is inadvertently used to compute
how much data we send.

CVE-2017-15865

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #1381 from donaldsharp/iface_desc
Jafar Al-Gharaibeh [Mon, 6 Nov 2017 23:29:12 +0000 (17:29 -0600)]
Merge pull request #1381 from donaldsharp/iface_desc

zebra: Allow IFLA_IFALIAS to set ifp->desc

6 years agoMerge pull request #1400 from chiragshah6/mdev1
Jafar Al-Gharaibeh [Mon, 6 Nov 2017 23:25:55 +0000 (17:25 -0600)]
Merge pull request #1400 from chiragshah6/mdev1

ospfd: VRF aware Router-ID update

6 years agoospfd: VRF aware Router-ID update
Chirag Shah [Thu, 2 Nov 2017 14:54:45 +0000 (07:54 -0700)]
ospfd: VRF aware Router-ID update

Ensure zebra received router-id isolated per vrf instance.
Store zebra received router-id within ospf instance.

Ticket:CM-18657
Reviewed By:
Testing Done:
Validated follwoing sequence
- Create vrf1111
- Create ospf vrf1111 with no router-id
- Assign ip to vrf111
- ospf is assigned zebra assigned router-id which is vrf ip.
- upon remvoing vrf ip, the router-id retained as same until
ospfd restarted.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #1414 from donaldsharp/set_nexthop
Rafael Zalamena [Mon, 6 Nov 2017 18:52:20 +0000 (16:52 -0200)]
Merge pull request #1414 from donaldsharp/set_nexthop

lib: Fix nexthop reading to work better

6 years agoMerge pull request #1406 from donaldsharp/bgpd_ecommunity_crash
Renato Westphal [Mon, 6 Nov 2017 17:08:07 +0000 (15:08 -0200)]
Merge pull request #1406 from donaldsharp/bgpd_ecommunity_crash

bgpd: Fix crash with ecommunity string

6 years agolib: Fix nexthop reading to work better
Donald Sharp [Mon, 6 Nov 2017 16:20:40 +0000 (11:20 -0500)]
lib: Fix nexthop reading to work better

Fixes: #1404
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1403 from donaldsharp/prefixlen_match
Renato Westphal [Mon, 6 Nov 2017 16:07:21 +0000 (14:07 -0200)]
Merge pull request #1403 from donaldsharp/prefixlen_match

doc, zebra: Add 'match ipv6 address prefix-len (0-128)' command

6 years agoMerge pull request #1370 from dslicenc/cm18408-bgp-timers
Renato Westphal [Mon, 6 Nov 2017 16:06:12 +0000 (14:06 -0200)]
Merge pull request #1370 from dslicenc/cm18408-bgp-timers

bgpd: fix various problems with hold/keepalive timers

6 years agoMerge pull request #1410 from chiragshah6/mdev
Jafar Al-Gharaibeh [Mon, 6 Nov 2017 15:40:49 +0000 (09:40 -0600)]
Merge pull request #1410 from chiragshah6/mdev

ospfd: clearnup [no] router ospf command

6 years agoMerge pull request #1383 from chiragshah6/ospf_vrf_dev
Jafar Al-Gharaibeh [Mon, 6 Nov 2017 15:39:16 +0000 (09:39 -0600)]
Merge pull request #1383 from chiragshah6/ospf_vrf_dev

ospfd: add vrf option to operational command

6 years agobgpd: Prevent infinite loop when reading capabilities
Donald Sharp [Fri, 3 Nov 2017 19:25:31 +0000 (15:25 -0400)]
bgpd: Prevent infinite loop when reading capabilities

If the user has configured the ability to override
the capabilities or if the afi/safi passed as part
of the _MP capability is not understood, then we
can enter into an infinite loop as part of the
capability parsing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix crash with ecommunity string
Donald Sharp [Fri, 3 Nov 2017 18:09:24 +0000 (14:09 -0400)]
bgpd: Fix crash with ecommunity string

When we are displaying a extended community ECOMMUNITY_SITE_ORIGIN
the display sprintf is this:

len = sprintf(
str_buf + str_pnt,
"EVPN:%02x:%02x:%02x:%02x:%02x:%02x",
macaddr[0], macaddr[1], macaddr[2],
macaddr[3], macaddr[4], macaddr[5]);

The problem with this is that macaddr[0] is passed in as a integer
so the sprintf function thinks that the value to display is much
larger than it actually is.  The ECOMMUNITY_STR_DEFAULT_LEN is 27
So the resulting string no-longer fits in memory and we write
off the end of the buffer and can crash.  If we force the
passed in value to be a uint8_t then we get the expected output
since a single byte is displayed as 2 hex characters and the
resulting string fits in str_buf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc, zebra: Add 'match ipv6 address prefix-len (0-128)' command
Donald Sharp [Fri, 3 Nov 2017 14:33:09 +0000 (10:33 -0400)]
doc, zebra: Add 'match ipv6 address prefix-len (0-128)' command

Add the ability to match a specific prefix-length in zebra.
This command behaves in the same manner that the v4 version
of the command behaves.

Fixes: #1398
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1405 from dslicenc/cm18634-bgp-default
Renato Westphal [Mon, 6 Nov 2017 12:29:48 +0000 (10:29 -0200)]
Merge pull request #1405 from dslicenc/cm18634-bgp-default

bgpd: default originate issue with intf peers and global intf address

6 years agoospfd: clearnup [no] router ospf command
Chirag Shah [Sat, 4 Nov 2017 01:34:59 +0000 (18:34 -0700)]
ospfd: clearnup [no] router ospf command

no router ospf followed by router ospf throws
a message, there isn't active ospf instance.

Fix ospf instance lookup.

Ticket:CM-18675
Testing Done:
Validated router ospf, no router ospf with
VRF and with multi-instance version 'router ospf 2'
configuration clis.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agobgpd: default originate issue with intf peers and global intf address
Don Slice [Fri, 3 Nov 2017 16:45:02 +0000 (16:45 +0000)]
bgpd: default originate issue with intf peers and global intf address

Problem reported that a receiver of a default route issued across bgp
unnumbered peering using default originate would have the route stay
as inactive.  Discovered we were messing up the nexthop value sent to
the peer in this one particular case.  Manual testing good, fix supplied
to the submitter and verified to resolve the problem.  bgp-smoke
completed successfully.

Ticket: CM-18634
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1397 from qlyoung/fix-vtysh-completions-npd
Renato Westphal [Fri, 3 Nov 2017 10:27:12 +0000 (08:27 -0200)]
Merge pull request #1397 from qlyoung/fix-vtysh-completions-npd

vtysh: protect null deref for cli completions

6 years agovtysh: protect null deref for cli completions
Quentin Young [Thu, 2 Nov 2017 15:50:13 +0000 (11:50 -0400)]
vtysh: protect null deref for cli completions

cmd_describe_command() returns NULL when there is no matched command, so
check the return value before trying to free it

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #1379 from donaldsharp/eigrp_crashes
Renato Westphal [Thu, 2 Nov 2017 15:09:46 +0000 (13:09 -0200)]
Merge pull request #1379 from donaldsharp/eigrp_crashes

Eigrp crashes

6 years agoeigrpd: Allow query send to send more than 1 packet
Donald Sharp [Fri, 27 Oct 2017 17:02:15 +0000 (13:02 -0400)]
eigrpd: Allow query send to send more than 1 packet

When we send a query if we have more queries than we
can fit in one packet, allow the packet to be broken
up into multiple packets to be sent to our neighbor.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Create consts for TLV size
Donald Sharp [Fri, 27 Oct 2017 16:53:52 +0000 (12:53 -0400)]
eigrpd: Create consts for TLV size

1) Create #defines for TLV SIZE and use them
2) Speed up prefix length by using a switch statement

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1363 from donaldsharp/z_improvements
Russ White [Wed, 1 Nov 2017 00:27:19 +0000 (20:27 -0400)]
Merge pull request #1363 from donaldsharp/z_improvements

Z improvements

6 years agoMerge pull request #1367 from donaldsharp/mp_reach_parse
Russ White [Wed, 1 Nov 2017 00:23:32 +0000 (20:23 -0400)]
Merge pull request #1367 from donaldsharp/mp_reach_parse

bgpd: Treat empty reachable NLRI as a EOR

6 years agoMerge pull request #1382 from donaldsharp/eigrp_loop
Russ White [Wed, 1 Nov 2017 00:21:26 +0000 (20:21 -0400)]
Merge pull request #1382 from donaldsharp/eigrp_loop

Eigrp loop

6 years agoMerge pull request #1336 from donaldsharp/peer_name
Lou Berger [Tue, 31 Oct 2017 15:40:44 +0000 (11:40 -0400)]
Merge pull request #1336 from donaldsharp/peer_name

Peer name

6 years agoMerge pull request #1371 from donaldsharp/bgp_exit
Lou Berger [Tue, 31 Oct 2017 15:39:25 +0000 (11:39 -0400)]
Merge pull request #1371 from donaldsharp/bgp_exit

bgpd: exit on socket bind failures

6 years agobgpd: allow for vpn->vrf imports
Lou Berger [Tue, 10 Oct 2017 14:00:10 +0000 (10:00 -0400)]
bgpd: allow for vpn->vrf imports
      ignore nexthop checks for RFAPI imported routes (as is self)
      note: NHT is still updated

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: rfapi support import based on vrf-policy (precusor to import to vrf instance)
Lou Berger [Mon, 9 Oct 2017 21:26:30 +0000 (17:26 -0400)]
bgpd: rfapi support import based on vrf-policy (precusor to import to vrf instance)

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: vrf-policy add prefix lists and route-maps on export
Lou Berger [Mon, 9 Oct 2017 19:20:19 +0000 (15:20 -0400)]
bgpd: vrf-policy add prefix lists and route-maps on export

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: add afi/safi to debug output
Lou Berger [Sat, 28 Oct 2017 19:04:49 +0000 (15:04 -0400)]
bgpd: add afi/safi to debug output

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agobgpd: set v4 next hop for VPN SAFI for consistency in processing
Lou Berger [Sat, 28 Oct 2017 19:04:20 +0000 (15:04 -0400)]
bgpd: set v4 next hop for VPN SAFI for consistency in processing

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agoMerge pull request #1366 from donaldsharp/bgp_non_integrated_zebra_redistribution
Lou Berger [Tue, 31 Oct 2017 14:53:59 +0000 (10:53 -0400)]
Merge pull request #1366 from donaldsharp/bgp_non_integrated_zebra_redistribution

Bgp non integrated zebra redistribution

6 years agoMerge pull request #1376 from donaldsharp/mpls_replace_semantics
Renato Westphal [Tue, 31 Oct 2017 14:48:31 +0000 (12:48 -0200)]
Merge pull request #1376 from donaldsharp/mpls_replace_semantics

Mpls replace semantics

6 years agoMerge pull request #1377 from donaldsharp/bgp_json
Lou Berger [Tue, 31 Oct 2017 13:25:20 +0000 (09:25 -0400)]
Merge pull request #1377 from donaldsharp/bgp_json

bgpd: Cleanup some json output in bgp_route.c

6 years agoMerge pull request #1389 from donaldsharp/pim_nexthop_lookup_crash
Jafar Al-Gharaibeh [Tue, 31 Oct 2017 05:23:42 +0000 (00:23 -0500)]
Merge pull request #1389 from donaldsharp/pim_nexthop_lookup_crash

pimd: When doing a RPF for a route, note when we fail the lookup

6 years agoMerge pull request #1390 from donaldsharp/pim_ifp_flap_crash
Jafar Al-Gharaibeh [Tue, 31 Oct 2017 05:21:52 +0000 (00:21 -0500)]
Merge pull request #1390 from donaldsharp/pim_ifp_flap_crash

pimd: Fix crash with debug and ifp changes

6 years agoospfd: fix show ospf neigh json for multile nbrs
Chirag Shah [Mon, 30 Oct 2017 18:56:59 +0000 (11:56 -0700)]
ospfd: fix show ospf neigh json for multile nbrs

Same neighbor learned from multiple ospf interfaces
(all) were not displayed in json, only last was displayed.
Created list within dictionary using neighbor-id as key.
lookup neigbhor-id in json obejct prior to creating new list.

spine-2# show ip ospf neighbor

Neighbor ID   Pri State     Dead Time Address     Interface
0.0.1.16        1 Full/DR   36.754s   8.0.3.15    swp1:8.0.3.16
0.0.1.16        1 Full/DR   30.903s   7.0.3.15    swp2:7.0.3.16

spine-2# show ip ospf neighbor json
{
   "0.0.1.16":[
   {
      "priority":1,
         "state":"Full\/DR",
         "deadTimeMsecs":35114,
         "address":"8.0.3.15",
         "ifaceName":"swp1:8.0.3.16",
         "retransmitCounter":0,
         "requestCounter":0,
         "dbSummaryCounter":0
   },
   {
      "priority":1,
      "state":"Full\/DR",
      "deadTimeMsecs":39264,
      "address":"7.0.3.15",
      "ifaceName":"swp2:7.0.3.16",
      "retransmitCounter":0,
      "requestCounter":0,
      "dbSummaryCounter":0
   }
   ]
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agopimd: Fix crash with debug and ifp changes
Donald Sharp [Mon, 30 Oct 2017 23:41:28 +0000 (19:41 -0400)]
pimd: Fix crash with debug and ifp changes

Certain interface flapping events can cause a lookup
that does not find any ifp pointer.  This is only causing
a crash in the `debug pim zebra` command due to only needing
to lookup the interface for it's name.

Modify code to ensure we have a valid pointer.  Follow other
debug statements lead in the same function for what to display
when an interface does not currently exist.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: When doing a RPF for a route, note when we fail the lookup
Donald Sharp [Mon, 30 Oct 2017 17:29:14 +0000 (13:29 -0400)]
pimd: When doing a RPF for a route, note when we fail the lookup

When we ask PIM to do a CLI search of a random (S,G) if the
(S,G) has no RPF due to no route, let the user know about
the issue instead of crashing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: When writing packet don't crash in some cases
Donald Sharp [Sun, 29 Oct 2017 12:51:57 +0000 (08:51 -0400)]
eigrpd: When writing packet don't crash in some cases

When we are writing a packet if we have gotten ourselves
into a bad situation, note it and move on.  Hopefully
dumping enough information so that we can find the offending
reason.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Fix crash in reply receive packet.
Donald Sharp [Sun, 29 Oct 2017 12:28:01 +0000 (08:28 -0400)]
eigrpd: Fix crash in reply receive packet.

When we receive a reply for a prefix we no longer
have we should note the issue and move on instead
of crashing eigrp.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Query Send is not incrementing the sequence number
Donald Sharp [Sun, 29 Oct 2017 12:27:08 +0000 (08:27 -0400)]
eigrpd: Query Send is not incrementing the sequence number

When we send a query make sure we increment the query
sequence number.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoospfd: add vrf option to operational command
Chirag Shah [Thu, 26 Oct 2017 21:23:25 +0000 (14:23 -0700)]
ospfd: add vrf option to operational command

Seperate the display option in both vty and json
case 'vrf' is used in show command.
   show ip ospf 'vrf all' [json]
   Display vrf name as key object in json and vrf name
   in vty output.
case 'vrf' is not used then only display default
   vrf ospf instance and vrf name is not shown in vty and
   json.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoeigrpd: On shutdown, delete list after we've cleared prefixes
Donald Sharp [Sat, 28 Oct 2017 22:56:34 +0000 (18:56 -0400)]
eigrpd: On shutdown, delete list after we've cleared prefixes

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Fix an issue found with metric change
Donald Sharp [Sat, 28 Oct 2017 22:45:08 +0000 (18:45 -0400)]
eigrpd: Fix an issue found with metric change

A past commit modified the change value to an enum
but did not bother to fix all the places where
change was used.  Fix this.

Additionally add some more output to the fsm prefix
string about the change.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Add ability to show packet type in log
Donald Sharp [Sat, 28 Oct 2017 22:35:56 +0000 (18:35 -0400)]
eigrpd: Add ability to show packet type in log

Allow us to examine the packet type that caused us to change
state.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Create enum for states and string name for display
Donald Sharp [Sat, 28 Oct 2017 22:04:19 +0000 (18:04 -0400)]
eigrpd: Create enum for states and string name for display

Create an enum for the different states and create
a string name display handler.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoeigrpd: Create a function to return a string of prefix state
Donald Sharp [Sat, 28 Oct 2017 21:40:13 +0000 (17:40 -0400)]
eigrpd: Create a function to return a string of prefix state

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Allow IFLA_IFALIAS to set ifp->desc
Donald Sharp [Sat, 28 Oct 2017 01:24:13 +0000 (21:24 -0400)]
zebra: Allow IFLA_IFALIAS to set ifp->desc

The linux kernel passes the IFLA_IFALIAS value.  Allow
zebra to read and set the description appropriately.

Currently I don't set the value down into the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Cleanup some json output in bgp_route.c
Donald Sharp [Fri, 27 Oct 2017 15:32:17 +0000 (11:32 -0400)]
bgpd: Cleanup some json output in bgp_route.c

Cleanup the displayed json output to be a bit prettier
to look at.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Add back in lsp replace semantics.
Donald Sharp [Mon, 23 Oct 2017 14:27:22 +0000 (10:27 -0400)]
zebra: Add back in lsp replace semantics.

When we have a update, we need to use replace
semantics with the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Move clear_nhlfe_installed to calling functions
Donald Sharp [Mon, 23 Oct 2017 14:10:06 +0000 (10:10 -0400)]
zebra: Move clear_nhlfe_installed to calling functions

The function clear_nhlfe_installed is to be called
when we get a install failure of some sort for
a lsp change.  Since an install failure can happen
in both linux and openBSD moving the function call
northbound is a good idea.

I've also added it to the kernel_del_lsp for completeness
on failure as well, even though neither linux or openBSD
currently can fail a uninstall.

This still leaves the hole where if we have multiple
nhlfes and have an install failure we are not quite
doing the right thing by just blanketly calling
clear_nhlfe_installed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1365 from donaldsharp/pim_vrf_cleanup
Jafar Al-Gharaibeh [Fri, 27 Oct 2017 14:32:13 +0000 (09:32 -0500)]
Merge pull request #1365 from donaldsharp/pim_vrf_cleanup

pimd: Cleanup vrf SA issues exposed by recent commits

6 years agoMerge pull request #1356 from opensourcerouting/linux-headers
Donald Sharp [Fri, 27 Oct 2017 14:12:43 +0000 (10:12 -0400)]
Merge pull request #1356 from opensourcerouting/linux-headers

build: include our own copies of some linux kernel headers

6 years agoMerge pull request #1174 from opensourcerouting/show_route_defpy
Donald Sharp [Fri, 27 Oct 2017 14:00:57 +0000 (10:00 -0400)]
Merge pull request #1174 from opensourcerouting/show_route_defpy

Refactor the 'show ip route' commands using DEFPY

6 years agobgpd: exit on socket bind failures
Donald Sharp [Thu, 26 Oct 2017 18:07:33 +0000 (14:07 -0400)]
bgpd: exit on socket bind failures

When we fail to bind to port 179 we are left in a situation
where we have not saved the bgp pointer created and when
the bgp cli mode is exited we leak the memory.

Additionally there is no recovery situation here that
could be easily programmed without fundamentally changing
the code.

So let's exit and output to the log file some useful
information to hopefully clue the user in on what is
going wrong.

Fixes: #1130
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: fix various problems with hold/keepalive timers
Don Slice [Thu, 19 Oct 2017 18:23:30 +0000 (14:23 -0400)]
bgpd: fix various problems with hold/keepalive timers

Problem reported that we weren't adjusting the keepalive timer
correctly when we negotiated a lower hold time learned from a
peer.  While working on this, found we didn't do inheritance
correctly at all.  This fix solves the first problem and also
ensures that the timers are configured correctly based on this
priority order - peer defined > peer-group defined > global config.
This fix also displays the timers as "configured" regardless of
which of the three locations above is used.

Ticket: CM-18408
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: CCR-6807
Testing-performed:  Manual testing successful, fix tested by
submitter, bgp-smoke completed successfully

6 years agoredhat: Fix redhat startup to actually read in unified config
Donald Sharp [Tue, 24 Oct 2017 19:07:10 +0000 (15:07 -0400)]
redhat: Fix redhat startup to actually read in unified config

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Treat empty reachable NLRI as a EOR
Donald Sharp [Thu, 26 Oct 2017 03:07:21 +0000 (23:07 -0400)]
bgpd: Treat empty reachable NLRI as a EOR

This issue was discovered on a live session with an extremely
old cisco 7206VXR router running 12.2(33)SRE4.  The sending router
is sending us an empty NLRI that is MP_REACH.  From RFC
exploration(thanks Russ!) it appears that this was
considered a 'valid' way to send EOR.

Following discussion decided that we should treat
this situation as a EOR marker instead of bringing
down the session.

Applying this fix on the FRR router seeing this issue
allows it to continue it's peering relationship with
the ASR.  Since this is a point fix I do not see
a high likelihood of further fallout.

Fixes: #1258
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: When not fully connected to zebra gracefully ignore the issue
Donald Sharp [Thu, 26 Oct 2017 02:38:50 +0000 (22:38 -0400)]
bgpd: When not fully connected to zebra gracefully ignore the issue

When bgp is coming up and is reading a non-integrated config.
The bgp connection to zebra has not fully had a chance to start.
As such when a redistribute line is parsed the attempt is
made to install it but it was erroring out with a warning.
This caused the `redistribute XXX` line to create a error
message to the end user.

Since bgp calls zclient_send_reg_requests which re-registers
the redistribute call once the actual zebra connection is up
and once bgp comes alive this is ok.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Fix non-integrated config error display
Donald Sharp [Thu, 26 Oct 2017 02:35:35 +0000 (22:35 -0400)]
lib: Fix non-integrated config error display

When using a non-integrated config and starting up
of a protocol daemon, we were not properly handling
all possible cases and as such when an user hit
an actual error they were getting (null) listed
for the message string.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Remove strange line
Donald Sharp [Thu, 26 Oct 2017 02:34:45 +0000 (22:34 -0400)]
lib: Remove strange line

Remove a line that only has a semi-colon on it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #1362 from dslicenc/cm18309-label-delete
Renato Westphal [Wed, 25 Oct 2017 18:56:50 +0000 (16:56 -0200)]
Merge pull request #1362 from dslicenc/cm18309-label-delete

zebra: only pass mpls proto type if doing install

6 years agozebra: unify the ipv4/ipv6 'show ip route' commands - part 2/2
Renato Westphal [Wed, 13 Sep 2017 20:40:19 +0000 (17:40 -0300)]
zebra: unify the ipv4/ipv6 'show ip route' commands - part 2/2

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
6 years agopimd: Cleanup vrf SA issues exposed by recent commits
Donald Sharp [Wed, 25 Oct 2017 17:30:45 +0000 (13:30 -0400)]
pimd: Cleanup vrf SA issues exposed by recent commits

A recent commit has shown that we were not consistent with
handling of the vrf lookup.  Adjust pim to do the right
thing with vrf lookup to be consistent and to make SA
happier.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Add Hidden 'zebra zapi-packets (1-10000)' command
Donald Sharp [Wed, 25 Oct 2017 15:13:42 +0000 (11:13 -0400)]
zebra: Add Hidden 'zebra zapi-packets (1-10000)' command

Allow the end user to specify how many packets we want
to process at one time coming down the zapi, before
we yield and let other things process.

This is a Hidden command because it is not necessarily
something that we want end users to be able to play with

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Store packets to process in `struct zebra_t`
Donald Sharp [Wed, 25 Oct 2017 15:03:41 +0000 (11:03 -0400)]
zebra: Store packets to process in `struct zebra_t`

Store the number of packets we should process at
one time in `struct zebra_t`.  A future commit
will allow the user to control this via
a hidden cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Allow user to specify work-queue processing hold time
Donald Sharp [Wed, 25 Oct 2017 14:47:55 +0000 (10:47 -0400)]
zebra: Allow user to specify work-queue processing hold time

Allow the user to modify the work-queue processing hold time
from 10ms to a value from (0-10000).  Make the command hidden
as that it's a semi-dangerous command and it could cause
issues.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, ospf6d, ospfd, zebra: Add ZEBRA_STR
Donald Sharp [Wed, 25 Oct 2017 14:52:24 +0000 (10:52 -0400)]
lib, ospf6d, ospfd, zebra: Add ZEBRA_STR

Allow us to use a ZEBRA_STR for commands

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: Update route-map match section
Donald Sharp [Wed, 25 Oct 2017 14:02:03 +0000 (10:02 -0400)]
doc: Update route-map match section

The 'match peer ...' command for bgp did
not exist.  Add this into the code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Allow 'match peer' for all route-map types
Donald Sharp [Wed, 18 Oct 2017 14:19:58 +0000 (10:19 -0400)]
bgpd: Allow 'match peer' for all route-map types

There are multiple places that we use route-maps in bgp
There is no need to limit the route-map 'match peer ...' command
to just import and export route-map types.  I see need for
using this in table-maps as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Allow route-map `match peer...` to have auto-complete
Donald Sharp [Wed, 18 Oct 2017 12:57:12 +0000 (08:57 -0400)]
bgpd: Allow route-map `match peer...` to have auto-complete

The match peer command doees not currently have an auto-complete
ability.  Let's add it in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Allow peer interface name to match
Donald Sharp [Wed, 18 Oct 2017 13:34:57 +0000 (09:34 -0400)]
bgpd: Allow peer interface name to match

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