]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agozebra: do not treat kernel routes as implicit withdraws
Jorge Boncompte [Thu, 27 Jul 2017 10:14:32 +0000 (12:14 +0200)]
zebra: do not treat kernel routes as implicit withdraws

Kernel does not send the best route after adding or deleting routes, if
we treat routes for an existing prefix as implicit withdraw the zebra RIB
goes out of sync with FIB and can announce wrong route to protocols.

host:~# vtysh -c 'show ip route'
S>* 0.0.0.0/0 [0/0] via 192.168.1.1, eth0
C>* 192.168.1.0/24 is directly connected, eth0

host:~# ip route add 192.0.2.0/24 via 192.168.1.101 metric 100
host:~# vtysh -c 'show ip route'
S>* 0.0.0.0/0 [0/0] via 192.168.1.1, eth0
K>* 192.0.2.0/24 via 192.168.1.101, eth0
C>* 192.168.1.0/24 is directly connected, eth0

host:~# ip route add 192.0.2.0/24 via 192.168.1.102 metric 50
host:~# vtysh -c 'show ip route'
S>* 0.0.0.0/0 [0/0] via 192.168.1.1, eth0
K>* 192.0.2.0/24 via 192.168.1.102, eth0
C>* 192.168.1.0/24 is directly connected, eth0

host:~# ip route del 192.0.2.0/24 via 192.168.1.102 metric 50
host:~# vtysh -c 'show ip route'
S>* 0.0.0.0/0 [0/0] via 192.168.1.1, eth0
C>* 192.168.1.0/24 is directly connected, eth0
host:~# ip route show 192.0.2.0/24
192.0.2.0/24 via 10.10.1.101 dev eth0 metric 100

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agozebra: hide netlink warning message
Jorge Boncompte [Tue, 25 Jul 2017 12:49:14 +0000 (14:49 +0200)]
zebra: hide netlink warning message

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agozebra: do not hide distance and metric for kernel routes
Jorge Boncompte [Tue, 25 Jul 2017 11:24:09 +0000 (13:24 +0200)]
zebra: do not hide distance and metric for kernel routes

There's no reason for not showing this information.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agozebra: show nexthop MTU if available on detailed 'show ip route'
Jorge Boncompte [Tue, 25 Jul 2017 09:55:41 +0000 (11:55 +0200)]
zebra: show nexthop MTU if available on detailed 'show ip route'

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agozebra: copy MTU from non static routes into nexthop
Jorge Boncompte [Tue, 25 Jul 2017 10:26:13 +0000 (12:26 +0200)]
zebra: copy MTU from non static routes into nexthop

Some routing protocols advertise route MTU (e.g. NHRP), with this patch
installed routes in the kernel have the advertised MTU.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agozebra: track and compare distance of recursive nexthops
Jorge Boncompte [Tue, 25 Jul 2017 10:17:50 +0000 (12:17 +0200)]
zebra: track and compare distance of recursive nexthops

Fixes routing loops when backup routes with recursive nexthops of other
protocols come and go.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agozebra: add missing protocols names to source-protocol route-map match
Jorge Boncompte [Tue, 25 Jul 2017 10:06:31 +0000 (12:06 +0200)]
zebra: add missing protocols names to source-protocol route-map match

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agozebra: fix compilation in 32bit platform
Jorge Boncompte [Tue, 25 Jul 2017 09:46:01 +0000 (11:46 +0200)]
zebra: fix compilation in 32bit platform

RTA_PAYLOAD() return value depends on the platform bits.

make[5]: Nothing to be done for 'all-am'.
Making all in zebra
  CC       rt_netlink.o
../../zebra/rt_netlink.c: In function 'netlink_macfdb_change':
../../zebra/rt_netlink.c:1695:63: error: format '%ld' expects argument of type 'long int', but argument 7 has type 'unsigned int' [-Werror=format=]
    "%s family %s IF %s(%u) brIF %u - LLADDR is not MAC, len %ld",
                                                               ^
../../zebra/rt_netlink.c: In function 'netlink_ipneigh_change':
../../zebra/rt_netlink.c:2024:57: error: format '%ld' expects argument of type 'long int', but argument 6 has type 'unsigned int' [-Werror=format=]
      "%s family %s IF %s(%u) - LLADDR is not MAC, len %ld",
                                                         ^

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agowatchfrr: hide systemd message if not systemd available
Jorge Boncompte [Tue, 25 Jul 2017 10:10:17 +0000 (12:10 +0200)]
watchfrr: hide systemd message if not systemd available

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agoMerge pull request #895 from qlyoung/flush-ready
Jafar Al-Gharaibeh [Wed, 2 Aug 2017 19:24:41 +0000 (14:24 -0500)]
Merge pull request #895 from qlyoung/flush-ready

lib: flush ready queue before poll() again

7 years agoMerge pull request #894 from donaldsharp/sockopt
Jafar Al-Gharaibeh [Wed, 2 Aug 2017 19:22:43 +0000 (14:22 -0500)]
Merge pull request #894 from donaldsharp/sockopt

lib: Remove sockopt_cork functionality

7 years agoMerge pull request #797 from donaldsharp/PIM_VRF
Jafar Al-Gharaibeh [Wed, 2 Aug 2017 19:20:33 +0000 (14:20 -0500)]
Merge pull request #797 from donaldsharp/PIM_VRF

Pim vrf

7 years agolib: flush ready queue before poll() again
Quentin Young [Wed, 2 Aug 2017 18:15:40 +0000 (14:15 -0400)]
lib: flush ready queue before poll() again

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agopimd: Clean back pointer upon deletion
Donald Sharp [Wed, 2 Aug 2017 16:10:50 +0000 (12:10 -0400)]
pimd: Clean back pointer upon deletion

The channel_oil has a back pointer(up) to the upstream data structure.
If we are planning on keeping the channel oil (due to ref count issues)
longer than keeping the upstream, when we delete the upstream we were
not clearing the back pointer to up.  This would result in a situation
where if that memory has started to be used again it will cause a
crash and other fun things.

Ticket: CM-17092
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge branch 'master' into PIM_VRF
Donald Sharp [Wed, 2 Aug 2017 13:39:38 +0000 (09:39 -0400)]
Merge branch 'master' into PIM_VRF

7 years agopimd: Add `ip pim rp keep-alive-time X`
Donald Sharp [Wed, 2 Aug 2017 12:15:45 +0000 (08:15 -0400)]
pimd: Add `ip pim rp keep-alive-time X`

Ticket: CM-17134
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #893 from opensourcerouting/minor-issues
Donald Sharp [Wed, 2 Aug 2017 11:59:29 +0000 (07:59 -0400)]
Merge pull request #893 from opensourcerouting/minor-issues

Fix #875 and #889 (minor issues)

7 years agopimd: Add some more vrf debug information
Donald Sharp [Mon, 31 Jul 2017 22:02:23 +0000 (18:02 -0400)]
pimd: Add some more vrf debug information

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Cleanup nht debugs
Donald Sharp [Mon, 31 Jul 2017 21:29:13 +0000 (17:29 -0400)]
pimd: Cleanup nht debugs

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Clean up mroute_add_vif debugging
Donald Sharp [Mon, 31 Jul 2017 21:16:54 +0000 (17:16 -0400)]
pimd: Clean up mroute_add_vif debugging

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Convert to using a RB tree for the pim_ifp ifchannel_list
Donald Sharp [Mon, 31 Jul 2017 16:44:20 +0000 (12:44 -0400)]
pimd: Convert to using a RB tree for the pim_ifp ifchannel_list

This patch does two things:
1) Converts the pim_ifp->ifchannel_list to a pim_ifp->ifchannel_rb
2) Removes the hashing to use the RB RB_FIND instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Rename pim_ifp->pim_ifchannel_list
Donald Sharp [Mon, 31 Jul 2017 14:41:12 +0000 (10:41 -0400)]
pimd: Rename pim_ifp->pim_ifchannel_list

Remove the redundant information in pim_ifp->pim_ifchannel_list
just call it pim_ifp->ifchannel_list

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove almost duplicate pim->ifchannel_list
Donald Sharp [Mon, 31 Jul 2017 13:58:42 +0000 (09:58 -0400)]
pimd: Remove almost duplicate pim->ifchannel_list

The pim->ifchannel_list can be duplicated by iterating
over each vrf and then over each pim_ifp->pim_ifchannel_list
Since list handling is taking allot of time at scale
convert over to using this value.

Additionally clean up pim_cmd.c to have helper functions
to handle the actual encoding of data for output.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agodoc/babeld: small documentation update
Renato Westphal [Wed, 2 Aug 2017 01:19:18 +0000 (22:19 -0300)]
doc/babeld: small documentation update

Fixes Issue #889.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: fix build from git repository on OpenBSD
Renato Westphal [Wed, 2 Aug 2017 01:12:24 +0000 (22:12 -0300)]
lib: fix build from git repository on OpenBSD

The OpenBSD's cp(1) command doesn't support the -v option. This will
change in the next releases (starting from v6.2) but this patch fixes
the problem for v6.1 and older releases.

Fixes Issue #875.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #886 from dwalton76/bgpd-vpn-multipath-zebra-update
David Lamparter [Wed, 2 Aug 2017 00:46:30 +0000 (02:46 +0200)]
Merge pull request #886 from dwalton76/bgpd-vpn-multipath-zebra-update

bgpd: multipath change for VRF route is not updated in zebra

7 years agoMerge pull request #887 from Jafaral/ospfvlfix
David Lamparter [Wed, 2 Aug 2017 00:45:54 +0000 (02:45 +0200)]
Merge pull request #887 from Jafaral/ospfvlfix

ospfd: Fix, don't run network unset commands on virtual links

7 years agolib: Remove sockopt_cork functionality
Donald Sharp [Wed, 2 Aug 2017 00:36:33 +0000 (20:36 -0400)]
lib: Remove sockopt_cork functionality

Linux -> TCP_CORK is enabled by default
*BSD -> The equivalent is TCP_NOPUSH

As such sockopt_cork is effectively useless
especially since the two places it is used
do it right before TCP writes then disable
it right after the writes are over.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoospfd: Fix, don't run network unset commands on virtual links
Jafar Al-Gharaibeh [Tue, 1 Aug 2017 18:47:02 +0000 (13:47 -0500)]
ospfd: Fix, don't run network unset commands on virtual links

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
7 years agobgpd: multipath change for VRF route is not updated in zebra
Daniel Walton [Tue, 1 Aug 2017 18:31:56 +0000 (18:31 +0000)]
bgpd: multipath change for VRF route is not updated in zebra

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
If you are doing multipath in a VRF and bounce one of the multipaths for
a prefix, bgp is not updating the zebra entry for that prefix with the
new multipaths. We start with:

cel-redxp-10# show bgp vrf RED  ipv4 unicast 6.0.0.16/32
BGP routing table entry for 6.0.0.16/32
Paths: (4 available, best #4, table RED)
  Advertised to non peer-group peers:
  spine-1(swp1) spine-2(swp2) spine-3(swp3) spine-4(swp4)
  104 65104 65002
    fe80::202:ff:fe00:2d from spine-4(swp4) (6.0.0.12)
    (fe80::202:ff:fe00:2d) (used)
      Origin incomplete, localpref 100, valid, external, multipath, bestpath-from-AS 104
      AddPath ID: RX 0, TX 21
      Last update: Tue Aug  1 18:28:33 2017

  102 65104 65002
    fe80::202:ff:fe00:25 from spine-2(swp2) (6.0.0.10)
    (fe80::202:ff:fe00:25) (used)
      Origin incomplete, localpref 100, valid, external, multipath, bestpath-from-AS 102
      AddPath ID: RX 0, TX 20
      Last update: Tue Aug  1 18:28:33 2017

  103 65104 65002
    fe80::202:ff:fe00:29 from spine-3(swp3) (6.0.0.11)
    (fe80::202:ff:fe00:29) (used)
      Origin incomplete, localpref 100, valid, external, multipath, bestpath-from-AS 103
      AddPath ID: RX 0, TX 17
      Last update: Tue Aug  1 18:28:33 2017

  101 65104 65002
    fe80::202:ff:fe00:21 from spine-1(swp1) (6.0.0.9)
    (fe80::202:ff:fe00:21) (used)
      Origin incomplete, localpref 100, valid, external, multipath, bestpath-from-AS 101, best
      AddPath ID: RX 0, TX 8
      Last update: Tue Aug  1 18:28:33 2017

cel-redxp-10#
cel-redxp-10# show ip route vrf RED 6.0.0.16/32
Routing entry for 6.0.0.16/32
  Known via "bgp", distance 20, metric 0, vrf RED, best
  Last update 00:00:25 ago
  * fe80::202:ff:fe00:21, via swp1
  * fe80::202:ff:fe00:25, via swp2
  * fe80::202:ff:fe00:29, via swp3
  * fe80::202:ff:fe00:2d, via swp4

cel-redxp-10#

And then on spine-1 we bounce all peers

spine-1# clear ip bgp *
spine-1#

On the leaf (cel-redxp-10) we remove the route from spine-1

cel-redxp-10# show ip route vrf RED 6.0.0.16/32
Routing entry for 6.0.0.16/32
  Known via "bgp", distance 20, metric 0, vrf RED, best
  Last update 00:00:01 ago
  * fe80::202:ff:fe00:25, via swp2
  * fe80::202:ff:fe00:29, via swp3
  * fe80::202:ff:fe00:2d, via swp4

cel-redxp-10#

So far so good. The problem is when the session to spine-1 comes back up
bgp will mark the flag from spine-1 as `multipath` but does not update
zebra. We end up in a state where BGP has 4 paths flags as multipath but
only 3 paths are in the RIB.

7 years agoMerge pull request #882 from opensourcerouting/safi-cleanup
Donald Sharp [Tue, 1 Aug 2017 18:21:26 +0000 (14:21 -0400)]
Merge pull request #882 from opensourcerouting/safi-cleanup

lib/bgpd: cleanup SAFI values

7 years agoMerge pull request #860 from opensourcerouting/non-recursive
Donald Sharp [Tue, 1 Aug 2017 15:33:43 +0000 (11:33 -0400)]
Merge pull request #860 from opensourcerouting/non-recursive

convert lib & zebra to non-recursive automake

7 years agoMerge pull request #884 from dwalton76/bgpd-peer-hash-limit
Russ White [Tue, 1 Aug 2017 12:04:23 +0000 (08:04 -0400)]
Merge pull request #884 from dwalton76/bgpd-peer-hash-limit

bgpd: peer hash expands until we are out of memory

7 years agoMerge pull request #839 from Orange-OpenSource/TE
Russ White [Tue, 1 Aug 2017 11:34:41 +0000 (07:34 -0400)]
Merge pull request #839 from Orange-OpenSource/TE

OSPF OPAQUE, TE and RI macro refactoring & cleanup

7 years agobuild: fix/improve clippy dependencies
David Lamparter [Mon, 31 Jul 2017 20:38:48 +0000 (22:38 +0200)]
build: fix/improve clippy dependencies

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agotests: fix small typo
Renato Westphal [Tue, 1 Aug 2017 00:01:34 +0000 (21:01 -0300)]
tests: fix small typo

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: don't make any assumptions about the size of an enum
Renato Westphal [Tue, 1 Aug 2017 00:37:46 +0000 (21:37 -0300)]
bgpd: don't make any assumptions about the size of an enum

The size of an enum is compiler dependent and thus we shouldn't use
enums inside structures that represent fields of a packet.

Problem detected by the 'test_capability' unit test.

The problem was not apparent before because the 'iana_safi_t' enum didn't
exist and 'safi_t' was a typedef to uint8_t. Now we have two different
enums, 'iana_afi_t' and 'iana_safi_t', and both need to be encoded in
different ways on the wire (2 bytes vs 1 byte).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: use switch statements in the AFI/SAFI conversion functions
Renato Westphal [Tue, 1 Aug 2017 00:22:20 +0000 (21:22 -0300)]
lib: use switch statements in the AFI/SAFI conversion functions

Switch statements are more elegant (and potentially faster... but that's
not the main motivation).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib/bgpd: introduce the iana_safi_t enum
Renato Westphal [Tue, 1 Aug 2017 00:06:40 +0000 (21:06 -0300)]
lib/bgpd: introduce the iana_safi_t enum

We had afi_t/iana_afi_t for AFIs but only safi_t for SAFIs. Fix this
inconsistency.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: remove SAFI_RESERVED_4 and SAFI_RESERVED_5
Renato Westphal [Tue, 1 Aug 2017 00:09:01 +0000 (21:09 -0300)]
lib: remove SAFI_RESERVED_4 and SAFI_RESERVED_5

SAFI values have been a major source of confusion over the last few
years. That's because each SAFI needs to be represented in two different
ways:
* IANA's value used to send/receive packets over the network;
* Internal value used for array indexing.

In the second case, defining reserved values makes no sense because we
don't want to index SAFIs that simply don't exist. The sole purpose of
the internal SAFI values is to remove the gaps we have among the IANA
values, which would represent wasted memory in C arrays. With that said,
remove these reserved SAFIs to avoid further confusion in the future.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: peer hash expands until we are out of memory
Daniel Walton [Mon, 31 Jul 2017 21:22:23 +0000 (21:22 +0000)]
bgpd: peer hash expands until we are out of memory

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
swpX peers all start out with the same sockunion so initially they all
go into the same hash bucket. Once IPv6 ND has worked its magic they
will have different sockunions and will go in different buckets...life
is good.

Until then though, we are in a phase where all swpX peers have the same
socknunion. Once we have HASH_THRESHOLD (10) swpX peers and call
hash_get for a new swpX peer the hash code calls hash_expand(). This
happens because there are more than HASH_THRESHOLD entries in a single
bucket so the logic is "expand the hash to spread things out"...in our
case expanding doesn't spread out the swpX peers because all of their
sockunions are the same.

I looked at having peer_hash_make and peer_hash_same consider the ifname
of the swpX peer but that is a large change that we don't want to make
at the moment. So the fix is to put a cap on how large we are
willing to let the hash table get. By default there is no limit but if
max_size is set we will not allow the hash to expand above that.

7 years agobuild: non-recursive auxiliary directories
David Lamparter [Mon, 31 Jul 2017 20:05:56 +0000 (22:05 +0200)]
build: non-recursive auxiliary directories

Flatten {m4,pkgsrc,python,redhat,snapcraft}/Makefile.am into the main
one.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoprotobuf: fix build
David Lamparter [Fri, 28 Jul 2017 12:42:13 +0000 (14:42 +0200)]
protobuf: fix build

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: non-recursive qpb & fpm
David Lamparter [Fri, 28 Jul 2017 12:40:39 +0000 (14:40 +0200)]
build: non-recursive qpb & fpm

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: zebra: remove *_method Makefile hacks
David Lamparter [Wed, 26 Jul 2017 17:49:15 +0000 (19:49 +0200)]
build: zebra: remove *_method Makefile hacks

replace with preprocessor checks in source files.  Much simpler...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: convert zebra/ to non-recursive build
David Lamparter [Sat, 22 Jul 2017 17:01:46 +0000 (19:01 +0200)]
build: convert zebra/ to non-recursive build

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: convert lib/ to non-recursive build
David Lamparter [Wed, 24 May 2017 15:48:12 +0000 (17:48 +0200)]
build: convert lib/ to non-recursive build

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #881 from donaldsharp/ping_traceroute
David Lamparter [Mon, 31 Jul 2017 18:06:57 +0000 (20:06 +0200)]
Merge pull request #881 from donaldsharp/ping_traceroute

vtysh: Fix shell executed commands

7 years agoMerge pull request #873 from donaldsharp/ospf6_strings
David Lamparter [Mon, 31 Jul 2017 18:06:06 +0000 (20:06 +0200)]
Merge pull request #873 from donaldsharp/ospf6_strings

ospf6d: New version of GCC with new warnings

7 years agoMerge pull request #865 from qlyoung/find
David Lamparter [Mon, 31 Jul 2017 17:58:20 +0000 (19:58 +0200)]
Merge pull request #865 from qlyoung/find

Find

7 years agoMerge pull request #850 from opensourcerouting/ldpd-cli
Quentin Young [Mon, 31 Jul 2017 17:24:17 +0000 (13:24 -0400)]
Merge pull request #850 from opensourcerouting/ldpd-cli

ldpd: CLI fixes + use DEFPY

7 years agoCorrect build TLV functions
Olivier Dugeon [Mon, 31 Jul 2017 16:03:00 +0000 (18:03 +0200)]
Correct build TLV functions

 * Functions that build TLVs in ospf_te.c and ospf_te.c use 'tlvh + 1'
to move the pointer to the TLV payload ifor strem_put().
 * Correct this by using TLV_DATA() macro which is saffer.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agolib: s/leychain/keychain
Quentin Young [Mon, 31 Jul 2017 15:03:32 +0000 (11:03 -0400)]
lib: s/leychain/keychain

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #874 from opensourcerouting/zebra-static-rework
Quentin Young [Mon, 31 Jul 2017 14:53:39 +0000 (10:53 -0400)]
Merge pull request #874 from opensourcerouting/zebra-static-rework

zebra: make static routes great again

7 years agoCorrect code style as requested by review of PR839
Olivier Dugeon [Mon, 31 Jul 2017 14:39:00 +0000 (16:39 +0200)]
Correct code style as requested by review of PR839

 * As per https://github.com/torvalds/linux/blob/master/scripts/checkpatch.pl
script result, remove extra white space and add TAB when necessary

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agovtysh: Fix shell executed commands
Donald Sharp [Mon, 31 Jul 2017 12:52:10 +0000 (08:52 -0400)]
vtysh: Fix shell executed commands

Pretty much all shell executed commands from vtysh were
not behaving correctly due to errors introduced in
switching to the new cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoldpd: update .gitignore
Renato Westphal [Wed, 26 Jul 2017 01:39:05 +0000 (22:39 -0300)]
ldpd: update .gitignore

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: silence coverity scan warning
Renato Westphal [Wed, 26 Jul 2017 01:36:00 +0000 (22:36 -0300)]
ldpd: silence coverity scan warning

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: add auto-complete for l2vpns
Renato Westphal [Tue, 25 Jul 2017 03:20:56 +0000 (00:20 -0300)]
ldpd: add auto-complete for l2vpns

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: convert CLI code to use DEFPY
Renato Westphal [Tue, 25 Jul 2017 00:45:33 +0000 (21:45 -0300)]
ldpd: convert CLI code to use DEFPY

Yay :)

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: restore correct defaults on "no discovery ... interval"
Renato Westphal [Tue, 25 Jul 2017 00:39:55 +0000 (21:39 -0300)]
ldpd: restore correct defaults on "no discovery ... interval"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: fix missing "no" commands in vtysh
Renato Westphal [Mon, 24 Jul 2017 23:22:17 +0000 (20:22 -0300)]
ldpd: fix missing "no" commands in vtysh

Split the "no" version of some commands into a different DEFUN so that
DEFUN_NOSH doesn't apply to them.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: fix segfault in "clear mpls ldp neighbor [addr]"
Renato Westphal [Mon, 24 Jul 2017 22:48:08 +0000 (19:48 -0300)]
ldpd: fix segfault in "clear mpls ldp neighbor [addr]"

Bug introduced by the CLI refactoring (c740f7d3678).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #856 from opensourcerouting/cli-fuzzer-fixes
Quentin Young [Fri, 28 Jul 2017 23:39:15 +0000 (19:39 -0400)]
Merge pull request #856 from opensourcerouting/cli-fuzzer-fixes

bgpd/eigrpd: fix crashes found by the CLI fuzzer

7 years agopimd: fix `show ip msdp...` NPD when vrf unknown
Quentin Young [Wed, 19 Jul 2017 19:02:35 +0000 (15:02 -0400)]
pimd: fix `show ip msdp...` NPD when vrf unknown

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #866 from opensourcerouting/ldpd-config-issues
Daniel Walton [Fri, 28 Jul 2017 12:11:07 +0000 (08:11 -0400)]
Merge pull request #866 from opensourcerouting/ldpd-config-issues

LDP config issues (Issue #858)

7 years agopimd: Fix msdp cleanup issues
Donald Sharp [Fri, 14 Jul 2017 17:16:45 +0000 (13:16 -0400)]
pimd: Fix msdp cleanup issues

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow the keepalive time to be per vrf.
Donald Sharp [Thu, 13 Jul 2017 01:16:00 +0000 (21:16 -0400)]
pimd: Allow the keepalive time to be per vrf.

Allow the keepalive period to be per vrf.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: use DEFPY for static routes
Renato Westphal [Fri, 28 Jul 2017 00:27:56 +0000 (21:27 -0300)]
zebra: use DEFPY for static routes

Now we have a single command for IPv4 static routes and another one for
IPv6 static routes (+ one command for IPv4 multicast static routes).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: unify the ipv4/ipv6 static route functions
Renato Westphal [Thu, 27 Jul 2017 22:58:45 +0000 (19:58 -0300)]
zebra: unify the ipv4/ipv6 static route functions

Addresses Issue #655.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: allow fully specified static ipv4 routes
Renato Westphal [Thu, 27 Jul 2017 21:57:37 +0000 (18:57 -0300)]
zebra: allow fully specified static ipv4 routes

Fully specified routes are useful when you need to ensure that the
nexthop address is reachable through the specified interface.

Addresses Issue #641.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: refactor zebra_static_ipv4() and static_ipv6_func()
Renato Westphal [Thu, 27 Jul 2017 18:52:52 +0000 (15:52 -0300)]
zebra: refactor zebra_static_ipv4() and static_ipv6_func()

This is a preliminary step to join both functions into one later.

The main idea here is to make these functions have separate arguments
for the nexthop address and the nexthop interface, and adjust the call
sites appropriately. Having an argument that could be a nexthop address
OR a nexthop interface was making the code very hard to follow. With
this simplification, a lot of code duplication was removed and now both
functions look very similar.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: accept static v6 routes with non-existent nexthop interfaces
Renato Westphal [Thu, 27 Jul 2017 21:01:12 +0000 (18:01 -0300)]
zebra: accept static v6 routes with non-existent nexthop interfaces

We don't need to enforce that the interface exists because the route can
be activated later once the interface becomes available. We already do
this for IPv4 routes and IPv6 routes with both a nexthop address and a
nexthop interface.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: remove redundant DEFUNs for labeled static routes
Renato Westphal [Thu, 27 Jul 2017 15:16:41 +0000 (12:16 -0300)]
zebra: remove redundant DEFUNs for labeled static routes

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #857 from devicenull/master
Donald Sharp [Fri, 28 Jul 2017 00:46:22 +0000 (20:46 -0400)]
Merge pull request #857 from devicenull/master

redhat: Make the init script flush routes for all associated protocols

7 years agozebra: remove weird blackhole/reject ipv6 static routes
Renato Westphal [Thu, 27 Jul 2017 14:05:15 +0000 (11:05 -0300)]
zebra: remove weird blackhole/reject ipv6 static routes

This is the v6 counterpart of commit 74d263466b9.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: use curly braces for optional arguments of static routes
Renato Westphal [Thu, 27 Jul 2017 13:44:55 +0000 (10:44 -0300)]
zebra: use curly braces for optional arguments of static routes

This way the optional arguments can be provided in any order.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoospf6d: New version of GCC with new warnings
Donald Sharp [Thu, 27 Jul 2017 22:19:31 +0000 (18:19 -0400)]
ospf6d: New version of GCC with new warnings

GCC 7.1.1 returned warnings about buffer sizes
not being big enough to handle the full string
that could be generated.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #861 from dwalton76/bgpd-attr-unchanged
Russ White [Thu, 27 Jul 2017 19:59:24 +0000 (15:59 -0400)]
Merge pull request #861 from dwalton76/bgpd-attr-unchanged

bgpd: attribute-unchanged issues with peer-groups

7 years agoMerge pull request #859 from donaldsharp/bgp_ll_global
Russ White [Thu, 27 Jul 2017 19:56:56 +0000 (15:56 -0400)]
Merge pull request #859 from donaldsharp/bgp_ll_global

Bgp -> Allow comparison of correct v6 nexthop

7 years agoMerge pull request #862 from dwalton76/bgpd-update-too-large
Russ White [Thu, 27 Jul 2017 19:56:06 +0000 (15:56 -0400)]
Merge pull request #862 from dwalton76/bgpd-update-too-large

bgpd: UPDATE may be larger than 4096 if addpath is used

7 years agoMerge pull request #863 from dwalton76/zebra-static-reject
Russ White [Thu, 27 Jul 2017 19:54:48 +0000 (15:54 -0400)]
Merge pull request #863 from dwalton76/zebra-static-reject

zebra: static route cleanup

7 years agoMerge pull request #864 from dwalton76/zebra-debug-packet-detail
Russ White [Thu, 27 Jul 2017 19:54:16 +0000 (15:54 -0400)]
Merge pull request #864 from dwalton76/zebra-debug-packet-detail

Zebra debug packet detail

7 years agoMerge pull request #869 from donaldsharp/hash_a_roni
Russ White [Thu, 27 Jul 2017 19:47:48 +0000 (15:47 -0400)]
Merge pull request #869 from donaldsharp/hash_a_roni

lib: Remove expansion of hash table

7 years agolib: correct some node name typos
Quentin Young [Thu, 27 Jul 2017 19:03:31 +0000 (15:03 -0400)]
lib: correct some node name typos

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #868 from LabNConsulting/working/master/patch-set/rfapi-lib+
Donald Sharp [Thu, 27 Jul 2017 18:02:00 +0000 (14:02 -0400)]
Merge pull request #868 from LabNConsulting/working/master/patch-set/rfapi-lib+

Restore rfapi and encap attribute, broken by some recent changes

7 years agobgpd rfapi: use afi_t
Lou Berger [Thu, 27 Jul 2017 17:06:49 +0000 (13:06 -0400)]
bgpd rfapi: use afi_t

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agobgpd rfapi: fix breakage introduced in refactoring
Lou Berger [Thu, 27 Jul 2017 15:01:36 +0000 (11:01 -0400)]
bgpd rfapi: fix breakage introduced in refactoring

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agolib: Remove expansion of hash table
Donald Sharp [Thu, 27 Jul 2017 15:08:40 +0000 (11:08 -0400)]
lib: Remove expansion of hash table

The hash code has the idea of stopping expanding
the hash table when certain criteria are set.
With the recent addition of `show hashtable`
we can now see that when we have a full internet
feed we've stopped expanding the table at 1k
buckets.  This results in some serious performance
issues at scale.

Since we now have the ability to see the statistics
on a hash table, let's allow it to expand.  Doing
so on a full feed showed this:

before:
   Hash table          |  Buckets   Entries   Empty   LF        SD      FLF       SD
 ----------------------+----------------------------------------------------------------
   route table hash    |  1024      1187579   0%      1159.75   34.06   1159.75   35.08
   route table hash    |  32768     76208     10%     2.33      2.80    2.58      4.03
   route table hash    |  1024      1187572   0%      1159.74   34.06   1159.74   35.08
   route table hash    |  2048      76205     0%      37.21     6.13    37.21     7.29

Showing hash table statistics for BGP
-------------------------------------

   Hash table         |  Buckets   Entries   Empty   LF       SD      FLF      SD
 ---------------------+--------------------------------------------------------------
   BGP Attributes     |  131072    251229    15%     1.92     2.48    2.25     3.33
   route table hash   |  4096      1187572   0%      289.93   17.03   289.93   17.87
   route table hash   |  32768     76205     10%     2.33     2.90    2.58     4.21

After:

   Hash table          |  Buckets   Entries   Empty   LF     SD     FLF    SD
 ----------------------+--------------------------------------------------------
   route table hash    |  1048576   1187349   32%     1.13   2.57   1.67   3.16
   route table hash    |  32768     76195     10%     2.33   2.81   2.58   4.03
   route table hash    |  1048576   1187342   32%     1.13   2.58   1.67   3.16
   route table hash    |  32768     76192     10%     2.33   2.68   2.58   3.81

Showing hash table statistics for BGP
-------------------------------------

   Hash table         |  Buckets   Entries   Empty   LF     SD     FLF    SD
 ---------------------+--------------------------------------------------------
   BGP Attributes     |  131072    251222    15%     1.92   2.64   2.25   3.58
   route table hash   |  1048576   1187342   32%     1.13   2.52   1.67   3.07
   route table hash   |  32768     76192     10%     2.33   2.86   2.58   4.12

We should see some significant performance improvements across the board
for full feeds.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgp rfapi: use route_table_init and _finish (fixes crash due to recent lib change)
Lou Berger [Thu, 27 Jul 2017 14:05:48 +0000 (10:05 -0400)]
bgp rfapi: use route_table_init and _finish (fixes crash due to recent lib change)

Signed-off-by: Lou Berger <lberger@labn.net>
7 years agoUpdate PR #839 following review
Olivier Dugeon [Thu, 27 Jul 2017 14:09:00 +0000 (16:09 +0200)]
Update PR #839 following review

 * Remove enum status_t opcode in ospfd.h
 * Replace enum status_t opcode by bool enabled in ospf_te.[c,h] and ospf_ri.c
 * Add missign parenthesis '()' around 'if CHECK_FLAG' in ospf_te.c and ospf_ri.c

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
7 years agolib, vtysh: add `find COMMAND`
Quentin Young [Tue, 25 Jul 2017 18:20:55 +0000 (14:20 -0400)]
lib, vtysh: add `find COMMAND`

Substring search through all defined commands in all nodes.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agovtysh: fix markfile output for ldpd
Renato Westphal [Wed, 26 Jul 2017 22:37:49 +0000 (19:37 -0300)]
vtysh: fix markfile output for ldpd

Put the "end" marker in the right places. This should fix the
frr-reload.py script because it depends on the output of vtysh -m.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: add the exit-address-family command
Renato Westphal [Wed, 26 Jul 2017 22:32:55 +0000 (19:32 -0300)]
ldpd: add the exit-address-family command

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: add CLI node names
Quentin Young [Tue, 25 Jul 2017 21:28:19 +0000 (17:28 -0400)]
lib: add CLI node names

Adds an array of descriptive names for each CLI node, plus a runtime
check to make sure folks don't forget to update it.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobgpd: Fix nexthop comparison for v6
Donald Sharp [Wed, 26 Jul 2017 13:41:36 +0000 (09:41 -0400)]
bgpd: Fix nexthop comparison for v6

When we have both a LL and a Global address,
use what the attribute wants for comparison
instead of assuming Global than LL.

This was causing BGP to install v6 routes
that used the LL as the nexthop, where
the global address was different and
being used as the basis for comparison.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Set the ifindex to DELETED after we notify zebra
Donald Sharp [Wed, 26 Jul 2017 13:57:35 +0000 (09:57 -0400)]
bgpd: Set the ifindex to DELETED after we notify zebra

The code path for a deleted interface was calling
zebra with a IFINDEX_DELETED, which caused zebra
to bitch and moan about the issue.  Since the
only thing this function does is call zebra
to deregister the RA stuff, don't set the
ifindex to DELETED till afterwords.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge branch 'master' of https://github.com/dwalton76/frr into zebra-debug-packet...
Daniel Walton [Wed, 26 Jul 2017 18:17:33 +0000 (18:17 +0000)]
Merge branch 'master' of https://github.com/dwalton76/frr into zebra-debug-packet-detail

Conflicts:
zebra/debug.c

7 years agobgpd: attribute-unchanged issues with peer-groups
Daniel Walton [Wed, 26 Jul 2017 17:49:20 +0000 (17:49 +0000)]
bgpd: attribute-unchanged issues with peer-groups

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
7 years agobgpd: UPDATE may be larger than 4096 if addpath is used
Daniel Walton [Wed, 26 Jul 2017 16:33:39 +0000 (16:33 +0000)]
bgpd: UPDATE may be larger than 4096 if addpath is used

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>