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 [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>
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
Donald Sharp [Sun, 5 Jun 2016 22:04:14 +0000 (18:04 -0400)]
redhat: Cleanup some unneeded parameters
In the Quagga.spec file we have these fixes:
1) rpmversion was being defined but never used in it's scope.
Made it global so it couldbe properly referenced.
2) Use texi2html to tell you it's version instead of rpm
Note for the future to convert to mock we will need to
find a different methodology to handle this.
3) vtysh/isisd and pimd are turned on by default
No need to call them out.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Conflicts:
redhat/quagga.spec.in
Martin Winter [Fri, 30 Oct 2015 05:15:42 +0000 (22:15 -0700)]
distro/redhat: Update to support CentOS/RHEL/Fedora, upstart/init/systemd
* redhat/quagga.spec.in: Update to support CentOS, RHEL and Fedora, and
support the various init systems across different versions of these
distros, e.g. upstart/init/systemd.
Clean up various warnings from rpmlint.
Remove configure options that are gone.
A few edits and commit message by:
Paul Jakma <paul.jakma@hpe.com> / <paul@jakma.org>
* redhat/quagga.spec.in: remove with_ipv6, it should just be the norm now.
The actual pimd binary wasn't being packaged, fix.
Remove deprecated pam.stack support.
Paul Jakma [Fri, 4 Sep 2015 13:25:13 +0000 (14:25 +0100)]
distro: fix redhat/quagga.spec.in
* quagga.spec.in: Add default for with_pimd macro.
Remove ancient condtional on quagga_buildreqs.
More recent rpmbuild complains about too many levels of recursion in
quagga_buildreqs, so use %{expand:..}.
Actually use quagga_buildreqs in BuildRequires!
groff is needed for build.
texi2html --number argument has disappeared, split into 2.