Commit Graph

17715 Commits

Author SHA1 Message Date
Stephen Worley
1ba2db775f zebra: Add an error code for NHG update failures
We needed an error code that can be used when we
fail to install a nexthop group into the kernel/fib.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
d1285db253 zebra: Add flags to nexthops received from the kernel
Added the appropriate flags that need to be set when
we receive a nexthop from the kernel. They should be
marked as ACTIVE and that they are in the FIB.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
d9f5b2f50f zebra: Add functionality to parse RTM_NEWNEXTHOP and RTM_DELNEXTHOP messages
Add the functionality to parse new nexthop group messages
from the kernel and insert them into the appropriate hash
tables. Parsing is done at startup between interface and
interface address lookup. Add functionality to parse
changes to nexthops we already have. Add functionality
to parse delete nexthop messages from the kernel and
remove them from our table.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
8b5bdc8bdf zebra: Remove afi field in nexthop hash entry
I do not believe we should be hashing based on AFI
in for our upper level nexthop group entries. These
should be ambiguous with regards to  address families since
an ipv4 or ipv6 address can have the same interface
nexthop. This can be seen in NEXTHOP_TYPE_IFINDEX.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
98fd05580c zebra: Add error code for duplicate nexthops
Add an error code that indicates we received a nexthop
from the kernel that is identical to one it/we already
have other than its ID.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Donald Sharp
b589493e70 zebra: Add beginnings of nexthop group work queue
Add the basic infrastructure for a nexthop group work queue.

This queue will be used to validate and then install the
new nexthop group.

The result from the kernel when a new nexthop group is installed
will cause the route entries that depend on it to be installed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Donald Sharp
f0cb8e16f0 zebra: Add a nhe pointer to the route entry
Add a nexthop hash entry to the route_entry so that we can
track the nhe with the route entry.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
3463f295e7 zebra: Add error codes for nhg table insert failures
Since we are using two different tables to hash the next groups with,
lets add an error message in case there is a failure to insert into
one of them. This will help to notify if the tables are not synced.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
a95b8020ca zebra: Add a second table for indexing by ID
The messages we get from the kernel come with ids only
for groups, so lets index with those as well. Also adding
a helper function for lookup and get with the two different
tables.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
d2bec88a36 zebra: Separate interface address lookup
Separate interface lookup into its own function.
We need to know interfaces for reading in nexthop
information, but we need to know nexthops for reading
in the interface addresses. We will read in nexthops
between the two.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
347bb8e269 zebra: Add error code for bad nhg messages from the kernel
Needed an error code for nhg messages from the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Donald Sharp
9a0d4dd39b zebra: Remove nexthop_active_num from route entry
The nexthop_active_num data structure is a property of the
nexthop group.  Move the keeping of this data to that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Donald Sharp
eecacedc3b zebra: Remove re->nexthop_num from re
The nexthop_num is not a function of the re.  It is owned
by the nexthop group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Donald Sharp
6b46851168 zebra: Replace nexthop_group with pointer in route entry
In the route_entry we are keeping a non pointer based
nexthop group, switch the code to use a pointer for all
operations here and ensure we create and delete the memory.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
79580b5ac4 zebra: Add base functionality for nexthop messages in kernel_netlink
Add some base functionality so we can verify we are getting messages
about nexthops from the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
da0ad5cfc8 zebra: Add RTNLGRP_NEXTHOP group to the kernel socket
Initialize the netlink socket with the RTNLGRP_NEXTHOP
group as well to listen for.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:36 -04:00
Stephen Worley
ce0e698017 linux: Update our netlink headers for nexthop group support
The linux kernel is adding support for nexthop groups. Update our
includes to reflect new types and structs we should be listening
for from the kernel.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:35 -04:00
Donald Sharp
22bcedb231 zebra: Add code to create/remove nexthop groups
Add some code to create/remove nexthop groups.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-10-25 11:13:35 -04:00
Donald Sharp
4e49c8b8a7 zebra: Add ability to find(create) and release a nhg from a re
Add some code to allow us to do lookups and releases of
nexthop groups from zebra.  At this point we do not do anything
with it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 11:13:35 -04:00
Donald Sharp
c8ee3cdb39 zebra: Add some basic flags to the zebra nexthop group
We need to track if a nexthop group is valid and installed,
so create some basic flags to track this.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 11:13:35 -04:00
Donald Sharp
21be136402 zebra: Add show command to dump nexthop-group information for Zebra
Just a simple addition of a command to dump the nexthop group information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 11:13:35 -04:00
Donald Sharp
69171da262 zebra: Add hash of nexthop groups
This commit does nothing more than just create a hash structure
that we will use to track nexthop groups.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 11:13:35 -04:00
Donald Sharp
253283d742 pimd: result was already tested against PIM_GROUP_BAD_ADDR_MASK_COMBO
The result variable was already tested against PIM_GROUP_BAD_ADDR_MASK_COMBO
earlier in the function.  No need to do the same thing twice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 07:07:49 -04:00
Donald Sharp
4d19a911c5 pimd: All paths have already derefed pim->global_scope.bsrp_table
All paths leading to this point in the code have already deref'ed
the pim->global_scope.bsrp_table.  No point in testing for
validness now.  This was caught by Coverity.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 07:05:11 -04:00
Donald Sharp
adc62ec8b7 lib: va_copy must have a va_end to free memory
All va_copy() calls must have a va_end() call.
Caught by Coverity

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 07:01:59 -04:00
Donatas Abraitis
b550350618 nhrp: Make sure no ip nhrp map <something> works as expected
We passed peer as NULL and nothing happened.

exit2-debian-9# conf
exit2-debian-9(config)# int gre1
exit2-debian-9(config-if)# ip nhrp map 1.1.1.1 local
exit2-debian-9(config-if)# ip nhrp map 2.2.2.2 3.3.3.3
exit2-debian-9(config-if)# do sh run
...
!
interface gre1
 ip nhrp map 1.1.1.1 local
 ip nhrp map 2.2.2.2 3.3.3.3
!
...
exit2-debian-9(config-if)# no ip nhrp map 1.1.1.1
exit2-debian-9(config-if)# do sh run
...
!
interface gre1
 ip nhrp map 2.2.2.2 3.3.3.3
!

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-10-25 13:05:49 +03:00
Donatas Abraitis
e1a3c0effa
Merge pull request #5213 from mjstapp/fix_sysctl_h
lib: Remove include of deprecated sysctl.h
2019-10-25 08:40:28 +03:00
Donald Sharp
7647930dc7
Merge pull request #5200 from ton31337/feature/doc_access-list_sequence_numbers
doc: Update documentation for access-list with sequence numbers
2019-10-24 21:24:56 -04:00
Donald Sharp
49085521fa zebra: Prevent possible uninited value
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-24 20:15:56 -04:00
Donald Sharp
29f7fc8788 pimd: Cast up to 64 bit to prevent overflow
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-24 20:00:01 -04:00
Donald Sharp
35a3030297 pimd: Initialize nht_p variable
nht_p.family and .prefixlen have code paths where we may not
initialize.  Fix.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-24 19:35:46 -04:00
Donald Sharp
3bb29c4e9b pimd: Check return code of pim_msg_send()
The pim_msg_send() return code was not being checked.  Make
consistent with it's usage everywhere else.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-24 19:31:27 -04:00
Donald Sharp
68a4422da4 lib: vrf lookup may be NULL
The vrf lookup may be NULL, so let's protect against this.
Found in coverity

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-24 18:44:48 -04:00
Donatas Abraitis
9ebe7ac966
Merge pull request #5220 from dslicenc/remove-afi-safi-msg
bgpd: remove error message for unkown afi/safi combination
2019-10-24 18:19:13 +03:00
Donatas Abraitis
3f8aebe012
Merge pull request #5219 from pguibert6WIND/interface_same_name
staticd: check tuple (vrf, name) when interface events received
2019-10-24 17:01:56 +03:00
Don Slice
8e5509b04b bgpd: remove error message for unkown afi/safi combination
Problem reported with error messages appearing in the log
complaining about invalid afi/safi combinations.  Determined
that the error messages were recently added in the function
that turns afi and safi values to strings.  Unfortunately,
the function is called from places using FOREACH_AFI_SAFI,
which spins thru every afi and safi number including some
that are not legal together (ipv4 evpn and l2vpn multicast
for example.)   This fix removes these error messages since
it is not necessarily an error to call it with invalid
combinations.

Ticket: CM-26883
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-10-24 11:29:40 +00:00
Renato Westphal
f935dca78f
Merge pull request #5203 from qlyoung/fix-vrrp-error-alternations
vrrpd: fix startup error message reporting
2019-10-23 21:16:04 -03:00
Renato Westphal
9951e1c711
Merge pull request #5217 from mjstapp/fix_bgp_evpn_pi
bgpd: clarify evpn datastruct use for SA
2019-10-23 21:02:00 -03:00
Renato Westphal
5d98d948d2
Merge pull request #5214 from donaldsharp/vrrp_doc
doc: Update supported platforms matrix w/ vrrpd
2019-10-23 21:00:25 -03:00
Renato Westphal
a783c421f9
Merge pull request #5202 from Orange-OpenSource/isis-TE
isisd: Correct missing advertisement of TE parameters
2019-10-23 20:59:29 -03:00
Philippe Guibert
9eb8b14c85 staticd: check tuple (vrf, name) when interface events received
with network namespace vrf backend, there is possibilities that the same
interface name can be used across two different vrfs. Then, enforce the
check when static daemon receives interface events. Adding to the
interface name, check for the vrf id, too.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-10-23 18:50:56 +02:00
Mark Stapp
bd0254af6c bgpd: clarify evpn datastruct use for SA
Clear up an SA report by clarifying a function call in the evpn
code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-10-23 11:56:35 -04:00
Donatas Abraitis
a0903cd24c bgpd: Override peer's TTL only if peer-group is configured with TTL
When a peer-group is configured for an already configured eBGP neighbor,
ebgp-multihop command is removed for that peer.

This fix remains configured peer's ebgp-multihop value if peer-group does
not have ebgp-multihop configured.

!
router bgp 100
 neighbor A8 peer-group
 neighbor A9 peer-group
 neighbor A9 ebgp-multihop 12
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 ebgp-multihop 255
 neighbor 4.4.4.4 remote-as 123
 !

spine1-debian-9#
spine1-debian-9# conf
spine1-debian-9(config)# router bgp 100
spine1-debian-9(config-router)# neighbor 3.3.3.3 peer-group A8
spine1-debian-9(config-router)# do sh run

!
router bgp 100
 neighbor A8 peer-group
 neighbor A9 peer-group
 neighbor A9 ebgp-multihop 12
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 peer-group A8
 neighbor 3.3.3.3 ebgp-multihop 255
 neighbor 4.4.4.4 remote-as 123
!

spine1-debian-9(config-router)# neighbor 4.4.4.4 peer-group A9
spine1-debian-9(config-router)# do sh run

!
router bgp 100
 neighbor A8 peer-group
 neighbor A9 peer-group
 neighbor A9 ebgp-multihop 12
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 peer-group A8
 neighbor 3.3.3.3 ebgp-multihop 255
 neighbor 4.4.4.4 remote-as 123
 neighbor 4.4.4.4 peer-group A9
!

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2019-10-23 18:04:14 +03:00
Donald Sharp
36d687f6fa doc: Update supported platforms matrix w/ vrrpd
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-23 09:11:45 -04:00
Mark Stapp
15e84e5abb lib: Remove include of deprecated sysctl.h
Stop including deprecated header file; appears to be unused and
it has been deprecated in recent linux.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-10-23 09:08:21 -04:00
Quentin Young
3e6fd94f83
Merge pull request #5204 from ghasemnaddaf/vrrp_updates
doc: vrrp vip must not be on parent interface
2019-10-22 11:27:29 -04:00
Donatas Abraitis
4b0d7efeea
Merge pull request #5193 from qlyoung/doc-release-fixes
Document release procedure
2019-10-22 09:57:12 +03:00
Ghasem Naddaf
9965000665 doc: vrrp vip must not be on parent interface
Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
2019-10-21 14:58:16 -07:00
Quentin Young
00c3cf9c2a vrrpd: fix startup error message reporting
Due to some extremely shoddy programming on my part, the error messages
for certain errors was pretty much always wrong. We would start with the
correct error message, then on the next check, regardless of whether it
passed or failed, we would null out the error message, then on the next
one set it again (to the wrong message), then null it, and just keep
alternating. So errors were sometimes not being reported, sometimes
being reported correctly (if the condition parity happened to match the
appropriate condition), and sometimes being reported correctly.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-10-21 19:04:30 +00:00
Olivier Dugeon
9f62f0435e isisd: Correct missing advertisement of TE param.
Traffic Engineering parameters are correctly advertised in LSP when
'mpls-te on' CLI command is present in the startup config file.

However, if IS-IS is started without TE enable at startup and
'mpls-te on' command is issued after, TE link parameters are never
announced. The patch correct this issue.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2019-10-21 18:44:20 +02:00