]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agovtysh: add missing \n on warning message
David Lamparter [Sun, 6 Aug 2017 02:17:13 +0000 (04:17 +0200)]
vtysh: add missing \n on warning message

Oops, missed this in review.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agoMerge pull request #912 from chiragshah6/mdev
David Lamparter [Sun, 6 Aug 2017 01:55:10 +0000 (03:55 +0200)]
Merge pull request #912 from chiragshah6/mdev

Fix Multi-Instance OSPF configurations CLIs

6 years agoospfd: Handle multi instance router ospf command
Chirag Shah [Sat, 5 Aug 2017 05:55:20 +0000 (22:55 -0700)]
ospfd: Handle multi instance router ospf command

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #899 from donaldsharp/ETH_ALEN
David Lamparter [Sat, 5 Aug 2017 03:19:01 +0000 (05:19 +0200)]
Merge pull request #899 from donaldsharp/ETH_ALEN

Fix Crash and Convert to ETH_ALEN

6 years agoospfd: Fix MI-OSPF CLIs
Chirag Shah [Thu, 3 Aug 2017 23:34:17 +0000 (16:34 -0700)]
ospfd: Fix MI-OSPF CLIs

Handle all instance base clis calling ospf_lookup_instance()
to return CMD_NOT_MY_INSTANCE in case of ospf is not found.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #914 from jbonor/fixes
Quentin Young [Fri, 4 Aug 2017 18:50:33 +0000 (14:50 -0400)]
Merge pull request #914 from jbonor/fixes

bgpd: remove bogus change in attrhash_key_make()

6 years agobgpd: remove bogus change in attrhash_key_make()
Jorge Boncompte [Fri, 4 Aug 2017 17:33:15 +0000 (19:33 +0200)]
bgpd: remove bogus change in attrhash_key_make()

Commit c8e7b895 ("bgpd: use Jenkins hash for BGP transit, cluster and
attr hashes") changed attrhash_key_make() to use Jenkins hash, commit
c8f3fe30 ("bgpd: Remove AS Path limit/TTL functionality") introduced
a bogus change with a snippet of code that was deleted in the first
one.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
6 years agoMerge pull request #906 from opensourcerouting/vty-close
Russ White [Fri, 4 Aug 2017 17:14:43 +0000 (13:14 -0400)]
Merge pull request #906 from opensourcerouting/vty-close

lib: vty: fix config-write fd leak

6 years agoMerge pull request #867 from jbonor/fixes
Donald Sharp [Fri, 4 Aug 2017 16:57:35 +0000 (12:57 -0400)]
Merge pull request #867 from jbonor/fixes

Assorted fixes

6 years agoMerge pull request #913 from qlyoung/remove-powl
David Lamparter [Fri, 4 Aug 2017 16:19:25 +0000 (18:19 +0200)]
Merge pull request #913 from qlyoung/remove-powl

lib: remove last powl()

6 years agolib: remove last powl()
Quentin Young [Fri, 4 Aug 2017 14:58:00 +0000 (10:58 -0400)]
lib: remove last powl()

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #910 from opensourcerouting/isis-perf2
Donald Sharp [Fri, 4 Aug 2017 14:56:34 +0000 (10:56 -0400)]
Merge pull request #910 from opensourcerouting/isis-perf2

isisd: don't validate dict integrity for regular builds

6 years agoospfd: Fix MI-OSPF configuraton clis
Chirag Shah [Thu, 3 Aug 2017 23:34:17 +0000 (16:34 -0700)]
ospfd: Fix MI-OSPF configuraton clis

Multi-Instance OSPF configuration CLI would fail because
first client return error upon seeing qobj_index being 0.
With new marco generate new error code to return from each
instance (vtysh client) and if the command is intended for given
instance, its qobj_index would be nonzero and process the command
and push correct ospf context. Other instance would return the error.
On vtysh end, check all instance return an error log a message to a
file.

Testing Done:
Verfied various MI-OSPF configuration CLI with multi instances.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #908 from donaldsharp/safi
Renato Westphal [Fri, 4 Aug 2017 14:34:23 +0000 (11:34 -0300)]
Merge pull request #908 from donaldsharp/safi

bgpd: Fix safi_t confusion wition iana_safi_t

6 years agoisisd: don't validate dict integrity for regular builds
Christian Franke [Fri, 4 Aug 2017 13:44:45 +0000 (15:44 +0200)]
isisd: don't validate dict integrity for regular builds

This method is intended to be only used for debugging as per the author
and profiling shows we are spending a lot of cycles on it. Remove it for
regular builds by guarding it with a define.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: Convert to using prefix.h ETH_ALEN
Donald Sharp [Thu, 3 Aug 2017 12:46:00 +0000 (08:46 -0400)]
isisd: Convert to using prefix.h ETH_ALEN

Remove the #define for ETH_ALEN as well as ETHER_ADDR_LEN
and convert all uses to ETH_ALEN

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Convert to using ETH_ALEN
Donald Sharp [Thu, 3 Aug 2017 12:45:27 +0000 (08:45 -0400)]
bgpd: Convert to using ETH_ALEN

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoldpd: Switch to using ETH_ALEN
Donald Sharp [Thu, 3 Aug 2017 12:44:25 +0000 (08:44 -0400)]
ldpd: Switch to using ETH_ALEN

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Switch to using ETH_ALEN
Donald Sharp [Thu, 3 Aug 2017 12:43:56 +0000 (08:43 -0400)]
zebra: Switch to using ETH_ALEN

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Add ETH_ALEN to prefix.h and deprecate ETHER_ADDR_LEN
Donald Sharp [Thu, 3 Aug 2017 12:42:29 +0000 (08:42 -0400)]
lib: Add ETH_ALEN to prefix.h and deprecate ETHER_ADDR_LEN

From discussion we decided that we should use ETH_ALEN instead
of ETHER_ADDR_LEN.  Add ETH_ALEN to prefix.h and make
ETHER_ADDR_LEN generate a warning when used( but still work ).

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Fix crash when OOM happens.
Donald Sharp [Thu, 3 Aug 2017 11:43:47 +0000 (07:43 -0400)]
zebra: Fix crash when OOM happens.

The hash key function choosen for mac vni's would tend
to clump the key value to the same number.  Use a better
hash key generator to spread the hash values out.

A bad hash key might lead to O(2^n) memory consumption
because the hash size is doubled, each time a backet
exceeds a predefined threshold.  This quickly leads
to OOM.  Fixing this issue by fixing the hash
key generation to actually spread the keys out.

Ticket: CM-17412
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #909 from opensourcerouting/isis-perf
Donald Sharp [Fri, 4 Aug 2017 13:04:12 +0000 (09:04 -0400)]
Merge pull request #909 from opensourcerouting/isis-perf

IS-IS: improve spf performance

6 years agobgpd: Fix safi_t confusion wition iana_safi_t
Donald Sharp [Fri, 4 Aug 2017 11:45:44 +0000 (07:45 -0400)]
bgpd: Fix safi_t confusion wition iana_safi_t

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: vty: fix config-write fd leak
David Lamparter [Fri, 4 Aug 2017 10:05:38 +0000 (12:05 +0200)]
lib: vty: fix config-write fd leak

Since we were only setting vty->wfd in config_write, vty->fd would
remain 0 and vty_close() wouldn't close vty->wfd.

Clean up the entire fd closing and make it more explicit.  We were even
trying to write to stdin...

Reported-by: Jorge Boncompte <jbonor@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
6 years agonhrp: fix assertion with negative holding times
Jorge Boncompte [Thu, 3 Aug 2017 17:12:27 +0000 (19:12 +0200)]
nhrp: fix assertion with negative holding times

Correctly reset status or we later assert at nhrp_cache_free().

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
6 years agonhrp: fix initialization and route redistribution registration
Jorge Boncompte [Tue, 25 Jul 2017 11:15:15 +0000 (13:15 +0200)]
nhrp: fix initialization and route redistribution registration

nhrpd wasn't registering correctly with zebra for route redistribution.
It wasn't neither parsing the right messages nor parsing them correctly too.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
6 years agonhrp: initialize interfaces after VRFs
Jorge Boncompte [Tue, 25 Jul 2017 10:32:20 +0000 (12:32 +0200)]
nhrp: initialize interfaces after VRFs

Interfaces depend logically of VRF, initialize one after another just in
case in the future someone adds something to this functions.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
6 years agozebra: cleanup, use RIB_SYSTEM_ROUTE() define where appropiate
Jorge Boncompte [Thu, 27 Jul 2017 10:34:10 +0000 (12:34 +0200)]
zebra: cleanup, use RIB_SYSTEM_ROUTE() define where appropiate

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agoMerge pull request #891 from Jafaral/portability
David Lamparter [Fri, 4 Aug 2017 06:52:07 +0000 (08:52 +0200)]
Merge pull request #891 from Jafaral/portability

Portability configurations

6 years agoMerge pull request #900 from qlyoung/apply-mask
David Lamparter [Fri, 4 Aug 2017 06:49:20 +0000 (08:49 +0200)]
Merge pull request #900 from qlyoung/apply-mask

lib: add missed apply_mask()

6 years agoMerge pull request #870 from chiragshah6/mdev
David Lamparter [Fri, 4 Aug 2017 06:46:38 +0000 (08:46 +0200)]
Merge pull request #870 from chiragshah6/mdev

Fix various memory leaks in OSPFd and OSPF6d

6 years agoMerge pull request #901 from qlyoung/style-fix
ßingen [Thu, 3 Aug 2017 15:27:30 +0000 (17:27 +0200)]
Merge pull request #901 from qlyoung/style-fix

lib: minor style fix

6 years agolib: minor style fixes
Quentin Young [Thu, 3 Aug 2017 15:19:48 +0000 (11:19 -0400)]
lib: minor style fixes

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #897 from donaldsharp/pim_memory_leak
Jafar Al-Gharaibeh [Thu, 3 Aug 2017 15:23:55 +0000 (10:23 -0500)]
Merge pull request #897 from donaldsharp/pim_memory_leak

pimd: Squash some more memory leaks

6 years agolib: add missed apply_mask()
Quentin Young [Thu, 3 Aug 2017 14:57:31 +0000 (10:57 -0400)]
lib: add missed apply_mask()

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoisisd: Use a hashtable to speed up lookups during SPF
Christian Franke [Thu, 3 Aug 2017 12:30:32 +0000 (14:30 +0200)]
isisd: Use a hashtable to speed up lookups during SPF

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agolib: Reformat comment so my eyes don't fall out while reading it
Christian Franke [Thu, 3 Aug 2017 12:30:01 +0000 (14:30 +0200)]
lib: Reformat comment so my eyes don't fall out while reading it

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agolib: move prefix hash key to prefix.c to allow global use
Christian Franke [Thu, 3 Aug 2017 11:37:38 +0000 (13:37 +0200)]
lib: move prefix hash key to prefix.c to allow global use

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoMerge pull request #854 from opensourcerouting/isis-parser
Donald Sharp [Thu, 3 Aug 2017 10:46:00 +0000 (06:46 -0400)]
Merge pull request #854 from opensourcerouting/isis-parser

IS-IS: rewrite TLV deserializer/serializer

6 years agoisisd: make isis_spftree non-public
Christian Franke [Thu, 3 Aug 2017 09:45:58 +0000 (11:45 +0200)]
isisd: make isis_spftree non-public

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: purge LSP correctly on confusion
Christian Franke [Sun, 30 Jul 2017 17:49:19 +0000 (19:49 +0200)]
isisd: purge LSP correctly on confusion

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: only process overload info from fragment #0
Christian Franke [Sun, 30 Jul 2017 17:27:25 +0000 (19:27 +0200)]
isisd: only process overload info from fragment #0

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: Limit number of addresses in IPv4 addr TLV to 63
Christian Franke [Sun, 30 Jul 2017 17:03:57 +0000 (19:03 +0200)]
isisd: Limit number of addresses in IPv4 addr TLV to 63

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: rework complete, move "tlvs2" to "tlvs"
Christian Franke [Sun, 23 Jul 2017 13:06:09 +0000 (15:06 +0200)]
isisd: rework complete, move "tlvs2" to "tlvs"

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: send/receive LSPs with new parser
Christian Franke [Wed, 5 Jul 2017 16:37:36 +0000 (18:37 +0200)]
isisd: send/receive LSPs with new parser

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: send/receive *SNPs with new parser
Christian Franke [Fri, 23 Jun 2017 16:47:57 +0000 (18:47 +0200)]
isisd: send/receive *SNPs with new parser

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: send/receive IIHs with new parser
Christian Franke [Wed, 21 Jun 2017 13:21:00 +0000 (15:21 +0200)]
isisd: send/receive IIHs with new parser

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: Don't use structs to encode/decode PDU header
Christian Franke [Mon, 12 Jun 2017 12:31:40 +0000 (14:31 +0200)]
isisd: Don't use structs to encode/decode PDU header

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: add new tlv parser
Christian Franke [Mon, 8 May 2017 11:02:55 +0000 (13:02 +0200)]
isisd: add new tlv parser

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agoisisd: add formatter code
Christian Franke [Sat, 22 Jul 2017 11:57:05 +0000 (13:57 +0200)]
isisd: add formatter code

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agolib: add sbuf
Christian Franke [Mon, 8 May 2017 11:18:21 +0000 (13:18 +0200)]
lib: add sbuf

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agozebra: Missing break statement causes crash in zebra
Donald Sharp [Mon, 19 Jun 2017 22:24:24 +0000 (18:24 -0400)]
zebra: Missing break statement causes crash in zebra

Zebra receiving a macip_del message will automatically call
into the set_master function( a pim function ).  Add missing
break statement

Ticket: CM-16841
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
6 years agopimd: Squash some more memory leaks
Donald Sharp [Wed, 2 Aug 2017 17:16:51 +0000 (13:16 -0400)]
pimd: Squash some more memory leaks

When a interface is flapped we were leaking some memory
associated with link lists.  Especially in the jp_agg
code.  If your network was/is stable and you are not
running at any scale you probably would not see this
as impactful at all.

Ticket: CM-16392
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 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

6 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

6 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

6 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>
6 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>
6 years agoconfig: Disable pimd on OpenBSD 6.1
Jafar Al-Gharaibeh [Tue, 1 Aug 2017 21:26:01 +0000 (16:26 -0500)]
config: Disable pimd on OpenBSD 6.1

OpenBSD dropped support for PIM in 6.1. Error out if the user does not
disable pimd explicitly.

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 years agoconfig: On some platfroms json check fails if we don't link lm, no-op otherwise
Jafar Al-Gharaibeh [Tue, 1 Aug 2017 20:06:38 +0000 (15:06 -0500)]
config: On some platfroms json check fails if we don't link lm, no-op otherwise

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 years agoconfig: If we don't have crypt but we have ssl crypto, use it
Jafar Al-Gharaibeh [Tue, 1 Aug 2017 20:04:26 +0000 (15:04 -0500)]
config: If we don't have crypt but we have ssl crypto, use it

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
6 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

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

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

6 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

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

6 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

6 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

6 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

6 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

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agoospf6d: adjust changes per PR 870 review
Chirag Shah [Mon, 31 Jul 2017 20:12:33 +0000 (13:12 -0700)]
ospf6d: adjust changes per PR 870 review

called list_delete instead of list_free
Moved MTYPE_STATIC in ospfd/zebra.c
Revert changes in ospf6_zebra.c where malloc is called for
multiple nexthops.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 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.

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