Quentin Young [Thu, 10 Aug 2017 16:31:47 +0000 (12:31 -0400)]
lib, bgpd: fix `set ip next-hop peer-address`
This bgp-specific command had its positive form defined only in bgpd and
its negative form defined only in lib, which broke the whole rule for
other daemons.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
David Lamparter [Wed, 9 Aug 2017 18:30:34 +0000 (20:30 +0200)]
lib: some final MAC access-list fixes
- couldn't load back written configs because it was trying to parse
"any" as MAC address
- don't need special-casing in filter_match_zebra(), exact is going to
be 0 for AF_ETHERNET anyway
- some vty formatting was slightly different
- is_zero_mac now static to prefix.c
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Quentin Young [Wed, 9 Aug 2017 15:57:13 +0000 (11:57 -0400)]
lib: use load factor as hash expansion trigger
Previous strategy was to resize the hash table when the length of any
one bucket exceeded a certain size, with some logic for intelligently
stopping resizes when the gains from doing so weren't sufficient. While
this was a good idea that attempted to optimize both space and lookup
time, unfortunately under transient degenerate conditions this led to
some issues with the tables not resizing when they should have,
harming performance. The resizing restriction was lifted, but this had
the result of exacerbating degenerate behavior and caused out of memory
conditions.
This patch changes the hash expansion criterion to be based on the
number of elements in the table. Once the # of elements in the table
exceeds the number of buckets, the table size is doubled. While the
space efficiency of this method decreases relative to the perfectness of
the hash function, at least this strategy puts the table performance
squarely in the hands of the hash function.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Andrew Lunn [Wed, 9 Aug 2017 16:56:13 +0000 (11:56 -0500)]
eigrpd: Add missing install_element for debug eigrp transmit
debug eigrp transmit command is added to the ENABLE_NODE list, but not
CONFIG_NODE. As a result the command cannot be used in the
configuration file. Add the missing call.
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>
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.
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).
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.
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.
ß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.
ß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.
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.
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.
Donald Sharp [Fri, 7 Jul 2017 13:08:25 +0000 (09:08 -0400)]
bgpd: Fix output of interface based 'show bgp ..' commands
When issuing a 'show ip bgp' command and the nexthop is
a interface, if the interface name was greater than 7 characters
we would arbitrarily start a new-line and setup the next
line to start at the wrong spot.
Modify the interface field to allow 16 characters than 7( to
match v6 display ), and if the interface name is greater than
16 characters properly setup the next line for display
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Currently, FRR does not do any linking between local MACs and neighbors.
We found this necessary when dealing with centralized GW. A neigh is considered local only when the mac is learnt locally as well.
Mitesh Kanjariya [Wed, 28 Jun 2017 08:51:10 +0000 (01:51 -0700)]
bgpd/zebra/lib: EVPN support for asymmetric VxLan routing
1. Advertise gateway mac-ip in EVPN
2. Advertise VRR mac-ip in EVPN
3. Ignore gateway mac-ip advertisements in case of distributed gateway
4. Config knob to enable/disable gateway mac-ip advertisements
Mitesh Kanjariya [Wed, 21 Jun 2017 08:02:46 +0000 (01:02 -0700)]
bgpd, lib, vtysh: Added support for mac filtering in route-maps
1. Added support to create mac filters
2. Enabled route-map commands for EVPN address family
3. Provision to add mac filters under match clause in route-maps
Ticket: CM-16349
Review: CCR-6190
Unit-test: Manual (logs attached to ticket)
vivek [Wed, 7 Jun 2017 05:12:39 +0000 (22:12 -0700)]
bgpd: Fix nexthop for labeled-unicast
A prior change broke the nexthop setting for labeled-unicast
address-family in a RFC-5549 scenario (IPv4 prefixes exchanged
with IPv6 next hops). This commit fixes the issue.
Fixes: "bgpd: Fix next hop setting for EVPN" Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
David Lamparter [Sun, 6 Aug 2017 05:35:50 +0000 (07:35 +0200)]
*: remove --enable-tcp-zebra, rework ZAPI path
This adds "@tcp" as new choice on the -z option present in zebra and the
protocol daemons. The --enable-tcp-zebra option on configure is no
longer needed, both UNIX and TCP socket support is always available.
Note that @tcp should not be used by default (e.g. in an init script),
and --enable-tcp-zebra should never have been in any distro package
builds, because
**** TCP-ZEBRA IS A SECURITY PROBLEM ****
It allows arbitrary local users to mess with the routing table and
inject bogus data -- and also ZAPI is not designed to be robust against
attacks.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
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
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>
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>
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>