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