Commit Graph

18714 Commits

Author SHA1 Message Date
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
Anuradha Karuppiah
9e558d9ac8 pimd: exclude pimreg from the inherited OIL
Inherited OIL is used as a part of the JoinDesired macro. And in FRR we
use the channel OIL as the inherited OIL (to reduce processing overhead
everytime JD needs to be re-evaluated). On a FHR pimreg is a part of the
channel-OIL but must not be used for JD computation.

This commit blacklists pimreg from the inherited_oil i.e. present but
ignored.

Note: This fixup is being done to address topotest failures.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-19 10:47:01 -08:00
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
Juergen Werner
54317cbae5 bgpd: Special handling for 2-level routing tables
The command `show ip bgp ipv4|ipv6 vpn neighbors <ip> prefix-counts`
caused a segfault, because the 2-level routing was not accounted for.

Signed-off-by: Juergen Werner <juergen@opensourcerouting.org>
2019-11-19 17:41:04 +01: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
Donald Sharp
88b6b28ef3 ospfd: Add a function to return the name of the vrf we are in.
Add a helper function to return the name of the vrf we are in
so it can be used as part of debug strings.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 07:47:19 -05:00
Donald Sharp
f573ec607c ospfd: Remove ORIGINAL_CODING check
We have a bunch of places that look for ORIGINAL_CODING.  There is
nothing in our configure system to define this value and a quick
git blame shows this code as being original to the import a very
very long time ago.  This is dead code, removing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-19 07:47:19 -05:00
Philippe Guibert
2bf92084b7 lib: no filter operations fix on appropriate access-list name
some vty no operations were not removing the entry of the access-list,
since the access-list name was not retrieved correctly. the index was
not correct for 'no ipv6 access-list WORD' operations, but also for one 'no
access-list WORD [..] any' operation.

PR=66244
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Acked-by: Alain Ritoux <alain.ritoux@6wind.com>
2019-11-19 13:33:36 +01:00
Martin Winter
7b9e46d493 snapcraft: Add vrrpd to the snapcraft package
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2019-11-19 10:46:33 +01:00
Donatas Abraitis
47774e2757
Merge pull request #5354 from mitch-skiba/addpath-fix
bgpd: Fix per afi/safi addpath peer counting
2019-11-19 08:38:59 +02:00
Lakshman Krishnamoorthy
62e43fd7a8 bgpd: Bug fix in "show bgp l2vpn evpn X:X::X:X/M"
The CLI was not parsing prefix format of ipv6 address.
This fixes the bug: https://github.com/FRRouting/frr/issues/5322

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
2019-11-18 18:20:21 -08:00
Sri Mohana Singamsetty
6ad1d734e8
Merge pull request #5294 from chiragshah6/evpn_dev
zebra: evpn update remote rmac and nexhop
2019-11-18 13:32:46 -08:00
Donald Sharp
f0c459f006 zebra: FPM should have a way of shutting down
When we shut down zebra, we were not doing anything to shut
down the FPM.  Perform the necessary occult rituals and
stop the threads from running during early shutdown.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-18 14:49:46 -05:00
Jafar Al-Gharaibeh
c449e2b45c
Merge pull request #5360 from donaldsharp/pim_crash_rp
Pim crash rp
2019-11-18 13:43:14 -06:00
Mitch Skiba
d4a0d83bfd bgpd: Fix per afi/safi addpath peer counting
The total_peercount table was created as a short cut for queries about
if addpath was enabled at all on a particular afi/safi. However, the
values weren't updated, so BGP would act as if addpath wasn't enabled
when determining if updates should be sent out. The error in behavior
was much more noticeable in tx-all than best-per-as, since changes in
what is sent by best-per-as would often trigger updates even if addpath
wasn't enabled.

Signed-off-by: Mitchell Skiba <mskiba@amazon.com>
2019-11-18 19:22:04 +00:00
Donatas Abraitis
990a0b15bb
Merge pull request #5359 from donaldsharp/pim_rp_static
pimd: Tighten up `show ip pim rp-info`
2019-11-18 19:31:43 +02:00
Donald Sharp
0f39cb4cb9 pimd: Create pimreg interface when we start any interface config
When you configure interface configuration without explicitly
configuring pim on that interface, we were not creating the pimreg
interface and as such we would crash in an attempted register
since the pimreg device is non-existent.

The crash is this:
==8823== Invalid read of size 8
==8823==    at 0x468614: pim_channel_add_oif (pim_oil.c:392)
==8823==    by 0x46D0F1: pim_register_join (pim_register.c:61)
==8823==    by 0x449AB3: pim_mroute_msg_nocache (pim_mroute.c:242)
==8823==    by 0x449AB3: pim_mroute_msg (pim_mroute.c:661)
==8823==    by 0x449AB3: mroute_read (pim_mroute.c:707)
==8823==    by 0x4FC0676: thread_call (thread.c:1549)
==8823==    by 0x4EF3A2F: frr_run (libfrr.c:1064)
==8823==    by 0x40DCB5: main (pim_main.c:162)
==8823==  Address 0xc8 is not stack'd, malloc'd or (recently) free'd

pim_register_join calls pim_channel_add_oif with:

	pim_channel_add_oif(up->channel_oil, pim->regiface,
			    PIM_OIF_FLAG_PROTO_PIM);

We just need to make srue pim->regiface exists once we start configuring
pim.

Fixes: #5358
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-18 11:43:52 -05:00
Donald Sharp
1e0d1c25e5 pimd: Dissallow obvious addresses from being the RP
When configuring a RP, dissallow the choice of 0.0.0.0 or
255.255.255.255 as the address as that they make no sense
what so ever.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-18 10:48:49 -05:00
Donald Sharp
d6593fc56d pimd: Tighten up show ip pim rp-info
We were adding a newline for the source in some cases
but not others and tighten up the display of data

eva# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source
10.254.0.1       224.0.0.0/4         lo                yes        Static
4.4.4.4          225.1.2.3/32        abcdefghijklmno   yes        Static
10.0.20.45       226.200.100.100/32  r1-eth0           no         Static
eva#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-11-18 09:06:56 -05:00
Donatas Abraitis
839bdd0f45
Merge pull request #5334 from adharkar/frr-master-nexthop_check
bgpd: Add nexthop of received EVPN RT-5 for nexthop tracking
2019-11-18 09:57:01 +02:00
Donatas Abraitis
cabf6c7141
Merge pull request #5357 from qlyoung/doc-overview-cleanup
doc: clean up overview.rst
2019-11-17 11:03:13 +02:00
Quentin Young
83621c63d3 doc: add link to developer docs
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-11-16 21:46:49 -05:00
Quentin Young
3252e3c801 doc: clean up overview.rst
Move the "how to get" blurb to a more obvious place and include a link
to the apt repo.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-11-16 21:25:19 -05:00
Donatas Abraitis
75b3bd3534
Merge pull request #5327 from lkrishnamoor/rm_rd_filter
bgpd: route-map support for evpn RD filter
2019-11-16 08:55:24 +02:00
Sri Mohana Singamsetty
670812fd13
Merge pull request #5312 from chiragshah6/evpn_dev2
bgpd: fix memory leak in vni-vrf route tables for evpn routes
2019-11-15 15:39:53 -08:00
Sri Mohana Singamsetty
c3ccfcfaaa
Merge pull request #5335 from opensourcerouting/ldpd-buffer-overflow
ldpd: add missing sanity check in the parsing of label messages
2019-11-15 15:37:33 -08:00
Anuradha Karuppiah
2bc31c4422 pimd: prevent LHR from register forwarding packets for non-FHR sources
SPT switchover handling is done by adding pimreg in the OIL of the (*, G)
entry on the LHR. This causes multicast data with that destination to be
sent to pimd as IGMPMSG_WHOLEPKT. These packets trigger creation of (S,G)
and also register forwarding. However register forwarding must only be done
if the router is also a FHR. That FHR check was missing causing strange
source registrations from multicast routers that were not directly
connected to the source.

Relevant logs from LHR -
PIM: pim_mroute_msg: pim kernel upcall WHOLEPKT type=3 ip_p=0 from fd=9 for (S,G)=(6.0.0.30,239.1.1.111) on pimreg vifi=0  size=98
PIM: Sending (6.0.0.30,239.1.1.111) Register Packet to 81.0.0.5
PIM: pim_register_send: Sending (6.0.0.30,239.1.1.111) Register Packet to 81.0.0.5 on swp2

And 6.0.0.30 is clearly not directly connected on that router -
root@tor-11:~# ip route |grep 6.0.0.30 -A2
6.0.0.30 proto ospf metric 20
	nexthop via 6.0.0.22 dev swp1 weight 1 onlink
	nexthop via 6.0.0.23 dev swp2 weight 1 onlink
root@tor-11:~#

Ticket: CM-24549

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:09 -08:00
Anuradha Karuppiah
a04f8890d1 pimd: prevent unconditional SG join sends
It was causing a Join on (S,G) who's prune state was being cleared. This
was an inactive (KAT not running; no immediate OIL) entry that was being
flushed out but because of this incorrect Join (that was being done with
out join-state checks) the source was getting populated repeatedy i.e.
never aged.

Output of "ip monitor mroute"
=============================
(27.0.0.11,239.1.1.102)          Iif: lo          State: resolved Table: default
Deleted (27.0.0.11,239.1.1.102)          Iif: lo          State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: pimreg      State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: uplink-1    State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: uplink-1    State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: uplink-1    State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: lo         Oifs: uplink-1  State: resolved Table: default
(27.0.0.11,239.1.1.104)          Iif: lo         Oifs: pimreg uplink-1  State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: lo         Oifs: pimreg uplink-1  State: resolved Table: default
Deleted (27.0.0.11,239.1.1.102)          Iif: lo          State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: pimreg      State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: uplink-1    State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: uplink-1    State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: uplink-1    State: resolved Table: default
(27.0.0.11,239.1.1.102)          Iif: lo         Oifs: uplink-1  State: resolved Table: default

These mroute events (on a no longer existing multicast souce) continue in
a never ending loop.

Triggered joins/prunes MUST only done via state machine transitions i.e.
via pim_upstream_update_join_desired.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 14:16:09 -08:00