]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
7 years agolib: Add matching and argv support
Quentin Young [Wed, 27 Jul 2016 01:35:46 +0000 (01:35 +0000)]
lib: Add matching and argv support

Queries may be run against DFA's to find matching
cmd_element, and argument lists may be constructed.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Incremental matching improvement
Quentin Young [Tue, 26 Jul 2016 14:02:36 +0000 (14:02 +0000)]
lib: Incremental matching improvement

Shotgun changes to matching system

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Reorganize some matching stuff
Quentin Young [Fri, 22 Jul 2016 19:04:16 +0000 (19:04 +0000)]
lib: Reorganize some matching stuff

Introduce new node type, END_GN, and remove
is_leaf flags. Reorganize command_match.c & remove
internal functions from command_match.h. Start
rewriting command.h in command_new.h with changes
for new backend.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Mostly complete matcher
Quentin Young [Thu, 21 Jul 2016 21:38:03 +0000 (21:38 +0000)]
lib: Mostly complete matcher

Input matching and completions works. Still some
rough edges.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Break up functions, begin matcher
Quentin Young [Tue, 19 Jul 2016 21:14:27 +0000 (21:14 +0000)]
lib: Break up functions, begin matcher

Moved test hook out of command.c into vtysh.c,
renamed graph modules, added matching code

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Implement node comparison function
Quentin Young [Tue, 19 Jul 2016 17:06:11 +0000 (17:06 +0000)]
lib: Implement node comparison function

Implement comparator for nodes, some miscellaneous cleanup.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Fix some DFA construction bugs
Quentin Young [Mon, 18 Jul 2016 16:16:36 +0000 (16:16 +0000)]
lib: Fix some DFA construction bugs

Options get null paths, parser state is properly
cleaned up, caller passes start node

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Finish implementing grammar, DFA construction
Quentin Young [Sun, 17 Jul 2016 21:49:16 +0000 (21:49 +0000)]
lib: Finish implementing grammar, DFA construction

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Add generated parser files to .gitignore
Quentin Young [Tue, 12 Jul 2016 14:03:15 +0000 (14:03 +0000)]
lib: Add generated parser files to .gitignore

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Change some includes
Quentin Young [Mon, 11 Jul 2016 19:56:07 +0000 (19:56 +0000)]
lib: Change some includes

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Update build config for new parser
Quentin Young [Mon, 11 Jul 2016 19:34:13 +0000 (19:34 +0000)]
lib: Update build config for new parser

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Start implementing DFA
Quentin Young [Thu, 7 Jul 2016 20:35:52 +0000 (20:35 +0000)]
lib: Start implementing DFA

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Add parser, lexer, and command tree skeleton
Quentin Young [Wed, 6 Jul 2016 17:16:55 +0000 (17:16 +0000)]
lib: Add parser, lexer, and command tree skeleton

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Cleanup cmd_execute_command
Quentin Young [Thu, 23 Jun 2016 15:14:06 +0000 (15:14 +0000)]
lib: Cleanup cmd_execute_command

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoAdd grammar sandbox framework
Quentin Young [Thu, 23 Jun 2016 14:47:32 +0000 (14:47 +0000)]
Add grammar sandbox framework

7 years agopimd: Start naive implementation of anysource_forward_stop
Donald Sharp [Mon, 11 Jul 2016 20:22:14 +0000 (16:22 -0400)]
pimd: Start naive implementation of anysource_forward_stop

Naive implementation of igmp_anysource_foward_stop.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: IGMPv3 leave not deleting group entry
Donald Sharp [Mon, 11 Jul 2016 19:54:37 +0000 (15:54 -0400)]
pimd: IGMPv3 leave not deleting group entry

After sending a IGMPv3 exclude report for a multicast address
with 0 sources, send an include report for the same group and also 0
sources.  This should cause IGMP to GS query and age/delete
the entry.

This fix addresses this issue.

Ticket: CM-11685
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Rewrite ipv4 address and prefix validator
Quentin Young [Mon, 27 Jun 2016 14:51:17 +0000 (14:51 +0000)]
lib: Rewrite ipv4 address and prefix validator

Simplify ipv4 prefix and address matcher / validator to use standard
Linux networking functions instead of a state machine.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
7 years agolib: Disallow % in IPv6 addresses and prefixes
Quentin Young [Mon, 27 Jun 2016 14:42:17 +0000 (14:42 +0000)]
lib: Disallow % in IPv6 addresses and prefixes

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: Rewrite ipv6 prefix matcher
Quentin Young [Mon, 27 Jun 2016 13:14:18 +0000 (13:14 +0000)]
lib: Rewrite ipv6 prefix matcher

Simplify ipv6 prefix matcher / validator to use standard Linux
networking functions instead of a state machine.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
7 years agoall: add default log file if none are defined
Don Slice [Mon, 11 Jul 2016 19:57:24 +0000 (12:57 -0700)]
all: add default log file if none are defined

Added a default log file named /var/log/quagga/Quagga.log to every daemon
to capture log entries if no log file is defined.  This also allows the
capture of logged information prior to reading each daemon's config file.
If a log file is defined manually, it will override this default file name.

Ticket: CM-10987
Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing

7 years agopimd: static joins no longer worked
Donald Sharp [Mon, 11 Jul 2016 16:57:28 +0000 (12:57 -0400)]
pimd: static joins no longer worked

Static joins were killed by a previous commit, which
has been backed out.  I've recoded the igmp join
code to ignore 224.0.0.0/24 from ourselves a bit
differently now.

Ticket: CM-11751
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoRevert "pimd: Prevent igmp packet loopback."
Donald Sharp [Mon, 11 Jul 2016 16:28:36 +0000 (12:28 -0400)]
Revert "pimd: Prevent igmp packet loopback."

This reverts commit 5bbcd1f0fd82e0e982700dbc12dd959629e91b58.

This commit badly breaks local 'ip igmp join XXX YYY' commands.

Revert this and fix the issue a slightly different way

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgpd: BGP should accept "router-id IFNAME"
Sid Khot [Sat, 2 Jul 2016 00:25:30 +0000 (17:25 -0700)]
bgpd: BGP should accept "router-id IFNAME"
ospfd: OSPF should accept "router-id IFNAME"

Added commands in BGP and OSPF where user can specify interface for router-id.

Ticket: CM-5040
Reviewed By: CCR-4908
Testing Done: Manual

7 years agobgpd: "neigbor <interface> ttl-security hops" should reject a hops value greater...
Sid Khot [Sat, 2 Jul 2016 00:06:43 +0000 (17:06 -0700)]
bgpd: "neigbor <interface> ttl-security hops" should reject a hops value greater than 1
      "neighbor <interface> disable-connected-check" should not be allowed by the parser

Made changes to not allow hops greater than 1 and disable-connected check for neighbor <interface>

Ticket: CM-5536 CM-5537
Reviewed By: CCR-4865
Testing Done: Manual

7 years agopimd: Set default logfile to Quagga.log
Donald Sharp [Thu, 30 Jun 2016 04:43:30 +0000 (00:43 -0400)]
pimd: Set default logfile to Quagga.log

Until such time a log file line is generated,
default to using /var/log/quagga/Quagga.log

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopim: Show Iif for 'show ip pim upstream' command
Donald Sharp [Wed, 29 Jun 2016 19:49:57 +0000 (15:49 -0400)]
pim: Show Iif for 'show ip pim upstream' command

Modify the 'show ip pim upstream' command to
show the expected incoming interface for
the source.

Ticket: CM-11220
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix igmp isex_excl
Donald Sharp [Wed, 29 Jun 2016 19:07:51 +0000 (15:07 -0400)]
pimd: Fix igmp isex_excl

When we receive an igmpv3 group report that has
an implied *,g make sure that we look at
the source for the g and handle it appropriately

Ticket: CM-11396
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Pass the appropriate data structure around
Donald Sharp [Wed, 29 Jun 2016 18:30:28 +0000 (14:30 -0400)]
pimd: Pass the appropriate data structure around

Several static functions were passing a list around
when the reality is we are going to need to
look at the group information in order to make an
informated decision.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Ensure we should accept a kernel upcall
Donald Sharp [Wed, 29 Jun 2016 16:12:13 +0000 (12:12 -0400)]
pimd: Ensure we should accept a kernel upcall

When we receive a multicast packet from a source
that is not connected to us, silently ignore it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Prevent igmp packet loopback.
Donald Sharp [Wed, 29 Jun 2016 12:31:19 +0000 (08:31 -0400)]
pimd: Prevent igmp packet loopback.

pim is joining the 224.0.0.13 and 224.0.0.22 groups
This is causing the creation of (*, 224.0.0.13) and
(*, 224.0.0.22) multicast routes which are immediately
sent to the pim network.

If we are the originator of the igmp report than
there is no need to accept the packet for
processing.

Ticket: CM-11397
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Make pim_channel_add_oif failures debugs
Donald Sharp [Wed, 29 Jun 2016 11:57:47 +0000 (07:57 -0400)]
pimd: Make pim_channel_add_oif failures debugs

Make failure messages of adding a mroute
a debug and wrapper them in PIM_DEBUG_MROUTE

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
re

7 years agopimd: Make received packet zlog_err a zlog_debug
Donald Sharp [Wed, 29 Jun 2016 11:42:44 +0000 (07:42 -0400)]
pimd: Make received packet zlog_err a zlog_debug

When receiving packets and the parse fails
a zlog_err is generated.  This should be
protected by a debug.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Bind pim sockets to interface they are associated with
Donald Sharp [Wed, 29 Jun 2016 01:50:49 +0000 (21:50 -0400)]
pimd: Bind pim sockets to interface they are associated with

When pim is receiving packets, each interface's fd is receiving
packets for all interfaces.  Modify the code to bind the
pim interface sockets to the interface they were created for.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into...
Don Slice [Tue, 28 Jun 2016 11:53:19 +0000 (04:53 -0700)]
Merge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster-next

7 years agozebra/ospf/ospf6: Fix several memory leaks on if up/down
Don Slice [Mon, 27 Jun 2016 11:34:32 +0000 (04:34 -0700)]
zebra/ospf/ospf6: Fix several memory leaks on if up/down

Resolved several memory leaks caused by ifdown/ifup the vrf device or
a swp port.  For bgp/zebra/ospf/ospf6, bouncing the vrf device would cause
a linked list, Interface, and route-table to get leaked.  For ospf6,
bouncing the swp device also caused leaks of Connected and Prefix entries.

Ticket: CM-10841
Signed-off-by: Don Slice
Reviewed-By: Donald Sharp
Testing Done: Manual testing, bgp and ospf mins passed, smokes had fewer failures than base

7 years agopimd: When receiving the register packet, create the mroute
Donald Sharp [Mon, 27 Jun 2016 18:51:04 +0000 (14:51 -0400)]
pimd: When receiving the register packet, create the mroute

When a RP receives the register packet, move the (*,G) to a
(S,G) route and send the pim message upstream to the source.

With this change the multicast packets are sent from the
source to the interested parties.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Refactor pim_scan_oil
Donald Sharp [Mon, 27 Jun 2016 19:06:46 +0000 (15:06 -0400)]
pimd: Refactor pim_scan_oil

Allow the workings of pim_scan_oil to be called
on a per channel basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow (*,G) to work properly.
Donald Sharp [Mon, 27 Jun 2016 16:54:30 +0000 (12:54 -0400)]
pimd: Allow (*,G) to work properly.

When the kernel looks up a *,G route it
expects the incoming interface to be part
of the outgoing interface ttl list.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoProvide example on how to run sudo vtysh show commands without password
Dave Olson [Mon, 27 Jun 2016 16:10:46 +0000 (09:10 -0700)]
Provide example on how to run sudo vtysh show commands without password

Ticket: CM-4709
Reviewed By: dsharp
Testing Done: Uncommented, ran show commands

See the comments added, and in the bug.  Set up for users in group
quagga, with NOEXEC to not open security holes.

7 years agozebra: resolved problem with show ip route vrf
Don Slice [Mon, 27 Jun 2016 15:31:57 +0000 (08:31 -0700)]
zebra: resolved problem with show ip route vrf

Repaired damage done by commit upstream, which changed the way show_ip_route
is called to allow for multicast rpf table display.  Matched the technique of
the other callers to the new function.

Ticket: CM-11345
Signed-off-by: Don Slice
Reviewed By: Donald Sharp
Testing Done: Manual testing and vrf-min

7 years agopimd: Fix register receive pointer arithmetic
Donald Sharp [Fri, 24 Jun 2016 00:42:19 +0000 (20:42 -0400)]
pimd: Fix register receive pointer arithmetic

When receiving the register packet from another pim
neighbor at the RP, we were adding an incorrect
amount of bytes to find the start of the ip_hdr
of the encapsulated data.  This commit fixes
this issue.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Removing extra asserts
Donald Sharp [Thu, 23 Jun 2016 19:39:20 +0000 (15:39 -0400)]
pimd: Removing extra asserts

in the igmp_group_free path, the normal deletion path
was causing asserts to happen.  There is no need
to have asserts here for this reason.

Further testing done w/ valgrind.

Ticket: CM-11401
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Add documentation to internal command format parser functions
Quentin Young [Thu, 23 Jun 2016 19:46:14 +0000 (19:46 +0000)]
lib: Add documentation to internal command format parser functions

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agopimd: Fix igmp Trace logging
Donald Sharp [Thu, 23 Jun 2016 16:24:32 +0000 (12:24 -0400)]
pimd: Fix igmp Trace logging

In general we don't need to know
when a read is scheduled.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Move timer information to TRACE_DETAIL
Donald Sharp [Thu, 23 Jun 2016 15:54:24 +0000 (11:54 -0400)]
pimd: Move timer information to TRACE_DETAIL

Move another timer informational debug to TRACE_DETAIL

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Handle pimreg a bit better
Donald Sharp [Thu, 23 Jun 2016 15:46:57 +0000 (11:46 -0400)]
pimd: Handle pimreg a bit better

The pimreg device is vif_index == 0.  Allow it
to be used.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Turn some trace information to trace detail
Donald Sharp [Thu, 23 Jun 2016 15:15:45 +0000 (11:15 -0400)]
pimd: Turn some trace information to trace detail

Turn some PIM_TRACE to PIM_TRACE_DETAIL.  Log file
was getting spammed with unneeded information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Allow pimreg device to be output vif
Donald Sharp [Thu, 23 Jun 2016 15:03:47 +0000 (11:03 -0400)]
pimd: Allow pimreg device to be output vif

With the change to moving the pimreg to vifindex 0,
when a packet is kicked up from the kernel to us
we need to install the route into the system.

This change allows us to do this now.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Get proper group on register receive
Donald Sharp [Wed, 22 Jun 2016 20:44:05 +0000 (16:44 -0400)]
pimd: Get proper group on register receive

When we receive a encapsulated packet from another
pim neighbor, the code needs to grab the group
from the ip_hdr->src.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Fix checking to see if we are a RP or not
Donald Sharp [Wed, 22 Jun 2016 20:39:31 +0000 (16:39 -0400)]
pimd: Fix checking to see if we are a RP or not

When we create the pim_ifp we need to see if this
interface allows us to elect our selves the RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Log Rotate is not working properly
Donald Sharp [Wed, 22 Jun 2016 15:42:50 +0000 (11:42 -0400)]
pimd: Log Rotate is not working properly

The log line was causing confusion when we
were rotating quagga.  None of the other
protocols were logging lines on rotate
so just remove it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agovtysh: auto-generated vtysh_cmd.c file should depend on its creator
Paul Jakma [Tue, 14 Jun 2016 14:06:34 +0000 (15:06 +0100)]
vtysh: auto-generated vtysh_cmd.c file should depend on its creator

7 years agobgpd: Fix another clang warning
Donald Sharp [Tue, 21 Jun 2016 21:24:19 +0000 (17:24 -0400)]
bgpd: Fix another clang warning

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agozebra: Add iface index to RA message count increment failure msg
Quentin Young [Tue, 21 Jun 2016 20:14:20 +0000 (20:14 +0000)]
zebra: Add iface index to RA message count increment failure msg

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agozebra: Suppress 'ip forwarding' in configuration output
Quentin Young [Tue, 21 Jun 2016 19:57:22 +0000 (19:57 +0000)]
zebra: Suppress 'ip forwarding' in configuration output

Since IP forwarding is enabled by default on Quagga startup, it
makes more sense to only explicitly report the state of this
setting when it is disabled. Inverted the relevant printouts.

Ticket: CM-11462

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agozebra: Add `debug zebra kernel msgdump` functionality
Quentin Young [Tue, 21 Jun 2016 18:43:40 +0000 (18:43 +0000)]
zebra: Add `debug zebra kernel msgdump` functionality

Add command and associated functionality to enable dumping
raw netlink messages.

Ticket: CM-6568

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoquagga-reload.py thinks the BGP ASN changed when it did not
Daniel Walton [Tue, 21 Jun 2016 14:52:43 +0000 (14:52 +0000)]
quagga-reload.py thinks the BGP ASN changed when it did not

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11463
(cherry picked from commit ab5f8310801f1870a7c5c22e1595e4452c558ddb)

7 years agoFix build warnings in start-stop-daemon.c
Daniel Walton [Tue, 21 Jun 2016 14:24:29 +0000 (14:24 +0000)]
Fix build warnings in start-stop-daemon.c

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11484
(cherry picked from commit 39dcf9acd87b18ab00f9f71ec15fdd89fff4b3c8)

7 years agozebra: Change bitwise operations to purpose-built macros
Quentin Young [Mon, 20 Jun 2016 13:31:55 +0000 (13:31 +0000)]
zebra: Change bitwise operations to purpose-built macros

Some bitfields for zebra_debug_* flags were being modified
with bitwise operators instead of the purpose-built macros
in lib/zebra.h. Changed such instances to use the macros.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agozebra: Add ipv6 router advertisement message counter
Quentin Young [Mon, 20 Jun 2016 15:21:10 +0000 (15:21 +0000)]
zebra: Add ipv6 router advertisement message counter

Ticket: CM-4497

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoquagga: Allow compile time determination of v6 RR semantics
Donald Sharp [Mon, 20 Jun 2016 12:21:00 +0000 (08:21 -0400)]
quagga: Allow compile time determination of v6 RR semantics

The patches to allow kernel v6 Route Replacement semantics
to work correctly are on a very recent kernel.  If you are
compiling on a linux kernel where it's broken, just
compile with --disable-rr-semantics.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Prevent loopback from forming neighbor
Donald Sharp [Sat, 18 Jun 2016 01:25:21 +0000 (21:25 -0400)]
pimd: Prevent loopback from forming neighbor

This code prevents pim from forming a neighbor relationship
with itself by preventing pim from sending a hello
out the loopback interface if we have pim configured
on an interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Apparently compilers are evil
Donald Sharp [Sat, 18 Jun 2016 00:53:21 +0000 (20:53 -0400)]
pimd: Apparently compilers are evil

Fix up some compiler issues from clang to gcc.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Separate pim vif index spot from ifindex
Donald Sharp [Sat, 18 Jun 2016 00:43:21 +0000 (20:43 -0400)]
pimd: Separate pim vif index spot from ifindex

Allow pim to separate out the pim vif index from the ifindex.
This change will allow pim to work with up to 255(MAXVIFS)
interfaces, while also allowing the interface ifindex to
be whatever number it needs to be.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Remove unneeded shell scripts
Donald Sharp [Fri, 17 Jun 2016 22:47:48 +0000 (18:47 -0400)]
pimd: Remove unneeded shell scripts

Remove some unneeded shell scripts.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoFix missing parameter in call to openzlog
Quentin Young [Fri, 17 Jun 2016 19:59:12 +0000 (15:59 -0400)]
Fix missing parameter in call to openzlog

7 years agopim: Fix NOCACHE to use incoming interface
Donald Sharp [Fri, 17 Jun 2016 19:37:49 +0000 (15:37 -0400)]
pim: Fix NOCACHE to use incoming interface

When the kernel sends a NOCACHE message to
pim we were looking up the interface to
use for the incoming multicast packet
based upon the source.  No need to do
that trust that the kernel has properly
identified it and use that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Remove 'show memory pim' unused command
Donald Sharp [Fri, 17 Jun 2016 19:26:17 +0000 (15:26 -0400)]
lib: Remove 'show memory pim' unused command

This command is not used,  Remove it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopim
Donald Sharp [Fri, 17 Jun 2016 14:38:45 +0000 (10:38 -0400)]
pim

7 years agobgp_recalculate_all_bestpaths() should check if rn->info is NULL
Daniel Walton [Fri, 17 Jun 2016 13:44:35 +0000 (13:44 +0000)]
bgp_recalculate_all_bestpaths() should check if rn->info is NULL

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11444

The bgp table may contain nodes without an 'info' (these nodes are used
for balancing the tree, they are created by route_common() in lib/table.c).
When we call bgp_recalculate_all_bestpaths() we should avoid calling
bgp_process() for these nodes.  bgp_recalculate_all_bestpaths() is only
called when knobs are configured that could have an impact on which
routes are selected as best.

7 years agopimd: Tell code to use ifindex
Donald Sharp [Fri, 17 Jun 2016 13:37:11 +0000 (09:37 -0400)]
pimd: Tell code to use ifindex

When creating an vif use the ifindex.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agopimd: Use the ifindex to create vif device
Donald Sharp [Fri, 17 Jun 2016 13:19:38 +0000 (09:19 -0400)]
pimd: Use the ifindex to create vif device

It is possible to create multiple interfaces
with the same ip address.  Looking up the
dev to use based upon the ip address will
eventually fail when you keep getting
the same dev device.

Future-Work: I'll need to add a translation
to vif index to actual device to use because
ifindex's are not guaranteed to be under 256.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoRevert "bgpd: bgp_scan shouldn't queue up route_nodes with no routes for processing"
Daniel Walton [Fri, 17 Jun 2016 00:49:16 +0000 (00:49 +0000)]
Revert "bgpd: bgp_scan shouldn't queue up route_nodes with no routes for processing"

This reverts commit ff75b6c05bb9ca1b9c4c48f2231fd4cbfd393b17.

lib/table.c's route_common() can create a rn for a prefix that BGP has
never RXed.  For example here we RX 10.1.8.0/24 from neighbor 10.0.0.2,
notice how the 10.1.0.0/20 entry is created.  We would later assert on
this prefix because its info was NULL.

2016/06/16 23:37:21.418426 BGP: 10.0.0.2 rcvd UPDATE w/ attr: nexthop 10.0.0.2, origin i, localpref 100, metric 0, community 99:7, path
2016/06/16 23:37:21.418442 BGP: 10.0.0.2 rcvd UPDATE wlen 0 wpfx 0 attrlen 36 alen 4 apfx 1
2016/06/16 23:37:21.418458 BGP: bgp_node_create called
2016/06/16 23:37:21.418475 BGP: route_node_get called for 10.1.8.0/24, route_node_new 10.1.0.0/20, match (nil)
2016/06/16 23:37:21.418519 BGP: bgp_node_create called
2016/06/16 23:37:21.418536 BGP: route_node_get called for 10.1.8.0/24, route_node_new(2) 10.1.8.0/24, match 0x2013cd0
2016/06/16 23:37:21.418554 BGP: 10.0.0.2 rcvd 10.1.8.0/24

If rn->info is NULL then avoiding the group_announce_route() call in
bgp_proces_main() also feels risky as this code path generates WITHDRAWs
for prefixes that no longer have a bestpath which would be the case if
there are no paths.

7 years agolib: Clean command.c
Quentin Young [Thu, 16 Jun 2016 15:04:13 +0000 (11:04 -0400)]
lib: Clean command.c

Removed dead code paths and fixed a typo.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoredhat: Fix runtime dependency and quaggavty group
Donald Sharp [Tue, 14 Jun 2016 19:06:37 +0000 (15:06 -0400)]
redhat: Fix runtime dependency and quaggavty group

1) Fix runtime to depend on initscripts
2) Fix quagga user to get quaggavty group

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoquagga: Modify code to build properly in tools and cumulus
Donald Sharp [Mon, 13 Jun 2016 23:10:17 +0000 (19:10 -0400)]
quagga: Modify code to build properly in tools and cumulus

The tools and cumulus directories were not properly
being included for the 'make dist' step to allow
for proper distribution of code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agotools: Use the now included start-stop-daemon
Donald Sharp [Mon, 13 Jun 2016 23:08:43 +0000 (19:08 -0400)]
tools: Use the now included start-stop-daemon

Redhat does not have a way to run the start-stop-daemon.
This code is widely available on the internet and
very small.  Use the compiled start-stop-daemon(ssd)
if it is included with the system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agodebian: Modifications to allow redhat to work properly
Donald Sharp [Mon, 13 Jun 2016 23:07:49 +0000 (19:07 -0400)]
debian: Modifications to allow redhat to work properly

Modify the control files to allow redhat to build properly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agocumulus: Changes to make this code work for redhat
Donald Sharp [Mon, 13 Jun 2016 23:05:17 +0000 (19:05 -0400)]
cumulus: Changes to make this code work for redhat

Modify code base to allow rpm building.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoredhat: Changes to allow Cumulus start/stop methodology
Donald Sharp [Mon, 13 Jun 2016 23:00:24 +0000 (19:00 -0400)]
redhat: Changes to allow Cumulus start/stop methodology

Change the redhat .spec and control files to allow
redhat systemd interaction to be the same as
the debian style.  This will allow users
to use Quagga consistently across platforms.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoredhat: V6 compilation is on by default
Donald Sharp [Mon, 13 Jun 2016 16:54:39 +0000 (12:54 -0400)]
redhat: V6 compilation is on by default

Let's not call it out as a separate item
anymore.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoQuagga: bgpd needs extra neighbor and route json attributes for SNMP BGP4 MIB
Sam Tannous [Mon, 13 Jun 2016 22:39:57 +0000 (15:39 -0700)]
Quagga: bgpd needs extra neighbor and route json attributes for SNMP BGP4 MIB

Ticket: CM-11344
Reviewed By: dwalton, dsharp
Testing Done: built and tested amd64 debs

This patch adds the peerID JSON attribute for routes for show ip bgp json.
It also corrects the bgpTimerLastWrite in show ip bgp neigh json as well
as adds bgpInUpdateElapsedTimeMsecs, lastErrorCodeSubcode, and connectRetryTimer.
These are needed for the bgp4 mib implementation (rfc 4273) from the json
output of vtysh commands.

8 years agoMerge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into...
Don Slice [Mon, 13 Jun 2016 13:17:25 +0000 (09:17 -0400)]
Merge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster-next

8 years agoospfd/ospf6d/zebra: Change interface bandwidth range and auto-cost range to 100G
Don Slice [Mon, 13 Jun 2016 13:06:45 +0000 (09:06 -0400)]
ospfd/ospf6d/zebra: Change interface bandwidth range and auto-cost range to 100G

Prior to this change, interface bandwidth could not be defined above 10G. With
the use of higher speed interfaces, the ability to effectively define the path
links was highly impacted. Additionally, the default auto-cost reference-bandwidth
for ospf and ospfv3 was set to 100M, which relects a much earlier time.  Changed both
the range of interface bandwidth definitions and reference bandwidths to be up to
100G.  Set the default interface bandwidth (if not defined) to 10G to make the ratio
continue to cause a cost of 10 as before.  Manual testing as well as ospf-min and
ospf-smoke passed successfully.

Ticket: CM-10756
Signed-of-by: Don Slice
Reviewed-by: Donald Sharp
8 years agobgpd, lib, vtysh: hook up bgp ENCAP CLI node
Lou Berger [Tue, 12 Jan 2016 18:42:04 +0000 (13:42 -0500)]
bgpd, lib, vtysh: hook up bgp ENCAP CLI node

Signed-off-by: Lou Berger <lberger@labn.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit a3fda886cdd48b6d8c421ebb1401142fa9ee93b0)

Conflicts:
bgpd/bgp_vty.c
bgpd/bgpd.c
vtysh/vtysh_config.c

8 years agobgpd: encap: add encap SAFI (RFC5512)
Lou Berger [Tue, 12 Jan 2016 18:42:02 +0000 (13:42 -0500)]
bgpd: encap: add encap SAFI (RFC5512)

Adds RFC5512 and Encapsulation Attribute.

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit 298cc2f688dbadf0a447fcd06ae8e20fa5006ce4)

Conflicts:
bgpd/Makefile.am
bgpd/bgp_attr.c
bgpd/bgp_open.c
bgpd/bgp_packet.c
bgpd/bgp_route.c
bgpd/bgp_vty.c
bgpd/bgpd.c

8 years agobgpd: Fixes and updates for VPNv6
vivek [Sat, 11 Jun 2016 18:36:42 +0000 (11:36 -0700)]
bgpd: Fixes and updates for VPNv6

VPNv6 changes picked from upstream needed fixes and updates due to some
fundamental changes implemented by Cumulus (BGP update-groups, RFC 5549
and nexthop setting etc.) which aren't present upstream.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Updates: 945c8fe8ecd326bb86c6093b73dff4c8985

8 years agozebra: Fix zebra to exit on recvmsg buffer overrun
Donald Sharp [Mon, 23 May 2016 21:22:24 +0000 (17:22 -0400)]
zebra: Fix zebra to exit on recvmsg buffer overrun

When zebra receives a recvmsg buffer from the kernel
silently exit so that watchquagga will notice and then
restart zebra.

Ticket: CM-11130
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
8 years agoBGP:Fix for BFD sessions not getting replayed after quagga restart
radhika [Sat, 21 May 2016 08:16:14 +0000 (01:16 -0700)]
BGP:Fix for BFD sessions not getting replayed after quagga restart

Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Kanna Rajagopal <kanna@cumulusnetworks.com>
Ticket: CM-11055
Reviewed By: CCR-4773
Testing Done: Unit, PTM smoke, BGP neighbor smoke

Issue: bgpd is not replaying the BFD registrations to PTM after quagga restart.

Root Cause: This problem happens when BFD configuration is part of the peer group template. Currently, the BFD configuration is being copied to the peer from template as part of the AF (address family) configuration. But, when the saved config is used after the quagga restart the peer group template is applied to the peer before the AF configuration is configured for the template. Due to this the BFD configuration never gets copied from the template to the peer and the BGP peers have no BFD configuration after the restart

Sample config which failed:
router bgp 100
bgp router-id 10.10.0.1
no bgp default ipv4-unicast
bgp bestpath as-path multipath-relax
neighbor dpeergrp_2 peer-group
neighbor dpeergrp_2 remote-as 100
neighbor dpeergrp_2 bfd
neighbor dpeergrp_2 advertisement-interval 1
neighbor dpeergrp_2 timers connect 1
neighbor dpeergrp_4 peer-group
neighbor dpeergrp_4 remote-as 400
neighbor dpeergrp_4 bfd
neighbor dpeergrp_4 advertisement-interval 1
neighbor dpeergrp_4 timers connect 1
neighbor swp2s0.1 interface peer-group dpeergrp_2
neighbor swp18s3.1 interface peer-group dpeergrp_4
!
address-family ipv4 unicast
redistribute connected route-map redist
neighbor dpeergrp_2 activate
neighbor dpeergrp_2 next-hop-self
neighbor dpeergrp_2 default-originate
neighbor dpeergrp_2 soft-reconfiguration inbound
neighbor dpeergrp_4 activate
neighbor dpeergrp_4 next-hop-self
neighbor dpeergrp_4 default-originate
neighbor dpeergrp_4 soft-reconfiguration inbound
maximum-paths 14
exit-address-family

Fix: Moved the BFD config copy from the peer group AF config copy function to the main peer group config copy function.

8 years agolib: Fix some poll semantics
Donald Sharp [Thu, 19 May 2016 13:56:35 +0000 (09:56 -0400)]
lib: Fix some poll semantics

Two Fixes:

1) When a fd has both read and write as a .events.
(POLLHUP | POLLIN | POLLOUT) and a
thread_cancel_read_write call is executed
from a protocol, the code was blindly removing
the fd from consideration at all.

2) POLLNVAL was being evaluated before POLLIN|POLLOUT
were being evaluated.  While I didn't see a case
of POLLNVAL being included with other .revent flags
I decided to move the POLLNVAL and POLLHUP handling
to the same section of code.

Additionally the function thread_cancel_read_write
was poorly named and let me to poorly implement
the poll version of it.  I've renamed the function
thread_cancel_read_or_write in an attempt to
make this problem moot in the future.

Ticket: CM-11027
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit f6da66a913bcae1d3f75c55f24e72e97288af619)

8 years agobgpd: remove vrf->iflist deleted to avoid a crash
Don Slice [Fri, 10 Jun 2016 13:58:03 +0000 (06:58 -0700)]
bgpd: remove vrf->iflist deleted to avoid a crash

Ticket: CM-11327
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
Testing Done: Manual testing, bgp-min, vrf-min, bgp-smoke, vrf-smoke all successful

When bgp was configured in a vrf and then deleted, the vrf->iflist
was being deleted from the vrf.  Since the vrf itself was not deleted,
it was assumed in later calls that the vrf->iflist was still there
and when it was referenced, the crash occurred.

8 years agodebian: Remove obsoleted configure options.
Donald Sharp [Sat, 4 Jun 2016 23:55:23 +0000 (19:55 -0400)]
debian: Remove obsoleted configure options.

configure.ac has moved on, catch debian up
with it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoconfigure: Auto pick-up the correct json env
Donald Sharp [Sat, 4 Jun 2016 23:55:22 +0000 (19:55 -0400)]
configure: Auto pick-up the correct json env

Fix the code to allow Quagga to automatically
compile with the correct json library.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agoconfigure: Ensure systemd development is present
Donald Sharp [Sat, 4 Jun 2016 23:55:21 +0000 (19:55 -0400)]
configure: Ensure systemd development is present

If a users specifies that they should use systemd
then ensure that the systemd can be compiled against it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: encap: add attribute handling
Lou Berger [Tue, 12 Jan 2016 18:42:01 +0000 (13:42 -0500)]
bgpd: encap: add attribute handling

Signed-off-by: Lou Berger <lberger@labn.net>
Reviewed-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit c3741789530ee824693fd606356acac2ad695f83)

Conflicts:
bgpd/Makefile.am
bgpd/bgp_attr.c
bgpd/bgp_attr.h
lib/memtypes.c

8 years agoMerge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into...
vivek [Fri, 10 Jun 2016 01:20:55 +0000 (18:20 -0700)]
Merge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster-next

8 years agobgpd: general MP/SAFI improvements
Lou Berger [Tue, 12 Jan 2016 18:41:59 +0000 (13:41 -0500)]
bgpd: general MP/SAFI improvements

This fixes some minor mixups particularly in MPLS-related SAFIs, as well
as doing some stylistic changes & adding comments.

Signed-off-by: Lou Berger <lberger@labn.net>
Reviewed-by: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 050defe816e4bd4cac7b028f69e45cb1974ca96d)

Conflicts:
bgpd/bgp_attr.c
bgpd/bgp_attr.h
bgpd/bgp_packet.c
bgpd/bgp_route.c
bgpd/bgp_route.h

8 years agopimd: Fix of using uninitialized Memory
Donald Sharp [Thu, 9 Jun 2016 19:16:14 +0000 (15:16 -0400)]
pimd: Fix of using uninitialized Memory

Valgrind is reporting that pimd is using uninitialized
memory for comparisons.  This commit addresses
the issues found there.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agovtysh json output not JSON for show ip bgp neigh json
Sam Tannous [Thu, 9 Jun 2016 16:26:06 +0000 (12:26 -0400)]
vtysh json output not JSON for show ip bgp neigh json

Ticket: CM-11350
Reviewed By: dsharp
Testing Done: built amd64 images and tested output of both json and non-json

Upstream patch was applied in wrong section of code so JSON
output contained plain text.   The upstream patch was
commit baa376fc1 (cherry picked from ef757700d0f)

This patch moves the text output to the correct if clause
and also adds a new JSON line for the same data.

Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>