]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agozebra: Pay attention to metric from kernel
Donald Sharp [Wed, 9 Aug 2017 13:13:33 +0000 (09:13 -0400)]
zebra: Pay attention to metric from kernel

When the linux kernel adds/deletes routes, the
metric is important, but our routing protocols
add/delete in a slightly different manner,
so allow kernel metrics to match so that our
rib matches the kernel's fib.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge branch 'stable/3.0'
David Lamparter [Wed, 9 Aug 2017 12:35:17 +0000 (14:35 +0200)]
Merge branch 'stable/3.0'

... with a lot of fixups.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge branch 'stable/3.0' into tmp-3.0-master-merge
David Lamparter [Wed, 9 Aug 2017 11:13:01 +0000 (13:13 +0200)]
Merge branch 'stable/3.0' into tmp-3.0-master-merge

Marker (--strategy=ours) merge to record which point in history master
is in sync with related to stable/3.0.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: fix pseudowire code re. upstream changes
David Lamparter [Wed, 9 Aug 2017 10:37:45 +0000 (12:37 +0200)]
zebra: fix pseudowire code re. upstream changes

- VTY_NEWLINE is out
- thread API changed with the extra arg
- struct rib got renamed to struct route_entry
- MPLS_NO_LABEL was removed
- RB-tree implementation has some extra args

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: add support for static pseudowires
Renato Westphal [Tue, 1 Aug 2017 23:16:28 +0000 (20:16 -0300)]
zebra: add support for static pseudowires

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agorelease: FRR 3.0-rc1 frr-3.0-rc1
David Lamparter [Wed, 9 Aug 2017 10:56:09 +0000 (12:56 +0200)]
release: FRR 3.0-rc1

7 years agoldpd: fix missing label mappings
Renato Westphal [Thu, 6 Jul 2017 03:46:34 +0000 (00:46 -0300)]
ldpd: fix missing label mappings

In some scenarios, it's possible to send a Label Withdraw to a neighbor
and not receive a corresponding Label Release right away. This can happen
during reconvergence after a network failure or configuration change.

When this happens, the list of upstream mappings of a given FEC might
not be empty even after sending a Label Withdraw to all neighbors. This
situation holds until all neighbors either send a Label Release or are
torn down (e.g. keepalive timeout).

With that said, we shouldn't check for 'RB_EMPTY(&fn->upstream)'
in lde_kernel_update() because it can prevent ldpd from sending label
mappings in such circumstances. This check was introduced to avoid sending
the same label mapping more than once to the same neighbor, but we need
to remove this optimization for now until we find a better solution (which
probably involves refactoring the whole zebra<->ldpd communication).

While here, add a new debug message in lde_send_labelmapping() which
can aid in troubleshooting label problems in the future.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: add support to openbsd's mpw(4) for pseudowires
Renato Westphal [Fri, 30 Jun 2017 15:18:21 +0000 (12:18 -0300)]
zebra: add support to openbsd's mpw(4) for pseudowires

Thanks to rzalamena@ for writing mpw(4) :)

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoldpd: integrate with the pseudowire manager in zebra
Renato Westphal [Fri, 30 Jun 2017 15:19:39 +0000 (12:19 -0300)]
ldpd: integrate with the pseudowire manager in zebra

If we receive a notification from zebra indicating that the installation
of a pseudowire has failed (e.g. no reachability), send a PW Status
notification to the remote peer (or a Label Withdraw if the remote peer
doesn't support the PW Status TLV).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: add new flag to detect nexthop label updates
Renato Westphal [Thu, 8 Jun 2017 23:29:12 +0000 (20:29 -0300)]
zebra: add new flag to detect nexthop label updates

With the introduction of the pseudowire manager, the NHT tracking code
needs to detect label updates as well.

Create a specific nexthop flag for that. We can't reuse the
RIB_ENTRY_NEXTHOPS_CHANGED flag for this porpose because this flag is
always cleared and reevaluated in rib_process(), setting it outside that
function is a nop.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: add nexthop tracking for pseudowires
Renato Westphal [Fri, 30 Jun 2017 15:26:04 +0000 (12:26 -0300)]
zebra: add nexthop tracking for pseudowires

If the remote end of a pseudowire becomes unreachable (no route or an
unlabeled route), then it must be uninstalled. In the same way, when
the remote end becomes reachable, the pseudowire must be installed.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: add pseudowire manager
ßingen [Mon, 15 May 2017 15:09:28 +0000 (17:09 +0200)]
zebra: add pseudowire manager

Base framework for supporting MPLS pseudowires in FRR.

A consistent zserv interface is provided so that any client daemon
(e.g. ldpd, bgpd) can install/uninstall pseudowires in a standard
way. Static pseudowires can also be implemented by using the same
interface.

When zebra receives a request to install a pseudowire and the installation
in the kernel or hardware fails, a notification is sent back to the
client daemon and a new install attempt is made every 60 seconds (until
it succeeds).

Support for external dataplanes is provided by the use of hooks to
install/uninstall pseudowires.

Signed-off-by: ßingen <bingen@voltanet.io>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: add implicit-null labels to the rib
Renato Westphal [Tue, 6 Jun 2017 01:48:10 +0000 (22:48 -0300)]
zebra: add implicit-null labels to the rib

Implicit-null labels are never installed in the FIB but we need to keep
track of them because of L2/L3 VPN nexthop resolution.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge commit '78986c0' into tmp-3.0-master-merge
David Lamparter [Wed, 9 Aug 2017 10:09:04 +0000 (12:09 +0200)]
Merge commit '78986c0' into tmp-3.0-master-merge

Marker (--strategy=ours) merge to record which point in history master
is in sync with related to stable/3.0.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoospf: Fix segfault if compiled with DEBUG
ßingen [Tue, 1 Aug 2017 09:38:19 +0000 (11:38 +0200)]
ospf: Fix segfault if compiled with DEBUG

If OSPF_LS_REFRESH_TIME is 60, min_delay in ospf_refresher_register_lsa
function (ospf_lsa.c) would be negative, so index (which is unsigned)
would be out of range, causing a segfault.

Signed-off-by: ßingen <bingen@voltanet.io>
7 years agoospf6: Fix DEBUG compiling error
ßingen [Tue, 1 Aug 2017 09:34:15 +0000 (11:34 +0200)]
ospf6: Fix DEBUG compiling error

struct ospf6_lsa doesn't have next nor prev, so it was raising a
compiling error if DEBUG is set.

Signed-off-by: ßingen <bingen@voltanet.io>
7 years agoldpd: fix bug with dual-stack neighbors
Renato Westphal [Mon, 24 Jul 2017 21:57:20 +0000 (18:57 -0300)]
ldpd: fix bug with dual-stack neighbors

We were assuming that a neighbor can be deleted only when all of its
adjacencies are dead. This is not the case for dual-stack neighbors. If
the transport-preference is IPv4 and all adjacencies are IPv6 (or
vice-versa), then it should be deleted and everything cleaned-up
accordingly.

Bug exposed by the new RB tree implementation on master, but the fix
also applies to stable/3.0.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: fetch interface speed on *BSD
Renato Westphal [Fri, 21 Jul 2017 18:09:58 +0000 (15:09 -0300)]
zebra: fetch interface speed on *BSD

Fixes #407 for FreeBSD and NetBSD.

OpenBSD uses ioctl to fetch interface information on startup and the
SIOCGIFMEDIA command is just too cumbersome to use.

The best way to fix the problem for OpenBSD is probably to stop treating
it differently from the other BSDs for no apparent reason.  There should
be nothing preventing us to make OpenBSD use the routing socket to fetch
interface information on startup (we already do it to detect runtime
changes). This is something that should be done in a separate commit
after a careful analysis.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years ago*: reindent reindent-3.0-after
whitespace / reindent [Wed, 9 Aug 2017 09:49:42 +0000 (11:49 +0200)]
*: reindent

indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #930 from qlyoung/fix-masters-list-reachable
Lou Berger [Tue, 8 Aug 2017 17:58:06 +0000 (13:58 -0400)]
Merge pull request #930 from qlyoung/fix-masters-list-reachable

lib: fix still reachable linked list in thread.c

7 years agoMerge pull request #920 from opensourcerouting/static-routes-ifindex-update-3.0 reindent-3.0-before
Donald Sharp [Tue, 8 Aug 2017 17:39:38 +0000 (13:39 -0400)]
Merge pull request #920 from opensourcerouting/static-routes-ifindex-update-3.0

[3.0] fixup static routes' ifindexes when interfaces (dis)appear

7 years agoMerge pull request #919 from opensourcerouting/static-routes-ifindex-update
Donald Sharp [Tue, 8 Aug 2017 17:39:19 +0000 (13:39 -0400)]
Merge pull request #919 from opensourcerouting/static-routes-ifindex-update

fixup static routes' ifindexes when interfaces (dis)appear

7 years agolib: fix still reachable linked list in thread.c
Quentin Young [Tue, 8 Aug 2017 16:54:28 +0000 (12:54 -0400)]
lib: fix still reachable linked list in thread.c

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #927 from donaldsharp/one_day_second
David Lamparter [Tue, 8 Aug 2017 14:19:29 +0000 (16:19 +0200)]
Merge pull request #927 from donaldsharp/one_day_second

*: Define the number of seconds in a Day, Week and year

7 years ago*: Define the number of seconds in a Day, Week and year
Donald Sharp [Tue, 8 Aug 2017 12:24:17 +0000 (08:24 -0400)]
*: Define the number of seconds in a Day, Week and year

The defines:

ONE_DAY_SECOND
ONE_WEEK_SECOND
ONE_YEAR_SECOND

were being defined all over the system, move the
define to a central location.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #783 from opensourcerouting/pw-manager-2
Donald Sharp [Tue, 8 Aug 2017 11:54:32 +0000 (07:54 -0400)]
Merge pull request #783 from opensourcerouting/pw-manager-2

Add Pseudowire management in Zebra

7 years agoMerge pull request #924 from qlyoung/deprecate-ospf-lsa-min-arrival
David Lamparter [Tue, 8 Aug 2017 02:17:00 +0000 (04:17 +0200)]
Merge pull request #924 from qlyoung/deprecate-ospf-lsa-min-arrival

ospfd: deprecate `timers lsa arrival ...`

7 years agoMerge pull request #923 from devicenull/master
David Lamparter [Tue, 8 Aug 2017 02:16:08 +0000 (04:16 +0200)]
Merge pull request #923 from devicenull/master

rhel: Don't obsolete bird

7 years agoMerge pull request #925 from qlyoung/ldpd-no-str
Renato Westphal [Mon, 7 Aug 2017 21:27:52 +0000 (18:27 -0300)]
Merge pull request #925 from qlyoung/ldpd-no-str

ldpd: use NO_STR

7 years agoldpd: use NO_STR
Quentin Young [Mon, 7 Aug 2017 20:22:59 +0000 (16:22 -0400)]
ldpd: use NO_STR

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospfd: deprecate `timers lsa arrival ...`
Quentin Young [Mon, 7 Aug 2017 20:11:10 +0000 (16:11 -0400)]
ospfd: deprecate `timers lsa arrival ...`

Don't need two of these that do the exact same thing.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agorhel: Don't obsolete bird
Brian Rak [Mon, 7 Aug 2017 18:37:21 +0000 (14:37 -0400)]
rhel: Don't obsolete bird

The FRR RPM was obsoleting BIRD, which meant that as soon as you added a FRR RPM to a repository, you could no longer install BIRD.  This patch switches it over to Conflicts instead, which should be much nicer behavior

7 years agoMerge pull request #922 from qlyoung/pim-cli
Jafar Al-Gharaibeh [Mon, 7 Aug 2017 18:19:11 +0000 (13:19 -0500)]
Merge pull request #922 from qlyoung/pim-cli

pimd: some pim cli fixes

7 years agopimd: some pim cli fixes
Quentin Young [Mon, 7 Aug 2017 16:42:05 +0000 (12:42 -0400)]
pimd: some pim cli fixes

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #916 from donaldsharp/eigrp_various
Jafar Al-Gharaibeh [Mon, 7 Aug 2017 16:22:36 +0000 (11:22 -0500)]
Merge pull request #916 from donaldsharp/eigrp_various

Eigrp various

7 years agoMerge pull request #903 from donaldsharp/pimble
Jafar Al-Gharaibeh [Mon, 7 Aug 2017 16:20:39 +0000 (11:20 -0500)]
Merge pull request #903 from donaldsharp/pimble

Pimble

7 years agoMerge pull request #921 from opensourcerouting/vty-varname-end-tkn
Quentin Young [Mon, 7 Aug 2017 14:33:15 +0000 (10:33 -0400)]
Merge pull request #921 from opensourcerouting/vty-varname-end-tkn

lib: cli: don't run off graph "pre-end"

7 years agolib: cli: don't run off graph "pre-end"
David Lamparter [Mon, 7 Aug 2017 13:05:34 +0000 (15:05 +0200)]
lib: cli: don't run off graph "pre-end"

Behind END_TKN, there is another graph node whose data pointer is
actually struct cmd_element instead of struct cmd_token.  Don't try to
interpret that as cmd_token.  This causes very interesting crashes when
ASLR decides to give one of the strings of a command definition a lower
32-bit value that is a valid cmd_token_type (e.g. FORK_TKN).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #918 from opensourcerouting/vtysh-miss-newline
Donald Sharp [Mon, 7 Aug 2017 12:39:08 +0000 (08:39 -0400)]
Merge pull request #918 from opensourcerouting/vtysh-miss-newline

vtysh: add missing \n on warning message

7 years agozebra: vrf: remove VRF-move static route updating
David Lamparter [Sun, 6 Aug 2017 05:50:18 +0000 (07:50 +0200)]
zebra: vrf: remove VRF-move static route updating

This was incorrectly implemented to begin with (it only re-added routes,
but didn't remove them) and is now covered in static_ifindex_update.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: vrf: remove VRF-move static route updating
David Lamparter [Sun, 6 Aug 2017 05:50:18 +0000 (07:50 +0200)]
zebra: vrf: remove VRF-move static route updating

This was incorrectly implemented to begin with (it only re-added routes,
but didn't remove them) and is now covered in static_ifindex_update.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: static: update on ifindex changes
David Lamparter [Sun, 6 Aug 2017 03:14:39 +0000 (05:14 +0200)]
zebra: static: update on ifindex changes

Whenever an interface is created or deleted in the system, we need to
check whether we have static routes referencing that interface by name.
If so, we need to [un]install these routes.

This has the unfortunate side effect of making static routes with
non-existent interfaces disappear from "show ip route", but I think
that's acceptable (and I don't see a "good" fix for that).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: static: rename IFINDEX -> IFNAME
David Lamparter [Sun, 6 Aug 2017 02:32:55 +0000 (04:32 +0200)]
zebra: static: rename IFINDEX -> IFNAME

Static routes are really held by ifname, not ifindex.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: static: update on ifindex changes
David Lamparter [Sun, 6 Aug 2017 03:14:39 +0000 (05:14 +0200)]
zebra: static: update on ifindex changes

Whenever an interface is created or deleted in the system, we need to
check whether we have static routes referencing that interface by name.
If so, we need to [un]install these routes.

This has the unfortunate side effect of making static routes with
non-existent interfaces disappear from "show ip route", but I think
that's acceptable (and I don't see a "good" fix for that).

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: static: rename IFINDEX -> IFNAME
David Lamparter [Sun, 6 Aug 2017 02:32:55 +0000 (04:32 +0200)]
zebra: static: rename IFINDEX -> IFNAME

Static routes are really held by ifname, not ifindex.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 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>
7 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

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

7 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>
7 years agoeigrpd: Fix crash and attempt to send data
Donald Sharp [Tue, 25 Jul 2017 23:32:51 +0000 (19:32 -0400)]
eigrpd: Fix crash and attempt to send data

This code fixes a crash in EIGRP when on initial
neighbor formation we need to send more than 1 packet
of data to the nbr.

I was testing this by redistributing connected
and just adding a bunch of /32 address to
an interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Fix a md5 digest issue
Donald Sharp [Wed, 10 May 2017 23:45:40 +0000 (19:45 -0400)]
eigrpd: Fix a md5 digest issue

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Fix argv_find return code confusion
Donald Sharp [Wed, 10 May 2017 00:50:46 +0000 (20:50 -0400)]
eigrpd: Fix argv_find return code confusion

argv_find when it finds a match, returns 1 not 0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 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()

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

7 years agoMerge pull request #907 from opensourcerouting/vty-close-3.0
Russ White [Fri, 4 Aug 2017 17:14:18 +0000 (13:14 -0400)]
Merge pull request #907 from opensourcerouting/vty-close-3.0

[3.0] lib: vty: fix config-write fd leak

7 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

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

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

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

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

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

[master commit: 10b8a9c]
Reported-by: Jorge Boncompte <jbonor@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 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>
7 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>
7 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>
7 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>
7 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>
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 #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

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

7 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

7 years agopimd: Fix crash on iface down due to secondary address list
Donald Sharp [Thu, 3 Aug 2017 22:05:47 +0000 (18:05 -0400)]
pimd: Fix crash on iface down due to secondary address list

The secondary address list was being added/removed as
we went.  I see no reason to have special bookkeeping
for this list.  Just add it on interface startup and
then remove it on deletion.  Removes some
very specialized coding that was saving a very small
amount of space.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Lookup S,G ifchannel after we create it
Donald Sharp [Thu, 3 Aug 2017 14:56:30 +0000 (10:56 -0400)]
pimd: Lookup S,G ifchannel after we create it

There are situations where we receive a *,G with
a S,G,RPT Prune embedded where we do not actually
have any S,G yet(MSDP with multiple RP's with the
same address).  As such since we only need to
lookup the S,G ifchannel once, do it after
the recv_prune.

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

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

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