]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
8 years agoMake vtysh-integrated-config truly the default and fix quagga reload for this.
Dinesh G Dutt [Wed, 20 Jul 2016 15:24:47 +0000 (08:24 -0700)]
Make vtysh-integrated-config truly the default and fix quagga reload for this.

Ticket: CM-11910
Reviewed By: sharpd, routing-dev slack
Testing Done: Test with nothing in vtysh.conf, add no, remove it etc.

Even though we force integrated config to be the default, we do this by adding
a line to our default vtysh.conf which has integrated config enabled. When we
stopped printing integrated-config as part of wr mem or show running-config, we
broke quagga reload because it was explicitly looking for integrated config.
Furthermore, merely fixing quagga reload wouldn't work because subsequent saves
would result in config being saved to individual files since vtysh.conf no
longer forced the file to be integrated.

This patch fixes both issues. Makes integrated config the default in the code,
rather than via a shipped default file, and fixes quagga reload to look for
the "no integrated-vtysh-config" to deny attempting a reload.

8 years agobgpd: Print the correct table in "show ip bgp x.x.x.x"
Don Slice [Wed, 20 Jul 2016 12:02:04 +0000 (08:02 -0400)]
bgpd: Print the correct table in "show ip bgp x.x.x.x"

Prior to this change, bgp always identified the routing table used as
the default in the output of "show ip bgp x.x.x.x".  This fix changes
the behavior to use the correct table name.

Ticket: CM-10239
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
8 years agoMerge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into...
vivek [Wed, 20 Jul 2016 02:36:04 +0000 (19:36 -0700)]
Merge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster-next

8 years agoospfd: Ensure correct handling of router-id change
vivek [Wed, 20 Jul 2016 02:17:38 +0000 (19:17 -0700)]
ospfd: Ensure correct handling of router-id change

Upon router-id change, one object that needs to be updated is the "nbr_self"
structure that is created to contain information about the local router and
is used during DR election, among other things. In the past, the code used to
just change the router-id field of this structure. This is actually not
sufficient - the neighbor has to be deleted and re-added into the tree. This
was fixed upstream and the fix is now available in our tree, but those changes
don't work well with prior Cumulus changes to defer updating the router-id
in the OSPF instance until other cleanup has happened.

Fixed code to update the "nbr_self" structure correctly while continuing to
defer the router_id update in the OSPF structure.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-11861
Reviewed By: CCR-4980
Testing Done: Manual, failed test

8 years agoDon't print empty sections as they clutter the output of show-running
Dinesh G Dutt [Mon, 18 Jul 2016 06:08:05 +0000 (23:08 -0700)]
Don't print empty sections as they clutter the output of show-running

Ticket: CM-11808
Reviewed By: CCR-4971
Testing Done: Usual stuff including doing show running with multiple daemons

Interface and VRF are both sections of the config that could possibly be
empty. This unnecessarily clutters the output of show running. This patch
fixes that by not displaying empty sections of interface, and vrf.
Routemaps have a genuine empty stanza and so we cannot add routemap to this
list. Unfortunately this means a "show running-config ospfd" may have empty
route-maps if the route-maps all correspond to BGP, for example. This
is not a concern for the entire "show running-config".

The trick in fixing this is on the vtysh side rather than on the client side.
The reason for this is that its quite tricky given the number of options to
ensure that a daemon never printed a section header unless there was something
to print. On the vtysh side, however, its easy to check if a section is
empty and not print it.

8 years agoDeprecate link-detect and don't display it in show running-config
Dinesh G Dutt [Mon, 18 Jul 2016 06:12:12 +0000 (23:12 -0700)]
Deprecate link-detect and don't display it in show running-config

Ticket: CM-11808
Reviewed By: CCR-4972
Testing Done: Usual stuff

link-detect is on by default, and has been so since the first release
of Cumulus Linux. So, in the light of not displaying defaults, don't
display link-detect if enabled, only if disabled.

8 years agoDon't display integrated-vtysh-config as its the default in CL.
Dinesh G Dutt [Mon, 18 Jul 2016 06:38:51 +0000 (23:38 -0700)]
Don't display integrated-vtysh-config as its the default in CL.

Ticket: CM-11832
Reviewed By:
Testing Done: Testing that its not displayed if enabled & only if disabled

In the spirit of not displaying the defaults, we shouldn't display
"service integrated-vtysh-config" as its the default. It also tends to
clutter the output with stuff the user doesn't know or care about. This
patch removes displaying that and only prints it when the option is
disabled.

8 years agobgpd: Use the correct bgp instance for cli commands issuing clear
Don Slice [Mon, 18 Jul 2016 14:32:46 +0000 (10:32 -0400)]
bgpd: Use the correct bgp instance for cli commands issuing clear

Some bgp commands end with doing a bgp_clear_vty, which invalidly
made the assumption that the clear should always be done for the default
instance.  This fix derives the correct instance from the vty-index if
one is supplied, and uses the default instance if it is not.

Ticket: CM-10113
Signed-off-by: Don Slice
Reviewed-by: Donald Sharp
8 years agoSimplify BGP unnumbered configuration by eliminating the unessential.
Dinesh G Dutt [Wed, 13 Jul 2016 22:31:27 +0000 (15:31 -0700)]
Simplify BGP unnumbered configuration by eliminating the unessential.

To make BGP configuration as simple as possible, assume the capability
extended-nexthop to be default for interface neighbors. Also allow the
ability to specify remote-as on the same line as neighbor interface to
make BGP unnumbered configuration a single line.

One corner case. This is the first feature for which the default for a
member is different from the default for a peer-group. Since advertising
the capability is only done for interface neighbors, the capability is
not set for the peer-group, but is automatically set for interface
neighbors that belong to that peer-group. So, if you want to disable the
advertisement of this capability for an interface neighbor, you must
do it per each interface neighbor.

The patch is more complicated than it needs to be due to the handling
of quagga reload and appropriate updates to the show running output.

Ticket: CM-11830
Reviewed By: CCR-4958
Testing Done: Usual coterie, including manual

(cherry picked from commit 347914a0a785993200cb04ae3cbf8ff9a9104d60)

8 years agoMerge remote-tracking branch 'origin/cmaster' into cmaster-next
Donald Sharp [Fri, 15 Jul 2016 20:40:01 +0000 (16:40 -0400)]
Merge remote-tracking branch 'origin/cmaster' into cmaster-next

P unnumbered configuration a single line.

One corner case. This is the first feature for which the default for a
member is different from the default for a peer-group. Since advertising
the capability is only done for interface neighbors, the capability is
not set for the peer-group, but is automatically set for interface
neighbors that belong to that peer-group. So, if you want to disable the
advertisement of this capability for an interface neighbor, you must
do it per each interface neighbor.

The patch is more complicated than it needs to be due to the handling
of quagga reload and appropriate updates to the show running output.

Ticket: CM-11830
Reviewed By: CCR-4958
Testing Done: Usual coterie, including manual

8 years agoMerge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into...
Don Slice [Tue, 19 Jul 2016 17:37:08 +0000 (10:37 -0700)]
Merge branch 'cmaster-next' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster-next

8 years agoSimplify BGP unnumbered configuration by eliminating the unessential.
Dinesh G Dutt [Wed, 13 Jul 2016 22:31:27 +0000 (15:31 -0700)]
Simplify BGP unnumbered configuration by eliminating the unessential.

To make BGP configuration as simple as possible, assume the capability
extended-nexthop to be default for interface neighbors. Also allow the
ability to specify remote-as on the same line as neighbor interface to
make BGP unnumbered configuration a single line.

One corner case. This is the first feature for which the default for a
member is different from the default for a peer-group. Since advertising
the capability is only done for interface neighbors, the capability is
not set for the peer-group, but is automatically set for interface
neighbors that belong to that peer-group. So, if you want to disable the
advertisement of this capability for an interface neighbor, you must
do it per each interface neighbor.

The patch is more complicated than it needs to be due to the handling
of quagga reload and appropriate updates to the show running output.

Ticket: CM-11830
Reviewed By: CCR-4958
Testing Done: Usual coterie, including manual

8 years agozebra: Eliminate use of imported arp entries as next-hops for other routes
Don Slice [Fri, 15 Jul 2016 13:33:48 +0000 (06:33 -0700)]
zebra: Eliminate use of imported arp entries as next-hops for other routes

Ticket: CM-8228
Signed-off-by: Donald Slice
Reviewed By:
Testing Done: Manual testing succesful. bgp-min and ospf-smoke successful. redistribute-neighbor-smoke
has the same failures as the base image.

Problem was due to considering imported /32 arp entries as elible next-hops for other routes
(in this case a static route.)  This confuses the rib since this next-hop is considered both
recursive and  onlink.  Disallowed the use of this imported arp entry in next-hop determination.

8 years agobgpd: Make ASN optional for `no router bgp`
Quentin Young [Thu, 14 Jul 2016 13:04:47 +0000 (13:04 +0000)]
bgpd: Make ASN optional for `no router bgp`

When there is one BGP router instance, `no router bgp` may be used to
deconfigure it without specifying its ASN

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agoMerge remote-tracking branch 'origin/cmaster' into cmaster-next
Donald Sharp [Wed, 13 Jul 2016 00:24:00 +0000 (20:24 -0400)]
Merge remote-tracking branch 'origin/cmaster' into cmaster-next

8 years agopimd: Refactor some encode/decode functions
Donald Sharp [Wed, 13 Jul 2016 00:13:32 +0000 (20:13 -0400)]
pimd: Refactor some encode/decode functions

Some encode/decode functions are needed in multiple places.
Start the refactoring to be able to use them in a more generic
manner.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Some Initial Groundwork for register stop
Donald Sharp [Wed, 13 Jul 2016 00:11:15 +0000 (20:11 -0400)]
pimd: Some Initial Groundwork for register stop

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Allow (S,G) pimreg route to time out
Donald Sharp [Wed, 13 Jul 2016 18:22:42 +0000 (14:22 -0400)]
pimd: Allow (S,G) pimreg route to time out

When a kernel upcall happens for nocache we create
a (S,G) route to be installed into the kernel.
This code modification starts the ability to
time out the mroute if we stop receiving mcast
packets.

Ticket: CM-11793
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Remove some extraneous hexdump's
Donald Sharp [Wed, 13 Jul 2016 16:46:09 +0000 (12:46 -0400)]
pimd: Remove some extraneous hexdump's

On every kernel upcall we are dumping the packet.  Stop that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Add generic function to retrieve mroute stats
Donald Sharp [Wed, 13 Jul 2016 15:41:41 +0000 (11:41 -0400)]
pimd: Add generic function to retrieve mroute stats

Add a generic function to retrieve mroute statistics
from the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agobgpd: Disallow ebgp-multihop on swpX peers
Quentin Young [Tue, 12 Jul 2016 21:13:24 +0000 (21:13 +0000)]
bgpd: Disallow ebgp-multihop on swpX peers

Disallow setting ebgp-multihop on peers directly
connected via an interface.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
8 years agoquagga-reload.py needs a --stdout option
Daniel Walton [Tue, 12 Jul 2016 20:10:05 +0000 (20:10 +0000)]
quagga-reload.py needs a --stdout option

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

8 years agopimd: multicast route not removed from kernel when the if goes down
Donald Sharp [Tue, 12 Jul 2016 19:25:11 +0000 (15:25 -0400)]
pimd: multicast route not removed from kernel when the if goes down

When a multicast route's rpf changes( for whatever reason ) (*,G)
routes were never updating properly.  This is because we were
attempting to fing the path to the *, instead of the RP.
Modify the code to check if we are attempting to find a
* route and use the RP instead.

Ticket: CM-11736
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Track if the mroute is installed or not
Donald Sharp [Tue, 12 Jul 2016 19:22:10 +0000 (15:22 -0400)]
pimd: Track if the mroute is installed or not

Track whether or not if a mroute has been installed
or not.  If not don't display information about it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Refactor pim_mroute_add and _del
Donald Sharp [Tue, 12 Jul 2016 19:16:53 +0000 (15:16 -0400)]
pimd: Refactor pim_mroute_add and _del

The struct mfcctl should not be passed around.  Pass around
the channel oil instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Refactor 'struct static_route' to use channel_oil
Donald Sharp [Tue, 12 Jul 2016 19:09:25 +0000 (15:09 -0400)]
pimd: Refactor 'struct static_route' to use channel_oil

The 'struct static_route' data structure duplicated a
decent bit of what is the in the struct channel_oil.
Refactor.  This will set us up for further cleanup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 years agopimd: Stale IGMP groups left behind
Donald Sharp [Tue, 12 Jul 2016 15:31:45 +0000 (11:31 -0400)]
pimd: Stale IGMP groups left behind

When a toin IGMPv3 join is received, the code
was always auto creating the igmp group associated
with the received packet.  The RFC clearly states
though that if a INCLUDE is received for a group
with 0 sources and we have received nothing the
igmpv3 packet should be ignored.

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

8 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>
8 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>
8 years agoDon't print 'neighbor activate' if its default for IPv4 unicast AFI/SAFI
Dinesh G Dutt [Wed, 6 Jul 2016 13:50:23 +0000 (06:50 -0700)]
Don't print 'neighbor activate' if its default for IPv4 unicast AFI/SAFI

Ticket: CM-11460
Reviewed By: CCR-4927
Testing Done:

Quagga's default "show running" model is to only print the non-default config.
Historically, IPv4 unicast has always had a default 'activate' model unless
its been configured otherwise. In 3.0, we introduced a print of the 'activate'
statement for IPv4 unicast independent of whether it was the default or not.
This causes quagga reload to break as the user doesn't configure 'activate' for
IPv4 unicast, and so any config changes will also not have it. However 'show
running' will display it, causing quagga reload to think that the AFI/SAFI has
been deactivated and bounce the sessions incorrectly.

This patch reverts to the original quagga behavior/model of not printing the
'activate' line for IPv4 unicast if its the default.

8 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

8 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

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

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

8 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

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

8 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

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

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

8 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

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

8 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

8 years agobfd: Fix for missing BFD client regs/deregs from quagga clients
radhika [Tue, 21 Jun 2016 10:39:58 +0000 (03:39 -0700)]
bfd: Fix for missing BFD client regs/deregs from quagga clients

Ticket: CM-11256
Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Kanna Rajagopal <kanna@cumulusnetworks.com>
Testing: Unit, PTM smoke, OSPF smoke, BGP Smoke

Issue:
BFD client registrations are not being sent to PTM from BGP/OSPF clients when the quagga clients have no BFD configuration. This can create stale BFD sessions in PTM when BFD is removed from quagga configuration before quagga is restarted.

BFD client de-registrations from BGP/OSPF also go missing sometimes when quagga is restarted. This also will cause stale BFD sessions in PTM.

Root Cause:
BFD client registrations were being sent at the time of BGP/OSPF daemon initialization. But, they were being sent to zebra before the socket connection between zebra and BGP/OSPF was established. This causes the missing BFD client registrations.

BFD client de-registrations are sent from zebra when zebra detects socket close for BGP/OSPF daemons. Based on the timing, the de-registrations may happen after socket between PTM and zebra is closed. This will result in missing de-registrations.

Fix:
Moved sending of BFD client registration messages to zebra connected callback to make sure that they are sent after the BGP/OSPF daemons connect with zebra.

Added BFD client de-registrations for BGP/OSPF to be also sent when zebra daemon gets restart signal. They are sent from the signal handler only if it was not already handled in zebra client socket close callback.

8 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>
8 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>
8 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>
(cherry picked from commit 76981cd383e4bed69454bcc4151a0aae89e8ca84)

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

8 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>
8 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>
8 years agopim
Donald Sharp [Fri, 17 Jun 2016 14:38:45 +0000 (10:38 -0400)]
pim

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

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

8 years agoconfigure.ac: Add back HAVE_SYSTEMD
Donald Sharp [Fri, 10 Jun 2016 18:53:53 +0000 (14:53 -0400)]
configure.ac: Add back HAVE_SYSTEMD

When the change was made to add some additional
code to make sure systemd was actually installed
on the system, the HAVE_SYSTEMD #define was
accidently removed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 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>
8 years agodebian: Fix rules file
Donald Sharp [Wed, 15 Jun 2016 16:31:42 +0000 (12:31 -0400)]
debian: Fix rules file

Fix the rules file to put back isis and vtysh

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
8 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>
Conflicts:
Makefile.am

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>
Conflicts:
redhat/Makefile.am