]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
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 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>
7 years agoeigrpd: Store nbr in packet data
Donald Sharp [Thu, 17 Aug 2017 13:53:51 +0000 (09:53 -0400)]
eigrpd: Store nbr in packet data

Store the neighbor information( if available ) in the packet
data that we are sending.  This will allow in a future commit
the ability to fixup the outgoing ack we are sending.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Remove extra newline in debug
Donald Sharp [Thu, 17 Aug 2017 13:48:21 +0000 (09:48 -0400)]
eigrpd: Remove extra newline in debug

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #994 from dwalton76/ospfd-show-neighbor
David Lamparter [Thu, 17 Aug 2017 10:37:25 +0000 (12:37 +0200)]
Merge pull request #994 from dwalton76/ospfd-show-neighbor

ospfd: "show ip ospf neighbor" options not passed

7 years agovtysh: vtysh -f FOO should exit non-zero if it hits an error
Daniel Walton [Wed, 16 Aug 2017 20:22:59 +0000 (20:22 +0000)]
vtysh: vtysh -f FOO should exit non-zero if it hits an error

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Today if we hit an error while apply the contents of file FOO that error
does not bubble up to a non-zero exit.

7 years agoospfd: "show ip ospf neighbor" options not passed
Daniel Walton [Wed, 16 Aug 2017 18:40:12 +0000 (18:40 +0000)]
ospfd: "show ip ospf neighbor" options not passed

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
7 years agoMerge pull request #989 from qlyoung/if-area-df
David Lamparter [Wed, 16 Aug 2017 17:28:09 +0000 (19:28 +0200)]
Merge pull request #989 from qlyoung/if-area-df

ospfd: remember area-id format for ifaces

7 years agoMerge pull request #984 from donaldsharp/debugging
David Lamparter [Wed, 16 Aug 2017 17:18:31 +0000 (19:18 +0200)]
Merge pull request #984 from donaldsharp/debugging

Some Small Pim Issues

7 years agoMerge pull request #990 from donaldsharp/eigrp_cleanup
Russ White [Wed, 16 Aug 2017 17:16:54 +0000 (13:16 -0400)]
Merge pull request #990 from donaldsharp/eigrp_cleanup

Eigrp cleanup

7 years agoMerge pull request #979 from donaldsharp/ifchannel_fix
David Lamparter [Wed, 16 Aug 2017 17:16:46 +0000 (19:16 +0200)]
Merge pull request #979 from donaldsharp/ifchannel_fix

pimd: Ensure cleanup of S,G on ifchannel failure to create

7 years agoMerge pull request #972 from chiragshah6/mdev
David Lamparter [Wed, 16 Aug 2017 17:14:08 +0000 (19:14 +0200)]
Merge pull request #972 from chiragshah6/mdev

Pim Bfd related changes

7 years agoospfd: remember area-id format for ifaces
Quentin Young [Tue, 15 Aug 2017 20:47:02 +0000 (16:47 -0400)]
ospfd: remember area-id format for ifaces

Display dotted quad or decimal back in the config depending on what the
user enters.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #985 from chiragshah6/mdev2
Martin Winter [Wed, 16 Aug 2017 03:30:23 +0000 (20:30 -0700)]
Merge pull request #985 from chiragshah6/mdev2

ospfd: Fix ospfd crash in free_nexthop

7 years agoeigrpd: Cleanup eigrp_get_fsm_event
Donald Sharp [Wed, 16 Aug 2017 02:35:27 +0000 (22:35 -0400)]
eigrpd: Cleanup eigrp_get_fsm_event

Make this function a bit more legible

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: Make eigrp_get_fsm_event use metric changed
Donald Sharp [Wed, 16 Aug 2017 02:14:18 +0000 (22:14 -0400)]
eigrpd: Make eigrp_get_fsm_event use metric changed

Refactor eigrp_get_fsm_event a tiny bit to let all
the states get the new metric.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoeigrpd: cleanup eigrp_topology_update_distance
Donald Sharp [Wed, 16 Aug 2017 02:09:55 +0000 (22:09 -0400)]
eigrpd: cleanup eigrp_topology_update_distance

Cleanup eigrp_topology_update_distance to
return an enum of whether or not the metric
has changed or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add 'show ip msdp vrf all sa ...' command
Donald Sharp [Tue, 15 Aug 2017 20:37:13 +0000 (16:37 -0400)]
pimd: Add 'show ip msdp vrf all sa ...' command

Allow the ability to iterate over all vrfs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #983 from opensourcerouting/vtysh-watchfrr-no-conf
Donald Sharp [Tue, 15 Aug 2017 15:37:15 +0000 (11:37 -0400)]
Merge pull request #983 from opensourcerouting/vtysh-watchfrr-no-conf

vtysh: don't collect config from watchfrr

7 years agoMerge pull request #982 from opensourcerouting/buildfix-parallel-tests-clippy
Quentin Young [Tue, 15 Aug 2017 15:28:37 +0000 (11:28 -0400)]
Merge pull request #982 from opensourcerouting/buildfix-parallel-tests-clippy

tests: fix clippy include paths / double-build

7 years agoospfd: Fix ospfd crash in free_nexthop
Chirag Shah [Tue, 15 Aug 2017 01:57:46 +0000 (18:57 -0700)]
ospfd: Fix ospfd crash in free_nexthop

Fix ANVL-OSPF-5.1 reported ospfd crash.

vertex_nexthop_free was added as valgrind reported potential
memory leak, but in some cases nexthop would not be available
freed.
The actual nexthop free is part of ospf_canonical_nexthops_free(),
upon trying to free, qfree checks mtype count becomes 0 and asserts.
Removing vertex_nexthop_free() from ospf_spf_flush_parents().

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
7 years agopimd: Rename duplicate JSON key
Donald Sharp [Tue, 15 Aug 2017 14:31:09 +0000 (10:31 -0400)]
pimd: Rename duplicate JSON key

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Add more vrf debugging to pim_upstream.c
Donald Sharp [Tue, 15 Aug 2017 14:17:33 +0000 (10:17 -0400)]
pimd: Add more vrf debugging to pim_upstream.c

Cleanup a few missed spots of debugging to know
what vrf we are talking about.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow user to specify ip address for 'no ip pim use-source'
Donald Sharp [Tue, 15 Aug 2017 14:16:51 +0000 (10:16 -0400)]
pimd: Allow user to specify ip address for 'no ip pim use-source'

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoredhat: ship IRDP module
David Lamparter [Tue, 15 Aug 2017 12:19:16 +0000 (14:19 +0200)]
redhat: ship IRDP module

No point in configuring IRDP (it's always available on Linux), just ship
the module and let the user decide whether to enable it by way of module
loading.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agovtysh: don't collect config from watchfrr
David Lamparter [Tue, 15 Aug 2017 11:43:50 +0000 (13:43 +0200)]
vtysh: don't collect config from watchfrr

This results in some hardcoded watchfrr logging config ending up in the
integrated config otherwise.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agoMerge pull request #935 from donaldsharp/kernel_metric
David Lamparter [Tue, 15 Aug 2017 11:42:04 +0000 (13:42 +0200)]
Merge pull request #935 from donaldsharp/kernel_metric

zebra: Pay attention to metric from kernel

7 years agoMerge pull request #976 from lucize/lededoc
Donald Sharp [Tue, 15 Aug 2017 11:30:54 +0000 (07:30 -0400)]
Merge pull request #976 from lucize/lededoc

doc: add LEDE/OpenWRT build instructions

7 years agozebra: irdp: convert into module
David Lamparter [Sun, 6 Aug 2017 07:19:14 +0000 (09:19 +0200)]
zebra: irdp: convert into module

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
7 years agozebra: irdp: manage separate IRDP struct
David Lamparter [Sun, 6 Aug 2017 06:57:42 +0000 (08:57 +0200)]
zebra: irdp: manage separate IRDP struct

This allocates the per-interface IRDP data as needed; so the pointer in
zebra_if is now really opaque.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>