]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agoeigrpd: Use FSM for interface pe already known.
Donald Sharp [Wed, 23 Aug 2017 17:26:50 +0000 (13:26 -0400)]
eigrpd: Use FSM for interface pe already known.

There exists a case where a switch already has
a eigrp_prefix_entry for a interface that is
coming up.

In this situation, we need to use the FSM
to let the connected route take precedence
instead of blindly just updating the world
about it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: No need to create TLV type
Donald Sharp [Tue, 22 Aug 2017 23:48:23 +0000 (19:48 -0400)]
eigrpd: No need to create TLV type

There is no need to create a TLV type to pass in for the
FSM message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Remove union from FSM msg
Donald Sharp [Tue, 22 Aug 2017 23:19:10 +0000 (19:19 -0400)]
eigrpd: Remove union from FSM msg

Remove the union of passing the TLV and just pass the metric in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Improve external route distance comparison
Donald Sharp [Tue, 22 Aug 2017 20:24:23 +0000 (16:24 -0400)]
eigrpd: Improve external route distance comparison

If the new nexthop is external while the previous
best was Internal or Connected, it should always loose.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: make fsm msg data_type an enum
Donald Sharp [Tue, 22 Aug 2017 20:19:23 +0000 (16:19 -0400)]
eigrpd: make fsm msg data_type an enum

We need to eventually be able to handle multiple
data types to figure out if the distance is better
worse.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Refactor FSM calling
Donald Sharp [Tue, 22 Aug 2017 19:43:30 +0000 (15:43 -0400)]
eigrpd: Refactor FSM calling

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Fix memory leak in FSM
Donald Sharp [Tue, 22 Aug 2017 19:39:18 +0000 (15:39 -0400)]
eigrpd: Fix memory leak in FSM

The FSM was never freeing the msg.  Since we
do not have a special queue for it, just don't
allocate the memory.  In the future we can put
this back.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Cleanup list accessors
Donald Sharp [Tue, 22 Aug 2017 18:53:14 +0000 (14:53 -0400)]
eigrpd: Cleanup list accessors

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Remove unnecessary check
Donald Sharp [Tue, 22 Aug 2017 18:42:43 +0000 (14:42 -0400)]
eigrpd: Remove unnecessary check

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Start split-horizon
Donald Sharp [Tue, 22 Aug 2017 18:40:24 +0000 (14:40 -0400)]
eigrpd: Start split-horizon

EIGRP was not handling split-horizon.  This code starts
down the path of properly considering it.  There still
exists situations where we are not properly handling it
though.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1022 from opensourcerouting/zapi_consolidation
Donald Sharp [Thu, 24 Aug 2017 10:03:55 +0000 (06:03 -0400)]
Merge pull request #1022 from opensourcerouting/zapi_consolidation

Zapi consolidation

7 years agolib: mark the old zebra API for route advertisement as deprecated
Renato Westphal [Wed, 23 Aug 2017 22:12:48 +0000 (19:12 -0300)]
lib: mark the old zebra API for route advertisement as deprecated

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoospf6d: fix regression detected by topotest
Renato Westphal [Mon, 21 Aug 2017 22:43:43 +0000 (19:43 -0300)]
ospf6d: fix regression detected by topotest

With the old API, ospf6d always needed to send a nexthop address and a
nexthop interface when advertising a route to zebra. In the case where
the nexthop address didn't exist (e.g. connected route), zebra would
take care of ignore it in the zread_ipv6_add() function.

Now, if we have a nexthop interface but not a nexthop address, we not
only can but we should send a nexthop of type NEXTHOP_TYPE_IFINDEX. zebra
won't fix bad nexthops anymore because the clients have a proper API to
send correct messages.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years ago*: use zapi_route to send/receive redistributed routes as well
Renato Westphal [Mon, 21 Aug 2017 01:10:50 +0000 (22:10 -0300)]
*: use zapi_route to send/receive redistributed routes as well

Some differences compared to the old API:
* Now the redistributed routes are sent using address-family
  independent messages (ZEBRA_REDISTRIBUTE_ROUTE_ADD and
  ZEBRA_REDISTRIBUTE_ROUTE_DEL). This allows us to unify the ipv4/ipv6
  zclient callbacks in the client daemons and thus remove a lot of
  duplicate code;

* Now zebra sends all nexthops of the redistributed routes to the client
  daemons, not only the first one. This shouldn't have any noticeable
  performance implications and will allow us to remove an ugly exception
  we had for ldpd (which needs to know all nexthops of the redistributed
  routes). The other client daemons can simply ignore the nexthops if
  they want or consult just the first one (e.g. ospfd/ospf6d/ripd/ripngd).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: unify ipv4/ipv6 zebra-tx functions
Renato Westphal [Mon, 21 Aug 2017 00:36:44 +0000 (21:36 -0300)]
bgpd: unify ipv4/ipv6 zebra-tx functions

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agonhrpd: unify ipv4/ipv6 zebra-tx functions
Renato Westphal [Mon, 21 Aug 2017 00:36:35 +0000 (21:36 -0300)]
nhrpd: unify ipv4/ipv6 zebra-tx functions

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoisisd: unify ipv4/ipv6 zebra-tx functions
Renato Westphal [Mon, 21 Aug 2017 00:29:35 +0000 (21:29 -0300)]
isisd: unify ipv4/ipv6 zebra-tx functions

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobgpd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:19:25 +0000 (21:19 -0300)]
bgpd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #1026 from qlyoung/no-ospf6
David Lamparter [Wed, 23 Aug 2017 22:24:57 +0000 (00:24 +0200)]
Merge pull request #1026 from qlyoung/no-ospf6

ospf6d: add `no` forms for interface commands

7 years agoospf6d: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:19:07 +0000 (21:19 -0300)]
ospf6d: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoospfd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:18:58 +0000 (21:18 -0300)]
ospfd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agonhrpd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:18:50 +0000 (21:18 -0300)]
nhrpd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoisisd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:18:36 +0000 (21:18 -0300)]
isisd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoeigrpd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:17:59 +0000 (21:17 -0300)]
eigrpd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoripd/ripngd: use the new API to send routes to zebra
Renato Westphal [Mon, 21 Aug 2017 00:17:09 +0000 (21:17 -0300)]
ripd/ripngd: use the new API to send routes to zebra

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozapi: add support for routes with multiple labels
Renato Westphal [Sun, 20 Aug 2017 22:57:36 +0000 (19:57 -0300)]
zapi: add support for routes with multiple labels

This will be necessary for the Segment Routing feature.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobabeld: unify kernel_route_v4() and kernel_route_v6()
Renato Westphal [Sun, 20 Aug 2017 01:31:32 +0000 (22:31 -0300)]
babeld: unify kernel_route_v4() and kernel_route_v6()

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib/zserv: introduce address-family independent ZAPI message types
Renato Westphal [Sun, 20 Aug 2017 00:59:41 +0000 (21:59 -0300)]
lib/zserv: introduce address-family independent ZAPI message types

As noticed in 657cde1, the zapi_ipv[4|6]_route functions are broken in
many ways and that's the reason that many client daemons (e.g. ospfd,
isisd) need to send handcrafted messages to zebra.

The zapi_route() function introduced by Donald solves the problem
by providing a consistent way to send ipv4/ipv6 routes to zebra with
nexthops of any type, in all possible combinations including IPv4 routes
with IPv6 nexthops (for BGP unnumbered routes).

This patch goes a bit further and creates two new address-family
independent ZAPI message types that the client daemons can
use to advertise route information to zebra: ZEBRA_ROUTE_ADD and
ZEBRA_ROUTE_DELETE. The big advantage of having address-family independent
messages is that it allows us to remove a lot of duplicate code in zebra
and in the client daemons.

This patch also introduces the zapi_route_decode() function. It will be
used by zebra to decode route messages sent by the client daemons using
zclient_route_send(), which calls zapi_route_encode().

Later on we'll use this same pair of encode/decode functions to
send/receive redistributed routes from zebra to the client daemons,
taking the idea of removing code duplication to the next level.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: updates to zapi_route
Renato Westphal [Sun, 20 Aug 2017 00:25:12 +0000 (21:25 -0300)]
lib: updates to zapi_route

This patch introduces the following changes to the zapi_route structure
and associated code:
* Use a fixed-size array to store the nexthops instead of a pointer. This
  makes the zapi_route() function much easier to use when we have multiple
  nexthops to send. It's also much more efficient to put everything on
  the stack rather than allocating an array in the heap every time we
  need to send a route to zebra;

* Use the new 'zapi_nexthop' structure. This will allow the client daemons
  to send labeled routes without having to allocate memory for the labels
  (the 'nexthop' structure was designed to be memory efficient and doesn't
  have room for MPLS labels, only a pointer). Also, 'zapi_nexthop' is more
  compact and more clean from an API perspective;

* Embed the route prefix inside the zapi_route structure. Since the
  route's prefix is sent along with its nexthops and attributes, it makes
  sense to pack everything inside the same structure.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozserv: identify label type based on the client protocol
Renato Westphal [Sat, 19 Aug 2017 23:00:25 +0000 (20:00 -0300)]
zserv: identify label type based on the client protocol

This fixes a problem where the type of the BGP-LU labels was not
being set.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozserv: simplify handling of route delete requests
Renato Westphal [Sat, 19 Aug 2017 17:26:00 +0000 (14:26 -0300)]
zserv: simplify handling of route delete requests

Route attributes like tag, distance and metric are irrelevant when we
want to delete a route from a client daemon. The same can be said about
the nexthops of the route. Only the IP prefix and client protocol are
enough to identify the route we want to remove, considering that zebra
maintains at most one route from each client daemon for each prefix. Once
rib_delete() is called, it deletes the selected route with all of its
nexthops.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobabeld/eigrpd/ldpd/nhrpd: add prefix length sanity checks
Renato Westphal [Sat, 19 Aug 2017 17:12:20 +0000 (14:12 -0300)]
babeld/eigrpd/ldpd/nhrpd: add prefix length sanity checks

Pulled from d917882.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: add support for NEXTHOP_TYPE_IPV6_IFINDEX in zserv
Renato Westphal [Sat, 19 Aug 2017 16:01:00 +0000 (13:01 -0300)]
zebra: add support for NEXTHOP_TYPE_IPV6_IFINDEX in zserv

This is the v6 counterpart of commit c963c20.

Fixes a bug where ipv6 routes received from babeld were being ignored.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agobabeld/nhrpd: ignore ipv6 srcdest routes
Renato Westphal [Sat, 19 Aug 2017 15:09:38 +0000 (12:09 -0300)]
babeld/nhrpd: ignore ipv6 srcdest routes

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years ago*: remove leftovers from "router zebra"
Renato Westphal [Sat, 19 Aug 2017 14:38:47 +0000 (11:38 -0300)]
*: remove leftovers from "router zebra"

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agovnc/eigrpd/isisd: check for the correct message types
Renato Westphal [Sat, 19 Aug 2017 14:28:21 +0000 (11:28 -0300)]
vnc/eigrpd/isisd: check for the correct message types

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: remove redundant zebra messages
Renato Westphal [Sat, 19 Aug 2017 14:20:42 +0000 (11:20 -0300)]
lib: remove redundant zebra messages

This also fixes a bug of ipv6 routes advertised by the VNC code being
ignored by zebra.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years ago*: reduce excessive indentation in a few places
Renato Westphal [Sat, 12 Aug 2017 16:03:29 +0000 (13:03 -0300)]
*: reduce excessive indentation in a few places

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #1030 from opensourcerouting/bgpd-fd-leak
Quentin Young [Wed, 23 Aug 2017 19:45:53 +0000 (15:45 -0400)]
Merge pull request #1030 from opensourcerouting/bgpd-fd-leak

bgpd: fix file descriptor leak

7 years agobgpd: fix file descriptor leak
Renato Westphal [Tue, 22 Aug 2017 23:09:26 +0000 (20:09 -0300)]
bgpd: fix file descriptor leak

Bug introduced by commit 37d361e7. Removing the call to bgp_close()
from bgp_delete() was a mistake.

Reported-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoMerge pull request #1028 from opensourcerouting/mpls_label_stack
Donald Sharp [Tue, 22 Aug 2017 22:25:23 +0000 (18:25 -0400)]
Merge pull request #1028 from opensourcerouting/mpls_label_stack

zebra: increase maximum label stack depth

7 years agozebra: increase maximum label stack depth
Renato Westphal [Tue, 22 Aug 2017 20:01:54 +0000 (17:01 -0300)]
zebra: increase maximum label stack depth

* Bump MPLS_MAX_LABELS from 2 to 16;
* Adjust the static_nh_label structure and the mpls_label2str() function;
* On OpenBSD, print an error message when trying to push more than one
  label at once (kernel limitation). While here, add support for MPLSv6
  FTNs in OpenBSD.

This is not the full package. We still can't pop multiple labels at once,
or do things like swap a label and push other ones. We'll address that
in the future.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agoospf6d: add `no` forms for interface commands
Quentin Young [Tue, 22 Aug 2017 16:29:53 +0000 (12:29 -0400)]
ospf6d: add `no` forms for interface commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #1025 from qlyoung/no-ospf
David Lamparter [Tue, 22 Aug 2017 15:55:01 +0000 (17:55 +0200)]
Merge pull request #1025 from qlyoung/no-ospf

ospfd, ospf6d: cleanup some `no` commands

7 years agoMerge pull request #1023 from opensourcerouting/route-node-const
Donald Sharp [Tue, 22 Aug 2017 15:44:45 +0000 (11:44 -0400)]
Merge pull request #1023 from opensourcerouting/route-node-const

lib: fix const-check in route_node

7 years agoMerge pull request #1024 from opensourcerouting/minor_fixes
Quentin Young [Tue, 22 Aug 2017 15:21:02 +0000 (11:21 -0400)]
Merge pull request #1024 from opensourcerouting/minor_fixes

Minor fixes

7 years agoospfd, ospf6d: cleanup some `no` commands
Quentin Young [Tue, 22 Aug 2017 14:55:12 +0000 (10:55 -0400)]
ospfd, ospf6d: cleanup some `no` commands

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoisisd: return proper error codes in some commands
Renato Westphal [Tue, 22 Aug 2017 14:18:10 +0000 (11:18 -0300)]
isisd: return proper error codes in some commands

CMD_ERR_AMBIGUOUS should only be used internally by the CLI.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: redistribute srcdest routes to the client daemons
Renato Westphal [Tue, 22 Aug 2017 13:57:55 +0000 (10:57 -0300)]
zebra: redistribute srcdest routes to the client daemons

Somehow we missed these bits from the original srcdest patchset.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agozebra: fix display of static routes pointing to nonexistent interfaces
Renato Westphal [Tue, 22 Aug 2017 13:52:07 +0000 (10:52 -0300)]
zebra: fix display of static routes pointing to nonexistent interfaces

Bug introduced a couple of weeks ago by myself. Only happens when the
route has an IP nexthop + a nexthop interface.

Example:
debian(config)# ip route 10.0.1.0/24 172.16.1.10 fake1
debian(config)# do sh run
Building configuration...
[snip]
!
ip route 10.0.1.0/24 172.16.1.10 unknown
!
end

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
7 years agolib: fix const-check in route_node
David Lamparter [Tue, 22 Aug 2017 13:27:08 +0000 (15:27 +0200)]
lib: fix const-check in route_node

route_node->lock is "const" if --enable-dev-build is used.  This is done
to deter people from messing with internals of the route_table...
unfortunately, the inline'd route_[un]lock_node runs into this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #939 from jbonor/optimization
Lou Berger [Tue, 22 Aug 2017 13:01:20 +0000 (09:01 -0400)]
Merge pull request #939 from jbonor/optimization

Optimization

7 years agoMerge pull request #1012 from donaldsharp/eigrp_send_version
David Lamparter [Tue, 22 Aug 2017 12:59:22 +0000 (14:59 +0200)]
Merge pull request #1012 from donaldsharp/eigrp_send_version

eigrpd: Setup eigrp to send FRR version

7 years agoMerge pull request #1016 from opensourcerouting/cli-minor
Donald Sharp [Tue, 22 Aug 2017 12:54:18 +0000 (08:54 -0400)]
Merge pull request #1016 from opensourcerouting/cli-minor

minor cli foo (hashtable stats, pseudowire show)

7 years agoMerge pull request #1021 from opensourcerouting/privs-terminate
Lou Berger [Mon, 21 Aug 2017 20:55:33 +0000 (16:55 -0400)]
Merge pull request #1021 from opensourcerouting/privs-terminate

zprivs terminate

7 years agolib: terminate capabilities only if initialized
David Lamparter [Mon, 21 Aug 2017 18:17:53 +0000 (20:17 +0200)]
lib: terminate capabilities only if initialized

zprivs_caps_init() is called conditionally, apply the same condition on
terminate.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobgpd: don't zprivs_terminate() twice
David Lamparter [Mon, 21 Aug 2017 18:05:51 +0000 (20:05 +0200)]
bgpd: don't zprivs_terminate() twice

zprivs_terminate() is called from bgp_exit()

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agobuild: fix --disable-snmp
David Lamparter [Mon, 31 Jul 2017 20:34:26 +0000 (22:34 +0200)]
build: fix --disable-snmp

--disable-foo results in "no" as value in $enable_foo

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agolib: move hashstats under debug, show per-daemon
David Lamparter [Mon, 21 Aug 2017 12:34:31 +0000 (14:34 +0200)]
lib: move hashstats under debug, show per-daemon

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: put pseudowire show cmd under mpls
David Lamparter [Fri, 18 Aug 2017 11:10:36 +0000 (13:10 +0200)]
zebra: put pseudowire show cmd under mpls

Let's group this where it belongs and not clutter the commands too much.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #1009 from donaldsharp/show_cmds
David Lamparter [Mon, 21 Aug 2017 12:30:41 +0000 (14:30 +0200)]
Merge pull request #1009 from donaldsharp/show_cmds

Show cmds

7 years agoMerge pull request #1008 from donaldsharp/check_for_daemon_existence
David Lamparter [Mon, 21 Aug 2017 12:23:15 +0000 (14:23 +0200)]
Merge pull request #1008 from donaldsharp/check_for_daemon_existence

tools: Always ensure that the daemon exists at startup

7 years agoMerge pull request #1007 from donaldsharp/clear_help_str
David Lamparter [Mon, 21 Aug 2017 12:22:54 +0000 (14:22 +0200)]
Merge pull request #1007 from donaldsharp/clear_help_str

bgpd: Fix bgp clear help string

7 years agoMerge pull request #1002 from dwalton76/vtysh-exit-non-zero
David Lamparter [Mon, 21 Aug 2017 12:22:35 +0000 (14:22 +0200)]
Merge pull request #1002 from dwalton76/vtysh-exit-non-zero

vtysh: vtysh -f FOO should exit non-zero if it hits an error

7 years agoMerge pull request #929 from opensourcerouting/hooks-doc-irdp
Donald Sharp [Mon, 21 Aug 2017 11:47:17 +0000 (07:47 -0400)]
Merge pull request #929 from opensourcerouting/hooks-doc-irdp

hook improvements, more hooks, doc example, IRDP cleanup

7 years ago*: Add 'show debugging' command from vtysh
Donald Sharp [Fri, 18 Aug 2017 16:50:13 +0000 (12:50 -0400)]
*: Add 'show debugging' command from vtysh

Allow vtysh to query every daemon about its
debugging status in one go.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agovtysh: Convert 'show logging' to use helper function.
Donald Sharp [Fri, 18 Aug 2017 15:12:31 +0000 (11:12 -0400)]
vtysh: Convert 'show logging' to use helper function.

The 'show logging' command was not using the 'show_per_daemon'
function for some reason.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1013 from donaldsharp/versions
Donnie Savage [Sun, 20 Aug 2017 11:55:54 +0000 (07:55 -0400)]
Merge pull request #1013 from donaldsharp/versions

Changes look fine

7 years agoMerge pull request #1014 from diivious/ext-crash
Donald Sharp [Sun, 20 Aug 2017 10:21:14 +0000 (06:21 -0400)]
Merge pull request #1014 from diivious/ext-crash

Fixed issue with eigrp crashing when an external is received

7 years agoeigrpd: fix crash when external route is received
Donnie Savage (dsavage) [Sun, 20 Aug 2017 01:32:26 +0000 (21:32 -0400)]
eigrpd: fix crash when external route is received

    When an external route is received, eigrpd will crash. For now,
    quietly discard the TLV. Work must be done to handle tlv
    processing and changes needed to FSM so it understands an
    external should not be chooses if an internal exist.

Signed-off-by: Donnie Savage <diivious@hotmail.com>
7 years agoisisd: Remove unused version
Donald Sharp [Sun, 20 Aug 2017 01:23:14 +0000 (21:23 -0400)]
isisd: Remove unused version

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoospf6d: Remove ospf6d version string
Donald Sharp [Sun, 20 Aug 2017 01:21:00 +0000 (21:21 -0400)]
ospf6d: Remove ospf6d version string

This version string has not been updated in over 11 years.
I cannot see any viable reason that we should use or update
or anything with this value, remove.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Fix code comments
Donald Sharp [Sun, 20 Aug 2017 01:07:54 +0000 (21:07 -0400)]
eigrpd: Fix code comments

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Setup eigrp to send FRR version
Donald Sharp [Sun, 20 Aug 2017 00:56:50 +0000 (20:56 -0400)]
eigrpd: Setup eigrp to send FRR version

Send to our peer the major/minor version of FRR that we are
working with.  I decided to use FRR instead of the os major/minor
because the os itself doesn't tell you what version of EIGRP
you are actually using.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1011 from donaldsharp/tlv_crash
Donnie Savage [Sun, 20 Aug 2017 00:39:45 +0000 (20:39 -0400)]
Merge pull request #1011 from donaldsharp/tlv_crash

Tlv crash

7 years agoeigrpd: Pass in actual used parameter to header creation
Donald Sharp [Sat, 19 Aug 2017 18:38:17 +0000 (14:38 -0400)]
eigrpd: Pass in actual used parameter to header creation

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Allow eigrp_update_send to recognize a full packet
Donald Sharp [Sat, 19 Aug 2017 18:15:34 +0000 (14:15 -0400)]
eigrpd: Allow eigrp_update_send to recognize a full packet

Modify code to allow the eigrp_update_send function to
recognize that we have a full packet and to do the right
thing from there.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Fix memory leak in eigrp_update
Donald Sharp [Sat, 19 Aug 2017 17:42:48 +0000 (13:42 -0400)]
eigrpd: Fix memory leak in eigrp_update

When we send packets to a nbr, make a duplicate copy
as that each packet sent is assumed to be a complete
to itself.

Also clean up indentation in loop over figuring out
what to send.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1010 from donaldsharp/reliable_eigrp
Donnie Savage [Sat, 19 Aug 2017 10:33:29 +0000 (06:33 -0400)]
Merge pull request #1010 from donaldsharp/reliable_eigrp

Reliable eigrp

7 years agoeigrpd: When generating packets only put one on send queue at a time
Donald Sharp [Fri, 18 Aug 2017 18:58:50 +0000 (14:58 -0400)]
eigrpd: When generating packets only put one on send queue at a time

When we generate update packets to go to our neighbor, Only
put one packet at a time on the send queue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Only put 1 packet at a time on send queue
Donald Sharp [Fri, 18 Aug 2017 18:57:37 +0000 (14:57 -0400)]
eigrpd: Only put 1 packet at a time on send queue

When we have received an ack for the last reliable
packet we must only put 1 packet onto the send
queue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agotools: Always ensure that the daemon exists at startup
Donald Sharp [Fri, 18 Aug 2017 14:57:07 +0000 (10:57 -0400)]
tools: Always ensure that the daemon exists at startup

When starting up FRR with tools/frr, ensure that the
daemon specified that we are about to start actually exists.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: Fix bgp clear help string
Donald Sharp [Fri, 18 Aug 2017 13:45:16 +0000 (09:45 -0400)]
bgpd: Fix bgp clear help string

The bgp clear help string was misordered.

New output:
robot.cumulusnetworks.com# clear bgp
  (1-4294967295)  Clear peers with the AS number
  *               Clear all peers
  A.B.C.D         BGP neighbor address to clear
  WORD            BGP neighbor on interface to clear
  X:X::X:X        BGP IPv6 neighbor to clear
  external        Clear all external peers
  ipv4            Address Family
  ipv6            Address Family
  peer-group      Clear all members of peer-group
  prefix          Clear bestpath and re-advertise
  view            BGP view
  vrf             BGP VRF

Fixes: #1005
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #1003 from donaldsharp/pim_mem_leak
Jafar Al-Gharaibeh [Fri, 18 Aug 2017 05:16:38 +0000 (00:16 -0500)]
Merge pull request #1003 from donaldsharp/pim_mem_leak

pimd: Fix memory leak on failure case

7 years agoMerge pull request #1001 from dwalton76/pimd-CMD-WARNING
Jafar Al-Gharaibeh [Fri, 18 Aug 2017 05:15:37 +0000 (00:15 -0500)]
Merge pull request #1001 from dwalton76/pimd-CMD-WARNING

pimd: "No Path to RP address specified" should exit 0

7 years agoMerge pull request #1000 from donaldsharp/eigrp_packet_stuff
Jafar Al-Gharaibeh [Fri, 18 Aug 2017 05:13:58 +0000 (00:13 -0500)]
Merge pull request #1000 from donaldsharp/eigrp_packet_stuff

Eigrp packet stuff

7 years agoeigrpd: and More Debugging Cleanup
Donald Sharp [Thu, 17 Aug 2017 23:40:44 +0000 (19:40 -0400)]
eigrpd: and More Debugging Cleanup

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Cleanup some more debugs
Donald Sharp [Thu, 17 Aug 2017 23:20:45 +0000 (19:20 -0400)]
eigrpd: Cleanup some more debugs

Properly place a few more debugs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Cleanup FIFO
Donald Sharp [Thu, 17 Aug 2017 23:03:46 +0000 (19:03 -0400)]
eigrpd: Cleanup FIFO

The FIFO really was a LIFO for some reason.

Push new packets onto the top, always pull from the bottom.

This allows eigrp neighbors to come up.  Topotests
eigrp-topo1( in a topotest PR ) now form neighbors
with itself. With this commit.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix memory leak on failure case
Donald Sharp [Thu, 17 Aug 2017 17:05:08 +0000 (13:05 -0400)]
pimd: Fix memory leak on failure case

When we fail to create upstream we were not properly
cleaning up all memory.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: optimize IPV4_ADDR_[SAME|COPY]()
Jorge Boncompte [Wed, 9 Aug 2017 11:57:49 +0000 (13:57 +0200)]
lib: optimize IPV4_ADDR_[SAME|COPY]()

Change all callers of IPV4_ADDR_SAME() to pass a pointer to a struct in_addr

Use assignment and comparison instead of memcpy() and memcmp(). Avoids function
calls. Faster.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agobgpd: bgp process queue optimization
Jorge Boncompte [Sat, 5 Aug 2017 10:59:05 +0000 (12:59 +0200)]
bgpd: bgp process queue optimization

There are several code paths that dump nodes to the queue for route
processing in a loop. This patch tries to reduce memory allocations/freeing
(work item, list node) and thread scheduling overhead by batching the nodes
in a simple queue list.

In the past when route processing wasn't event driven (bgp_scan()), this used
to have a noticeable impact in table loading, convergence time and memory heap
fragmentation due to reduced alloc's/free's.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agobgpd: inline bgp_lock()/bgp_unlock()
Jorge Boncompte [Mon, 7 Aug 2017 11:40:10 +0000 (13:40 +0200)]
bgpd: inline bgp_lock()/bgp_unlock()

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agolib: cleanup the work queue implementation
Jorge Boncompte [Tue, 8 Aug 2017 18:32:30 +0000 (20:32 +0200)]
lib: cleanup the work queue implementation

Convert the work queue implementation to not use the generic linked list
to mantain the item list and use instead a simple queue from queue.h that
does not allocate memory for each node.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agolib: standardize use of queue.h
Jorge Boncompte [Mon, 7 Aug 2017 09:47:51 +0000 (11:47 +0200)]
lib: standardize use of queue.h

The simple queue implementation in OpenBSD and FreeBSD are called diferently,
standardize in the use of the FreeBSD version and map the missing names only
if we compile on OpenBSD.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agolib: inline route_node_lock()/route_node_unlock()
Jorge Boncompte [Mon, 7 Aug 2017 17:15:38 +0000 (19:15 +0200)]
lib: inline route_node_lock()/route_node_unlock()

Avoid function calls.

Signed-off-by: Jorge Boncompte <jbonor@gmail.com>
7 years agopimd: "No Path to RP address specified" should exit 0
Daniel Walton [Thu, 17 Aug 2017 15:04:25 +0000 (15:04 +0000)]
pimd: "No Path to RP address specified" should exit 0

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
This could happen if routing isn't up yet but the command did take so we
should exit 0 here.  Testing:

root@cel-redxp-10[frr-dwalton76]# vtysh -c 'conf t' -c' ip pim rp
11.11.11.11'
% No Path to RP address specified: 11.11.11.11
root@cel-redxp-10[frr-dwalton76]# echo $?
0
root@cel-redxp-10[frr-dwalton76]#

7 years agoMerge pull request #999 from fabled/master
Donald Sharp [Thu, 17 Aug 2017 14:48:28 +0000 (10:48 -0400)]
Merge pull request #999 from fabled/master

nhrpd: use hop count 1 for registration requests

7 years agoeigrpd: Rework ack sent to neighbor
Donald Sharp [Thu, 17 Aug 2017 14:02:54 +0000 (10:02 -0400)]
eigrpd: Rework ack sent to neighbor

EIGRP schedules and builds packets to send in the future.
Before those packets are being sent, we are receiving
update information from our peer.  At that time we
need to reach into the built packet and reset the
outgoing ack to a better value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agonhrpd: use hop count 1 for registration requests
Timo Teräs [Thu, 17 Aug 2017 13:55:43 +0000 (16:55 +0300)]
nhrpd: use hop count 1 for registration requests

Cisco has a bug that it rejects packets with zero hop count.
Use one to avoid potential forwarding of registration requests.

Fixes #951

Signed-off-by: Timo Teräs <timo.teras@iki.fi>