vivek [Fri, 26 Feb 2016 19:13:34 +0000 (19:13 +0000)]
Zebra: Fix static NHT to work properly in a VRF
Implement VRF support for static nexthop resolution (NHT). This is
achieved by ensuring the correct VRF is passed as a parameter to
the NHT functions and is stored in the registered nexthop data
structure.
vivek [Thu, 25 Feb 2016 19:44:28 +0000 (19:44 +0000)]
Zebra: Fix neighbor address notification to clients
This problem was fixed as part of implementation of VRF change semantics
for an interface, though it is not directly related. The issue here
was that neighbor addresses learnt on an interface were being informed
to clients even though the clients may not have learnt of the interface.
Fixed by introducing the correct checks.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-9527
Reviewed By: CCR-4174
Testing Done: Manual tests of various scenarios
vivek [Thu, 25 Feb 2016 19:30:53 +0000 (19:30 +0000)]
Quagga: Implement VRF change semantics for an interface
Implement VRF change semantics for an interface to be invoked
when an interface is moved from one VRF (e.g., the Default) to
another. This includes the message definition as well as updating,
deleting or adding the interface from clients, depending on their
interest in the VRFs (old and new). Also handle replay of the
addresses on the interface upon VRF change, if required.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-9527
Reviewed By: CCR-4174
Testing Done: Manual tests of various scenarios
vivek [Tue, 23 Feb 2016 23:55:06 +0000 (23:55 +0000)]
BGP: Fix interface list upon instance creation/deletion
The BGP instance cleanup was deleting interfaces in that instance after
prior fixes, but this ended up deleting the interface list header which
was not being re-created. Added code to re-create this at the time an
instance is created.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-9466
Reviewed By: CCR-4164
Testing Done: Manual and verified failed test
Donald Sharp [Tue, 23 Feb 2016 20:06:59 +0000 (15:06 -0500)]
debian: Fixup removal of .pid and .vty files
The <daemon>.pid and <daemon>.vty files were not being
removed on shutdown. This was causing issues w/
logrotate becaue it depends on pid files being correct
about what is running in order to not error out.
Fixed some additional debugs accidently left in the quagga
script.
Ticket: CM-9293 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
sharpd [Mon, 22 Feb 2016 21:22:16 +0000 (13:22 -0800)]
debian: Revamp startup again
Remove quagga.service, it was a bad idea culminating in a
series of mistakes.
Replaced with /usr/lib/quagga/quagga script.
Use this script to start/stop quagga as a whole.
Ticket: CM-9445 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Dave Olson <olson@cumulusnetworks.com>
Donald Sharp [Sun, 21 Feb 2016 17:43:50 +0000 (12:43 -0500)]
debian, config, zebra: Ensure Cumulus Extensions are not auto turned on
There exist cases where Cumulus Code( in this case code surrounding
when we want to send Router Advertisements ) should only be
turned on for Cumulus Switches.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
vivek [Tue, 23 Feb 2016 03:42:19 +0000 (03:42 +0000)]
Zebra: Perform NHT evaluation for VRFs
NHT evaluation was not being triggered for any VRF after RIB processing. Fix
this and attempt to schedule only those VRFs for which RIB processing was
scheduled.
Don Slice [Mon, 22 Feb 2016 21:36:23 +0000 (21:36 +0000)]
Zebra: Enable VRF as an interface creation
Modified response to netlink message for VRF creation, allowing it to be
created as an interface and setting the right vrf_id and bringing in the ip address.
Ticket: CM-9277 Signed-off-by: Don Slice Reviewed-by: Vivek Venkatraman
vivek [Mon, 22 Feb 2016 06:36:37 +0000 (06:36 +0000)]
BGP: Cleanup interfaces properly on instance delete or exit
Perform interface cleanup as an instance is deleted. This takes care of the
scenario when BGP exits (or is stopped/restarted) too as instances undergo
deletion and the interface cleanup is done as the last step in that.
vivek [Mon, 22 Feb 2016 05:33:46 +0000 (05:33 +0000)]
Zebra: Fix ignoring status for VRF device
The earlier change to ignore status for VRF device was not quite perfect. As
defect CM-9437 illustrates, there are situations when Quagga may get a VRF
member interface (that refers to the VRF id of the VRF device) before it gets
the VRF device itself. The code has some logic to handle this, creating a
VRF structure which is partly initialized. The initialization is completed
with some additional incorrect status processing when the VRF is learnt. The
fix done earlier completely ignored the VRF message treating it as a status
change because the VRF is already present, but this left the VRF structure
not fully initialized in Quagga. The fix is to do some additional checks
to handle this scenario.
vivek [Sat, 20 Feb 2016 06:50:56 +0000 (22:50 -0800)]
Zebra: Ignore status change for VRF (temporary)
Temporary change to ignore status change for a VRF device as it is
incorrectly implemented now. When VRF is also supported as an
interface, the status change will be handled for the interface.
vivek [Sat, 20 Feb 2016 02:43:30 +0000 (18:43 -0800)]
BGP: Link BGP instance to corresponding VRF
Link BGP instance (Default or VRF) to the corresponding VRF structure and
modify lookup to use this. The logic is very similar to what is implemented
in zebra - the 'struct zebra_vrf' there is essentially 'struct bgp' in BGP.
vivek [Fri, 19 Feb 2016 22:28:25 +0000 (14:28 -0800)]
Zebra: Make RA socket operation on a per-NS basis
This patch reorganizes the RA handling to be per namespace rather than per
VRF. The VRF library by 6wind had done the original change to make the RA
data structures (socket information) per VRF, but this was correct only if
each VRF represented a NS. In our reorganization, we have created a NS
structure (struct zebra_ns) and VRFs don't correspond to namespaces (i.e.,
all VRFs exist in the default namespace). So, the RA handling should be
done under 'struct zebra_ns'.
With the changes, there is a single raw socket per NS (=> 1 for us) on which
we will receive and handle RAs for all interfaces. The interface information
is available through cmsg and the processing will then happen for that interface.
There is a problem with transmitting RAs over a VRF interface. This is
tracked by CM-9398.
Daniel Walton [Fri, 19 Feb 2016 13:36:06 +0000 (13:36 +0000)]
OSPFv2 has both "router-id x.x.x.x" and "ospf router-id x.x.x.x"
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-9285
dslice [Wed, 17 Feb 2016 18:19:18 +0000 (10:19 -0800)]
zebra: fix creation of "other table" for rdnbrd
zebra: add the creation of the alternative table for rdnbrd in the context of vrfs
When rdnbrd pulls arp entries into table 10, which are then sent into quagga via netlink, the entries were incorrectly being added to the main table. This fix creates or uses the alternative table if the table-id is not default but the vrf-id is default. Tested manually and also run successfully in the /tests/l3/ospf_ebgp_redist_comprehensive_test.py:TestBasicEndToEndPing , which consistently failed bafore this fix was applied.
Signed-off-by: Don Slice Reviewed-by: Donald Sharp
vivek [Wed, 17 Feb 2016 16:41:33 +0000 (08:41 -0800)]
BGP: Ensure correct sequence of processing at exit
With VRF support, certain objects are now maintained per BGP instance. At
exit, the list of BGP instances has to be freed only after processing the
per-instance objects.
Don Slice [Mon, 15 Feb 2016 18:36:57 +0000 (18:36 +0000)]
zebra: set vrf-id on vrf slave interfaces
vrf: check netlink message for slave info and set the vrf-id accoringly
When a netlink newlink or link change comes into zebra, check the IFLA_INFO_SLAVE_KIND
to discover if the interface is a member of a vrf or not. Set the vrf-id to the correct
value if the interface is a slave member
vivek [Fri, 12 Feb 2016 20:18:28 +0000 (12:18 -0800)]
BGP: VRF registration and cleanup
Various changes and fixes related to VRF registration, deletion,
BGP exit etc.
- Define instance type
- Ensure proper handling upon instance create, delete and
VRF add/delete from zebra
- Cleanup upon bgp_exit()
- Ensure messages are not sent to zebra for unknown VRFs
vivek [Fri, 12 Feb 2016 19:37:33 +0000 (11:37 -0800)]
Quagga: Support VRF unregister for clients
Clients (BGP, OSPF etc.) register with Zebra for information about
a VRF such as Router ID, interfaces and redistribution. Add API to
support unregister also which is required for the non-default VRF.
vivek [Thu, 11 Feb 2016 22:45:58 +0000 (14:45 -0800)]
BGP: Perform cleanup upon instance delete
When a BGP instance is deleted through 'no router bgp', the required
cleanup was not being performed. This is after VRF-related changes.
Fix to ensure this is taken care of.
Note: Further changes needed in this area for VRFs.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-9597
Reviewed By: CCR-4097
Testing Done: Verified failed test
Donald Sharp [Thu, 11 Feb 2016 16:29:36 +0000 (08:29 -0800)]
ripd: Fix crash when a default route is passed to rip
When rip is not configured and zebra decides to send
a default route to it, check to make sure that rip is
configured before accepting anything from zebra.
Ticket: CM-9270 Reviewed-by: Don Slice
Tested: OSPF test case that was erroring out no longer
happens
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Don Slice [Wed, 10 Feb 2016 17:53:21 +0000 (09:53 -0800)]
zebra: fix interface lookup for vrf configuration
Ticket:CM-9073
Reviewed By: sharpd
Testing Done:Manual, see ticket
Changed logic when "interface swpxx <vrf foo>" entered so that:
1. it matches when the command is entered without a vrf but the interface already exists in a vrf.
2. If the command is entered with a vrf name that is different than is defined by the kernel, the command is rejected.
3. If the call is made from other than the vty session, believe the new information and update the vrf accordingly.
Donald Sharp [Wed, 10 Feb 2016 12:30:56 +0000 (07:30 -0500)]
debian: Add Systemd integration to control files
Ticket:
Reviewed By: inprogress
Testing Done: minimal. Built, installed, started a few services.
This is in progress testing. quagga.service tries to start and stop
all the routing daemons. There is no check for whether they are enabled
via /etc/quagga/daemons (yet).
As installed, nothing is enabled (won't start on system boot or install).
The -A 127.0.0.1 is now in /etc/default/quagga, and picked up from there
by all routing daemons.
MAX_FDS is in all the service files for now as LimitNOFILE. Users who
need to modified the number of fd's will use e.g.
the file /etc/systemd/system/bgpd.service.d/maxfds.conf to override
bgpd.service contents
[Service]
LimitNOFILE=2048
MAX_INSTANCES isn't implemented yet.
reload isn't implemented yet (it should be possible via ExecReload
in the services, just not done yet).
The init.d file is removed.
All of the daemons are started without the -d/--daemonize option, and
use Type=simple rather than forking in the services file, to use the
systemd daemonizing.
All the daemons were set to have a 1m start time, and restart up to 3
times in 3 minutes, and for now, are only restart on-abnormal, not always
(we'll likely want the latter, but testing is easier with abnormal).
Also use tmpfiles.d to create /run/quagga
For now, we leave dh_installinit, even though it creates unneeded
update-rc.d calls, and causes lintian complaints about init.d files
that aren't present, so that it installs files like etc/default/quagga.
It also runs the tmpfiles.d commands for us, so we need to add those to
postinst if we dummy it out to fix the update-rc.d lines being added
(and lintian complaints).
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 10 Feb 2016 13:15:42 +0000 (08:15 -0500)]
*: Modify protocols to have systemd integration
Modify the daemons to integrate with systemd, if it is enabled via configure,
and to notify systemd that they are running/stopping and to send watch
notifications.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 3 Feb 2016 19:44:56 +0000 (14:44 -0500)]
debian: Remove 'Do you want to stop Quagga' Question
During the upgrade process of quagga, the user is asked
if they would like to stop quagga. There is no point in
asking this question. The fact that you are upgrading
means you are willing for a service interruption.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Wed, 3 Feb 2016 02:11:40 +0000 (21:11 -0500)]
config: Remove unused library check
configure.ac is looking for the setproctitle library,
which while it might be useful, we never call setproctitle
or any other function that the library might expose.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Mon, 1 Feb 2016 17:56:42 +0000 (09:56 -0800)]
zebra: Add the 'struct zebra_ns' data structure
This commit adds the 'struct zebra_ns' data structure.
We are not currently using it. But pretty much
everything after this commit in zebra depends on it.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Evgeny Uskov [Wed, 13 Jan 2016 10:58:00 +0000 (13:58 +0300)]
bgpd: Fix buffer overflow error in bgp_dump_routes_func
Now if the number of entries for some prefix is too large, multiple TABLE_DUMP_V2 records are created.
In the previous version in such situation bgpd crashed with SIGABRT.
Donald Sharp [Tue, 26 Jan 2016 14:57:17 +0000 (06:57 -0800)]
bgpd: Fix 'show bgp ipv4 vpnv4 statistics' cli
When attempting to use the 'show bgp ipv4 vpnv4 statistics' cli, the safi
choosen is BGP_MPLS_LABELED_VPN which is #defined to 128. The afi/safi
combination is fed to bgp->rib, which limits the size of the safi to BGP_SAFI_MAX
which is #defined to 5. The correct value to use is BGP_MPLS_VPN
The bgp code differentiates between the actual safi value for BGP_MPLS_LABELED_VPN
used defined by RFC 4364, to a internal SAFI value used to limit array size.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
vivek [Fri, 22 Jan 2016 18:56:48 +0000 (10:56 -0800)]
BGP: Rework iteration of peer_af_array
While processing references to the macro PEERAF_FOREACH(), aggressive loop
optimization by gcc 4.9.x (probably 4.8 and greater) was resulting in the
generated code not checking on the index as well as eliminating some code.
This was leading to a dereference of invalid memory when a BGP peer came up.
The fix is to scrap this convoluted macro. Two other changes done are to
eliminate overloading of "afindex" and make the loop iterator an integer.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Dave Olson <olson@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-8889
Reviewed By: CCR-4018
Testing Done: Verified failure scenario
Note: This code was added as part of update-groups implementation; when
upstreaming update-groups, this patch should also be included.
Donald Sharp [Fri, 22 Jan 2016 15:46:08 +0000 (10:46 -0500)]
lib: Allow zclient do-over of connect on initial attempt
When a protocol is attempting to connect to the zebra daemon
through it's socket. If the inital attempt fails, give it a
few more attempts before giving up and leaving the daemon in
a bizarre state.
This problem was found by Ashley Penney, and Ashley was of
immense help in debugging and testing the fix for this issue.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Tested-by: Ashley Penney <apenney@ntoggle.com>
Donald Sharp [Thu, 14 Jan 2016 14:19:29 +0000 (09:19 -0500)]
ospf6d: Fix double increment of Sequence Number
When OSPF6 is creating the header for the ROUTER LSA type
if the packet being sent has interface information to add
to the data, the Sequence Number is at least double incremented.
This change moves the header creation to outside the loop over
all interfaces in the area. Additionally the header is created
at the bottom of the function now.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Donald Sharp [Mon, 18 Jan 2016 17:44:52 +0000 (09:44 -0800)]
bgpd: Fix work-quanta to be a reasonable value
The work-quanta that a user can specify is ~4billion. If a user
specifies such a large value this translates into processing 4billion
outgoing packets before moving onto the next interface. This makes
no sense. Reduce the value of allowed work quanta's to be between
1 and 10000.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Daniel Walton [Thu, 14 Jan 2016 15:25:32 +0000 (15:25 +0000)]
BGP: ebgp-multihop should accept a value up to 255
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-8788
Donald Sharp [Wed, 13 Jan 2016 18:49:50 +0000 (10:49 -0800)]
doc, vtysh: Fixup of history handling
This fix does two things:
1) If the ${HOME}/.history_quagga file does not exist, create it
for history storing.
2) Allow vtysh -c "..." commands to be stored in history file
as well
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Don Slice [Wed, 13 Jan 2016 14:02:46 +0000 (06:02 -0800)]
lib:removed onmatch next and onmatch goto from route-map deny
Ticket: CM-7566
Reviewed By: Daniel Walton, Donald Sharp
Testing Done: Manual testing - see bug
Since on a route-map deny clause, the route-map will end on match, the on-match next and on-match goto statements are meaningless and confusing. Removed them.
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
vivek [Fri, 8 Jan 2016 06:14:38 +0000 (22:14 -0800)]
BGP: Only accept prefixes for negotiated address families
When handling a received Update message, only process and store the
prefixes if the corresponding address family has been negotiated with
the peer. Prior to this change, the receive processing only checked
whether the address family was locally configured, trusting to the peer
to not advertise prefixes for an address family that has not been
negotiated. Most implementations conform to this but a misbehavior could
result in processing and memory overhead.
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Ticket: CM-5594
Reviewed By: CCR-3946
Testing Done: Sanity test (good case)