Commit Graph

18714 Commits

Author SHA1 Message Date
Donald Sharp
30b544edc4 zebra: Fix checksum calculation to not include old checksum
As part of checksum calculation for a received packet we were
comparing the checksum returned from in_cksum.  Typically
when we calculate the checksum the value stored in the checksum
must be all 0's.  Store the received checksum and then set
the checksum to 0 and then compare.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-18 09:34:18 -05:00
Donald Sharp
3d0deb9c8b zebra: Fix zlog_debug -> flog_err for error situations in IRDP
In several places we would send debug messages for failure situations
that really should be errors.

Signed-off-by: Donald Sharpd <sharpd@cumulusnetworks.com>
2020-02-18 09:34:18 -05:00
Donald Sharp
08fa52a826 zebra: SO_BROADCAST needs a uint32_t instead of a uint8_t
Using SO_BROADCAST, in the linux kernel, requires a uint32_t to be passed
in for all SOL_SOCKET calls.  Modify code to use it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-18 09:33:16 -05:00
Naveen Thanikachalam
009d25a064 lib: Optimizing route-maps - Part-4
The commit includes the documentation for the newly introduced
commands to enable/disable the optimization.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
2020-02-18 02:08:29 -08:00
Naveen Thanikachalam
2d26f094c1 lib: Optimizing route-maps - Part-3
* This commit implements the code style suggestions from Polychaeta.
* This commit also introduces a CLI to toggle the optimization and, a hidden
  CLI to display the contents of the constructed prefix tree.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
2020-02-18 02:08:29 -08:00
Naveen Thanikachalam
819a23f9fc lib: Optimizing route-maps - Part-2
This commit introduces the logic that computes the best-match route-map index
for a given prefix.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
2020-02-18 02:08:29 -08:00
Naveen Thanikachalam
49a08bb091 lib: Optimizing route-maps - Part-1
* This commit introduces the building blocks.
    A per-route-map prefix tree is introduced.
    This tree will consist of the prefixes defined within the prefix-lists
    that are added to the match clause of that route-map.

Signed-off-by: NaveenThanikachalam <nthanikachal@vmware.com>
2020-02-18 02:08:14 -08:00
Sri Mohana Singamsetty
dea8e5f275
Merge pull request #5801 from donaldsharp/bgp_peer_sort
Bgp peer sort
2020-02-17 21:39:37 -08:00
Sri Mohana Singamsetty
e661b88e62
Merge pull request #5790 from chiragshah6/mdev
bgpd: format fields to bgp evpn vni json cmds
2020-02-17 21:39:16 -08:00
Donald Sharp
4765870ee7
Merge pull request #5807 from ton31337/fix/do_not_show_failed_if_shutdown
bgpd: Show the real reason why the peer is failed
2020-02-17 09:29:28 -05:00
Jafar Al-Gharaibeh
b5a3c5ef9f
Merge pull request #5815 from donaldsharp/feb_sa_stuff
bgpd: Fix up a couple of new SA issues found
2020-02-16 23:41:55 -06:00
Jafar Al-Gharaibeh
2c36681d43
Merge pull request #5817 from donaldsharp/more_bgp_rcvd_sent
bgpd: Add a couple more spaces for output on MsgRcvd and MsgSent
2020-02-16 23:40:31 -06:00
Jafar Al-Gharaibeh
9c10e154e3
Merge pull request #5820 from donaldsharp/pcreposix
lib: Fix so that `--enable-pcreposix` actually compiles
2020-02-16 23:39:03 -06:00
Jafar Al-Gharaibeh
547873db2e
Merge pull request #5821 from donaldsharp/configure_fixup
Configure fixup
2020-02-16 23:31:53 -06:00
Donald Sharp
bed8d78bae bgpd: Add a couple more spaces for output on MsgRcvd and MsgSent
annie# show bgp ipv4 uni summ
BGP router identifier 192.168.201.136, local AS number 64539 vrf-id 0
BGP table version 22458946
RIB entries 1458006, using 178 MiB of memory
Peers 4, using 68 KiB of memory

Neighbor               V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
45.33.5.119            4          0       0       0        0    0    0    never       Active
65.19.134.122          4      15096 4611832  108292        0    0    0 6d22h55m       800670
107.13.46.23           4          0       0       0        0    0    0    never      Connect
robot(192.168.201.139) 4      64540 11159975 11365599        0    0    0 05w2d05h      Connect

Total number of neighbors 4

On very busy systems The column output for MsgRcvd and MsgSent can quickly move past 7 columns.
Add a couple more to allow for even display.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-16 20:38:13 -05:00
Donald Sharp
c295c6cec1 doc: Update configure options in installation notes
Add some missing configuration options in the installation notes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-16 14:57:39 -05:00
Donald Sharp
e2b26a4d4e configure: Fixup --disable-irdp option to reflect reality
The help text was not properly setup for `--disable-irdp` fix
it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-16 14:39:49 -05:00
Donald Sharp
b15968b11f
Merge pull request #5814 from Jafaral/nhrp-no
nhrpd: allow no nhrp map cmd to match the configured cmd
2020-02-16 14:15:42 -05:00
Donald Sharp
beee9b4a26 lib: Fix so that --enable-pcreposix actually compiles
The `--enable-pcreposix` configure option was not actually compiling
properly.  Follow pre-existing pattern for inclusion of regex.h
or the pcreposix.h header.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-16 14:14:04 -05:00
Donatas Abraitis
07d1e5d99d bgpd: Show the real reason why the peer is failed
If the peer was shutdown locally, it doesn't show up as admin. shutdown.
Instead it's treated as "Waiting for peer OPEN".

The same applies to when the peer reaches maximum-prefix count.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-02-14 23:23:52 +02:00
Mark Stapp
4945002d71 *: encode zapi labels message using nexthops
Use the zapi_nexthop struct with the mpls_labels
zapi messages instead of the special-purpose (and
more limited) nexthop struct that was being used.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-14 16:16:21 -05:00
Donald Sharp
69337c345e bgpd: Use the enum properly in a switch for rpki commands
During route-map processing we return an enum, the rpki
code was doing some extra gyrations that were unnecessary.
Simplify.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 15:38:38 -05:00
Donald Sharp
8c9769e03b bgpd: Ensure we don't crash when registering RA's
There exists a code path that the ifp can be NULL.
Prevent an accident.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 15:35:37 -05:00
Mark Stapp
9183794425
Merge pull request #5811 from dslicenc/ipv6_ra_prefixes
zebra: add all ipv6 global addresses to RA messages
2020-02-14 14:44:55 -05:00
Donald Sharp
6f29169e06 doc: Fix borked up syntax for static-linking
Fix documentation such that it is displayed as intended.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 14:18:38 -05:00
Donald Sharp
bf9735b240 doc: Fixup some missing syntax
We were missing some syntax indicators for stuff in doc/developer
add them in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 14:17:52 -05:00
Donald Sharp
93a142e4fc doc: Add some basic how-to for lua
Add a couple breadcrumbs to get people up and running
with lua when they are trying to develop for it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 14:17:52 -05:00
Jafar Al-Gharaibeh
29ff6b5cb6 nhrpd: allow no nhrp map cmd to match the configured cmd
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2020-02-14 11:49:58 -06:00
Anuradha Karuppiah
94bd5b9347 tests: Add a evpn-pim test case
This is a basic setup and test of evpn-pim.
Create a vxlan device ensure that pim notices this
and setups the appropriate groups and sends them
to the RP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
f80427e9e7 pimd: pim mlag show commands
1. show ip pim mlag summary
provides MLAG session information and stats
2. show ip pim mlag upstream
displays the upstream entries synced across the MLAG switches

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
650d9ad1ac pimd: handle ipmr-lo operational state changes
ipmr-lo is an internally added device used for multicast vxlan tunnel
termination. This device is not expected to be managed by the admin
however in the case it is accidentally shut we need to be able handle
it by recovering when it is "no shut" again.

Ticket: CM-24985

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
20fcf61c37 pimd: handle nht metric change correctly
PIM MLAG DF election API was not being triggered on cost change if the
upstream neighbor remained the same.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
d1a3e8df42 lib: add missing command DESC for MLAG messages
This string is used in some logging for e.g. in zclient_read -
>>>>>>>>>>>>>>>>>>>>>>>>>>
    if (zclient_debug)
        zlog_debug("zclient 0x%p command %s VRF %u",
               (void *)zclient, zserv_command_string(command),
               vrf_id);
>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
6823b1dcc3 pimd: remove peerlink_rif from the orig-mroute OIL when it is oper down
In an anycast VTEP setup the peerlink_rif is added as a static OIF
to the originating mroute (bypassing the pim state machine). This is
needed to ensure both MLAG switches rx a copy of encapsulated BUM flow.

We were not handling link state changes on this static OIF resulting
in the wrong vifi being used in the OIL (because of vifi re-allocation).
This commit re-acts to oper state changes by deleting the OIF on link
down and re-adding it on link up.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
448139e704 pimd: stop overloading SRC_IGMP upstream for vxlan local membership
A local membership is created on the vxlan termination device ipmr-lo. This
is done to -
1. Pull multicast vxlan tunnel traffic to the VTEP for termination by
triggering JoinDesired on the BUM multicast group.
2. Include the OIF in the mroute to signal to the dataplane component
that flow needs to be vxlan terminated.

Earlier we were overloading the PIM_UPSTREAM_FLAG_MASK_SRC_IGMP for
this local membership creation but that is creating confusion both in
the state machine and in the show outputs. To avoid that we use the
more apparent PIM_UPSTREAM_FLAG_MASK_SRC_VXLAN_TERM. With this change -
1. We get LHR functionality for VXLAN_TERM mroutes
2. OIF is populated with PIM_OIF_FLAG_PROTO_PIM only

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
664b2a31d6 pimd: force update inherited OIL when vxlan local membership is created
When local member is added the (*, G) entry may already be in a JOINED
state. In that case the OIL is not updated i.e. pim_channel_add_oif is
not happening for ipmr-lo. Because of this the traffic associated with
the multicast vxlan tunnel is pulled down to the VTEP but not terminated
by the kernel.

This change force updates the OIL anytime ipmr-lo is added or removed
as a local member.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
73db824993 pimd: skip syncing and running DF election on orig mroutes
This is not causing functional problems but has become a source
of confusion. DF status is only relevant to multicast tunnel decaps.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
f03999caa6 pimd: increase RPF metric via the peerlink_rif by plus-10
The RPF cost is incremented by 10 if the RPF interface is the peerlink-rif.
This is used to force the MLAG switch with the lowest cost to the RPF
to become the MLAG DF. If a switch has to go via the peerlink-rif to get
to the RP or source it simplly cannot be the designated forwarder.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
95586137e6 pimd: inherit MLAG DF role from the parent (*, G) entry
DF election is only run for (*,G) entries i.e. election is skipped
for (S,G) entries that are setup as a result of SPT switchover. (S,G)
entries inherit the DF role from the parent (*,G) entry. So the DF is
responsible for terminating all sources associated with a group.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
05ca004b80 pim: DF election for tunnel termination mroutes in an anycast-VTEP setup
1. Upstream entries associated with tunnel termination mroutes are
synced to the MLAG peer via the local MLAG daemon.
2. These entries are installed in the peer switch (via an upstream
ref flag).
3. DF (Designated Forwarder) election is run per-upstream entry by both
the MLAG switches -
a. The switch with the lowest RPF cost is the DF winner
b. If both switches have the same RPF cost the MLAG role is
used as a tie breaker with the MLAG primary becoming the DF
winner.
4. The DF winner terminates the multicast traffic by adding the tunnel
termination device to the OIL. The non-DF suppresses the termination
device from the OIL.

Note: Before the PIM-MLAG interface was available hidden config was
used to test the EVPN-PIM functionality with MLAG. I have removed the
code to persist that config to avoid confusion. The hidden commands are
still available.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
0309c55d42 pimd: register with MLAG on the first VxLAN SG
Channel with the MLAG daemon is setup on the first VxLAN BUM MDT or
pim-mlag AA SVI.

This channel is used for -
1. rxing MLAG status status updates (peer state, role etc.)
2. for syncing active-active upstream entries with the peer MLAG
switch.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Anuradha Karuppiah
ef011a4287 zebra: mlag debug was not being persisted
Added the mlag keyword to the config level also (in addition to the
view level).

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-02-14 09:18:30 -08:00
Don Slice
2a85576310 zebra: add all ipv6 global addresses to RA messages
RFC 4861 states that ipv6 RA messages sent out an interface should
contain all global ipv6 addresses on that interface. This fix adds
that capability.  To override the default flags and timer settings
for a particular prefix, the existing "ipv6 nd prefix ..." command
should be used via vtysh under the appropriate interface.

Ticket: CM-20363
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2020-02-14 17:03:16 +00:00
Donald Sharp
137147c66a bgpd: Print out vrf name as well as id
The vrf_id is not enough context for people.  Use the
actual name of the vrf if you can.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 08:44:27 -05:00
Donald Sharp
c479e75665 zebra: Add vrf name to debug output
The vrf id is insufficient of a discriminator in people's head
Give them what they need.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 08:41:42 -05:00
Donald Sharp
24c4ee4a1f ripngd: Add vrf name to debug output
The vrf id is insufficient of a discriminator in people's head
Give them what they need.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 08:41:42 -05:00
Donald Sharp
5434aac451 ripd: Add vrf name to debug output
The vrf id is insufficient of a discriminator in people's head
Give them what they need.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 08:41:42 -05:00
Donald Sharp
a94fbcca24 lib: Add vrf name to outputs/debugs
Add some additional output/debug to code to allow
us to see the vrf name instead of just the vrf id.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 08:41:42 -05:00
Donald Sharp
b7e48f2147 lib: Add a macro to allow for quick/easy display of vrf name
Add a quick macro to allow for safe dereference of the vrf
since it may or may not exist in all cases.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 08:15:40 -05:00
Donald Sharp
ac2914d326 lib: Format according to our standard
A couple of functions needed to be reformated.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-14 08:15:33 -05:00