Commit Graph

17846 Commits

Author SHA1 Message Date
Donatas Abraitis
d656cf7fd1
Merge pull request #5407 from lkrishnamoor/evpn_vni_json
zebra: "show evpn vni details json" prints incorrect JSON format
2019-11-26 08:49:54 +02:00
Donatas Abraitis
ee6e8c1cb0
Merge pull request #5420 from donaldsharp/zebra_client_summ_spacing
Zebra client summ spacing
2019-11-25 14:49:05 +02:00
Donatas Abraitis
4eeeaee80c
Merge pull request #5423 from qlyoung/fix-bgp-addpath-bad-boundscheck
bgpd: fix bad bounds check for addpath in nlri
2019-11-25 14:46:35 +02:00
Quentin Young
761ed66524 bgpd: fix bad bounds check for addpath in nlri
If a peer advertised capability addpath in their OPEN, but sent us an
UPDATE without an ADDPATH, we overflow a heap buffer.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-11-24 02:48:11 -05:00
Donald Sharp
59f8141924 zebra: Fix show ip nexthop route-map and show ip protocol
These commands were not properly lining up in their columns.
Fix this.

After:
VRF: default
Protocol                  : route-map
-------------------------------------
bgp                       : NO_INSTALL
vnc-direct                : none
vnc-rn                    : none
bgp-direct                : none
bgp-direct-to-nve-groups  : none

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-22 20:14:21 -05:00
Donald Sharp
0037287bee zebra: Fix show zebra client display to handle columns right
Before:
Type        Add        Update     Del
==================================================
IPv4        11539033    272         10751107
IPv6        1122106     43          1047081

After:

Type        Add         Update      Del
==================================================
IPv4        10517740    64          9729917
IPv6        1016590     8           941567

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-22 19:59:40 -05:00
Donald Sharp
588a30273d zebra: Adjust column display of show zebra client summ for openfabric
The openfabric daemon has a longer name than anticipated for
`show zebra client summary` adjust to allow it to fit without
making columns all blomped.

Before:
robot# show zebra client summ
Name      Connect Time    Last Read  Last Write  IPv4 Routes       IPv6 Routes
--------------------------------------------------------------------------------
static        00:00:06     00:00:06    00:00:06       4/0              0/0
openfabric      00:00:06     00:00:06    00:00:06       0/0              0/0

After:

[sharpd@robot frr4]$ vtysh -c "show zebra client summ"
Name      Connect Time    Last Read  Last Write  IPv4 Routes       IPv6 Routes
--------------------------------------------------------------------------------
static        00:02:16     00:02:16    00:02:16       4/0              0/0
openfabric    00:02:16     00:02:16    00:02:16       0/0              0/0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-22 19:29:55 -05:00
Mark Stapp
a5a1e515bb
Merge pull request #5413 from donaldsharp/eigrp_cleanup1
Eigrp cleanup1
2019-11-22 12:36:50 -05:00
Donatas Abraitis
d813028cf6
Merge pull request #5406 from lkrishnamoor/advertise-routes-bug2
bgpd: Blank RD in "sh bgp l2vpn evpn all neighbors ip advertised-routes json"
2019-11-22 16:09:22 +02:00
Mark Stapp
07e123defc
Merge pull request #5328 from satheeshkarra/pim_mlag
pimd, lib, zebra : PIM MLAG Support
2019-11-22 08:51:47 -05:00
Donald Sharp
d2d3d39415 eigrpd: Cleanup address dump functions to be a bit smarter
The address dump functionality needed to be written a bit
better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-22 08:36:29 -05:00
Donald Sharp
152e64e301 eigrpd: Cleanup eigrp_if_name_string
This function was excessively complicated.  Simplify and
make everyone use the same access macro.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-22 08:36:29 -05:00
Mark Stapp
4fd9a6ce4a
Merge pull request #5405 from sworleys/NHG-Respect-MPATH-Num
zebra: Actually respect the multipath number
2019-11-22 07:22:29 -05:00
Rafael Zalamena
ac7453a2c3
Merge pull request #5404 from donaldsharp/bsd_null_routes
zebra: BSD null routes were not being installed
2019-11-22 08:41:30 -03:00
Satheesh Kumar K
21a93a5f1b zebra: Fixing Comments in MLAG Read scheduling Events
Zebra MLAG is using "t_read" for multiple tasks, such as

1. For opening Communication channel with MLAG
2. In case conncetion fails, same event is used for retries
3. after the connection establishment, same event is used to
   read the data from MLAG

since all these taks will never schedule together, this will not
cause any issues.

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-21 20:39:35 -08:00
Lakshman Krishnamoorthy
06931fdb12 zebra: "show evpn vni details json" prints incorrect JSON format
edge-2> show evpn vni detail json
{
  "vni":79031,
  "type":"L3",
  ...,
  ...
}                                       <<<<<< no comma

{
  "vni":79021,
  "type":"L3",
  ...,
  ...
}                                       <<<<<< no comma

{
}                                       <<<<<< blank
edge-2>

The fix is to pack json info into json_array before printing it.

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-11-21 16:18:04 -08:00
Lakshman Krishnamoorthy
f5cfc290d3 bgpd: Blank RD in "sh bgp l2vpn evpn all neighbors <ip> advertised-routes json"
Bug: While preparing the JSON output, 2 loops are traversed: the outer loop
loops through RD, and the inner loop loops through the prefixes of that RD.

We hit the bug (printing blank RD and stale or null prefix info) when the inner
loop exits with nothing to print, (without allocating json_routes) and the outer
loop still tries to attach it to the parent, json_adv. Thus, we have
key=<BLANK RD>, value=<junk or prev json_routes>

The fix: Avoid attaching json_routes to the parent json if there
is nothing to print.

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-11-21 15:30:00 -08:00
Stephen Worley
4c55b5ff6b zebra: Set resolved inactive when > multipath_num
Apparently the multipath_num functionatlity has been broken
for a while because we were ignoring the recusive nexthops
when marking them inactive based on it.

This sets them as inactive as well if the parent breaks it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-11-21 16:28:31 -05:00
Stephen Worley
08de78b876 zebra: Use curr_active to check multipath_num
We were re-counting the entire group's active number on
every iteration of this nexthop_active_update() loop.

This is not great from a performance perspective but also
it was failing to properly mark things according to the
specified multipath_num.

Since a nexthop is set as active before this check, if its == to
the set ecmp, it gets marked inactive even though if its
under the max ecmp wanted!

ex)

set ecmp to 1.
`/usr/lib/frr/zebra -e 1`

All kernel routes will be marked inactive even with just one nexthop!

K   1.1.1.1/32 [0/0] is directly connected, dummy1 inactive, 00:00:10
K   1.1.1.2/32 [0/0] is directly connected, dummy2 inactive, 00:00:10
K   1.1.1.3/32 [0/0] is directly connected, dummy3 inactive, 00:00:10
K   1.1.1.4/32 [0/0] is directly connected, dummy4 inactive, 00:00:10
K   1.1.1.5/32 [0/0] is directly connected, dummy5 inactive, 00:00:10
K   1.1.1.6/32 [0/0] is directly connected, dummy6 inactive, 00:00:10
K   1.1.1.7/32 [0/0] is directly connected, dummy7 inactive, 00:00:10
K   1.1.1.8/32 [0/0] is directly connected, dummy8 inactive, 00:00:10
K   1.1.1.9/32 [0/0] is directly connected, dummy9 inactive, 00:00:10

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-11-21 15:27:12 -05:00
Donald Sharp
c3d6b38627 zebra: BSD null routes were not being installed
On BSD systems null routes were not being installed into the
kernel.  This is because commit 08ea27d112
introduced a bug where we were attempting to use the wrong
prefix afi types and as such we were going down the v6 code path.

test27.lab.netdef.org# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route
K>* 0.0.0.0/0 [0/0] via 192.168.122.1, 00:00:23
S>* 4.5.6.8/32 [1/0] unreachable (blackhole), 00:00:11
C>* 192.168.122.0/24 [0/1] is directly connected, vtnet0, 00:00:23
test27.lab.netdef.org# exit
[ci@test27 ~/frr]$ netstat -rn
Routing tables
Internet:
Destination        Gateway            Flags     Netif Expire
default            192.168.122.1      UGS      vtnet0
4.5.6.8/32         127.0.0.1          UG1B        lo0
127.0.0.1          link#2             UH          lo0
192.168.122.0/24   link#1             U        vtnet0
192.168.122.108    link#1             UHS         lo0

Fixes: #4843
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-21 09:37:36 -05:00
Donatas Abraitis
2d7ef3bba7
Merge pull request #5398 from taspelund/missed_newline
staticd: remove unneeded newline from zlog call
2019-11-21 09:34:01 +02:00
Trey Aspelund
8751e3bca5 staticd: remove unneeded newline from zlog call
PR 5303 was merged before the newline was removed from the zlog call.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
2019-11-20 16:26:08 -05:00
Donatas Abraitis
684912f509
Merge pull request #5250 from bisdhdh/bgp_nexthop_hash
bgpd: Implementing a hash table for connected address - ipv4/ipv6
2019-11-20 20:52:12 +02:00
Mark Stapp
fb72308b99
Merge pull request #5381 from donaldsharp/zebra_100_is_no_good
zebra: Router Advertisement socket mess up
2019-11-20 07:35:03 -05:00
Donatas Abraitis
d64ecad896
Merge pull request #5383 from donaldsharp/pim_buffer_fun
pimd: Various buffer overflow reads and crashes
2019-11-20 13:54:36 +02:00
Donatas Abraitis
c8eeee33c1
Merge pull request #5385 from donaldsharp/nhrp_doc_update
doc: Fix nhrp doc issue
2019-11-20 11:21:04 +02:00
Quentin Young
d83a854b5b pimd: fix bsm buflen check to include pim hdr
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-11-19 21:54:02 -05:00
Donald Sharp
ff7d3cf2b7 doc: Fix nhrp doc issue
The link to the strong swan patches was mumble snumped.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 21:53:37 -05:00
Donald Sharp
b1945363fb pimd: Various buffer overflow reads and crashes
A variety of buffer overflow reads and crashes
that could occur if you fed bad info into pim.

1) When type is setup incorrectly we were printing the first 8 bytes
of the pim_parse_addr_source, but the min encoding length is
4 bytes.  As such we will read beyond end of buffer.

2) The RP(pim, grp) macro can return a NULL value
Do not automatically assume that we can deref
the data.

3) BSM parsing was not properly sanitizing data input from wire
and we could enter into situations where we would read beyond
the end of the buffer.  Prevent this from happening, we are
probably left in a bad way.

4) The received bit length cannot be greater than 32 bits,
refuse to allow it to happen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 20:30:24 -05:00
Donald Sharp
1d696edbde
Merge pull request #5372 from opensourcerouting/snap-vrrpd
snapcraft: Add vrrpd to the snapcraft package
2019-11-19 17:47:03 -05:00
Quentin Young
1d92edb209
Merge pull request #5224 from manuhalo/fix_frr_reload_paths
Fixes and extensions to frr_reload.py
2019-11-19 17:12:38 -05:00
Donald Sharp
311c15ee60 zebra: Router Advertisement socket mess up
The code for when a new vrf is created to properly handle
router advertisement for it is messed up in several ways:

1) Generation of the zrouter data structure should set the rtadv
socket to -1 so that we don't accidently close someone elses
open file descriptor
2) When you created a new zvrf instance *after* bootup we are XCALLOC'ing
the data structure so the zvrf->fd was 0.  The shutdown code was looking
for the >= 0 to know if the fd existed (since fd 0 is valid!)

This sequence of events would cause zebra to consume 100% of the
cpu:

Run zebra by itself ( no other programs )
ip link add vrf1 type vrf table 1003
ip link del vrf vrf1
vtysh -c "configure" -c "no interface vrf1"

This commit fixes this issue.

Fixes: #5376
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 15:51:10 -05:00
bisdhdh
949b0f24fa bgpd: Implementing a hash table for connected address - ipv4/ipv6
* IPv6 routes received via a ibgp session with one of its own interface as
nexthop are getting installed in the BGP table.
*A common table to be implemented should take cares of both
ipv4 and ipv6 connected addresses.

Signed-off-by: Biswajit Sadhu sadhub@vmware.com
2019-11-20 01:23:11 +05:30
Sri Mohana Singamsetty
247c9ef645
Merge pull request #5377 from dslicenc/tools-bfd-timer-fix
tools: resolve issue with bfd timer change fix in frr-reload.py
2019-11-19 10:35:35 -08:00
Sri Mohana Singamsetty
49fa8e917d
Merge pull request #5375 from donaldsharp/pim_packet_issues
pimd: Fix possible read beyond end of data received
2019-11-19 10:31:47 -08:00
Rafael Zalamena
abdd51c11f
Merge pull request #5292 from donaldsharp/ospf_vrf_data
Ospf vrf data
2019-11-19 15:29:11 -03:00
Satheesh Kumar K
1e76492b10 zebra,pim : Fixing Review comments in PIM_MLAG
Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-19 08:54:11 -08:00
Russ White
943de56af6
Merge pull request #5241 from sworleys/SA-NHG
One More Zebra NHG SA Fix and nhg_ctx API Adjustment
2019-11-19 11:44:15 -05:00
Russ White
1157238115
Merge pull request #5274 from opensourcerouting/bfdd-vrf-socket
bfdd: VRF security improvement
2019-11-19 11:41:06 -05:00
Russ White
20a4c5f4f1
Merge pull request #5285 from ton31337/fix/send_BGP_NOTIFY_CEASE_PEER_UNCONFIG_after_no_neighbor
bgpd: Notify "Peer De-configured" after entering 'no neighbor <neighb…
2019-11-19 11:39:13 -05:00
Sri Mohana Singamsetty
6580da9f54
Merge pull request #5257 from ton31337/fix/update_rib_on_bgp_distance_changes
bgpd: Reflect the distance in RIB when it is changed for an arbitrary afi/safi
2019-11-19 08:35:57 -08:00
Russ White
f7a24d8d1b
Merge pull request #5371 from pguibert6WIND/filter_no_form
lib: no filter operations fix on appropriate access-list name
2019-11-19 11:21:20 -05:00
Russ White
9546c1b510
Merge pull request #5361 from donaldsharp/fpm_crash
zebra: FPM should have a way of shutting down
2019-11-19 10:30:43 -05:00
Don Slice
deb2d4019e tools: resolve issue with bfd timer change fix in frr-reload.py
Found that while the previous fix solved the traceback and created
the correct configuration, it was doing a delete/add process rather
than just an add.  This was due to an incorrectly created search
string. This commit fixes that search string and testing verifies
that the correct thing is now being done.

Ticket: CM-27233
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-11-19 13:40:23 +00:00
Donald Sharp
06424db447 pimd: Fix possible read beyond end of data received
If a register packet is received that is less than the PIM_MSG_REGISTER_LEN
in size we can have a possible situation where the data being
checksummed is just random data from the buffer we read into.

2019/11/18 21:45:46 warnings: PIM: int pim_if_add_vif(struct interface *, _Bool, _Bool): could not get address for interface fuzziface ifindex=0
==27636== Invalid read of size 4
==27636==    at 0x4E6EB0D: in_cksum (checksum.c:28)
==27636==    by 0x4463CC: pim_pim_packet (pim_pim.c:194)
==27636==    by 0x40E2B4: main (pim_main.c:117)
==27636==  Address 0x771f818 is 0 bytes after a block of size 24 alloc'd
==27636==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27636==    by 0x40E261: main (pim_main.c:112)
==27636==

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 08:22:50 -05:00
Donald Sharp
0263751346 ospfd: Rework ospf_read_packet into 2 functions
The indentation level for ospf_read was starting to be pretty
extremene.  Rework into 2 functions for improved readability.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 08:09:56 -05:00
Donatas Abraitis
5ab1b40c57
Merge pull request #5364 from lkrishnamoor/prefix_route_bugfix
bgpd: Bug fix in "show bgp l2vpn evpn X:X::X:X/M"
2019-11-19 15:00:08 +02:00
Donald Sharp
4392cc4337 ospfd: Allow packet reads based upon read/write packet counts
Read in up to 20(ospf write-multipler X) packets, for handling of data.

This improves performance because we allow ospf to have a bit more data
to work on in one go for spf calculations instead of 1 packet at a time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 07:47:19 -05:00
Donald Sharp
edca5860cb ospfd: The ip header dump is crazy long and useless
Turning on packet debugs and seeing a header dump that is 11
lines long is useless

2019/11/07 01:07:05.941798 OSPF: ip_v 4
2019/11/07 01:07:05.941806 OSPF: ip_hl 5
2019/11/07 01:07:05.941813 OSPF: ip_tos 192
2019/11/07 01:07:05.941821 OSPF: ip_len 68
2019/11/07 01:07:05.941831 OSPF: ip_id 48576
2019/11/07 01:07:05.941838 OSPF: ip_off 0
2019/11/07 01:07:05.941845 OSPF: ip_ttl 1
2019/11/07 01:07:05.941857 OSPF: ip_p 89
2019/11/07 01:07:05.941865 OSPF: ip_sum 0xcf33
2019/11/07 01:07:05.941873 OSPF: ip_src 200.254.30.14
2019/11/07 01:07:05.941882 OSPF: ip_dst 224.0.0.5

We already have this debugged, it's not going to change and the
end developer can stick this back in if needed by hand to debug
something that is not working properly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 07:47:19 -05:00
Donald Sharp
868a0861d2 ospfd: Add/fix some debugs to handle vrf
This commit has:
The received packet path in ospf, had absolutely no debugs associated with
it.  This makes it extremely hard to know when we receive packets for
consumption.  Add some breadcrumbs to this end.

Large chunks of commands have no ability to debug what is happening
in what vrf.  With ip overlap X vrf this becomes a bit of a problem
Add some breadcrumbs here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 07:47:19 -05:00