Commit Graph

11002 Commits

Author SHA1 Message Date
Donald Sharp
b51016ebb9 lib: Fix SA warning
The addr value will never be null because of the way we do the
cli, but the SA system doesn't understand this.  Add an assert
to make it happy.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-23 22:09:33 -04:00
Donald Sharp
10a00758a7 pbrd: Fix a couple SA issues
1) addr will never be non-null because of the way we build the cli
at this point in time, but the SA system does not understand this,
add a bread crumb for it.

2) Fix a possible memory leak of the pbr_ifp

3) Fix possible integer overflow when bit shifting.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-23 22:09:33 -04:00
Quentin Young
ff1821aeb4
Merge pull request #2111 from mjstapp/zmq_sockopt
frrzmq: properly init args to zmq_getsockopt()
2018-04-23 14:33:41 -04:00
Mark Stapp
81b8afcfb5 frrzmq: properly init args to zmq_getsockopt()
zmq read events get lost if zmq_getsockopt() silently fails in
frrzmq_check_events().

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2018-04-23 13:06:37 -04:00
Lou Berger
84abd23592
Merge pull request #2103 from donaldsharp/bgp_zebra_youch
bgpd: The deletion of a bgp route does not need to send some data
2018-04-23 11:02:15 -04:00
Lou Berger
b2f6b81e7b
Merge pull request #2098 from qlyoung/fix-underline-buf-overflow
lib: fix dynamic stack buffer overflow
2018-04-23 11:01:34 -04:00
Lou Berger
c1da3ee614
Merge pull request #2108 from donaldsharp/redistribute_debugs
zebra: Add some information to redistribute debugs
2018-04-23 10:56:44 -04:00
Lou Berger
c4f5b6ab2f
Merge pull request #2105 from qlyoung/fix-includes
lib: table.h needs to include prefix.h
2018-04-23 10:55:00 -04:00
Donald Sharp
3e178809ef zebra: Add some information to redistribute debugs
When we are debugging add a bit of extra information
so we can know what we are redistributing to our peers

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-23 08:26:33 -04:00
Quentin Young
c0c22c2b05 lib: table.h needs to include prefix.h
For the last six years this source file has been using a type defined in
a header it did not include.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-22 17:08:09 -04:00
Donald Sharp
a831bfd0b8 bgpd: The deletion of a bgp route does not need to send some data
When sending a bgp route down to zebra for deletion, the
ZEBRA_FLAG_ALLOW_RECURSION and ZEBRA_FLAG_IBGP flags
are not needed in zebra.  So remove the setting
of the api.flags.  If we remove this data from being
passed down we no longer need the peer data structure.

Remove the lookup of the peer data structure and the setting
of the flags as that peer was NULL in some evpn symmetric
routing cases for shutdown of bgp.

Ticket: CM-20720
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-21 20:08:16 -04:00
Lou Berger
8aeee10fe2
Merge pull request #2080 from qlyoung/docuser
doc: spelling fixes
2018-04-21 07:52:31 -04:00
Quentin Young
d1e7591eb2 doc: spelling fixes
* Run sphinxcontrib-spelling over docs
* Correct spelling errors
* Compile a dictionary for future spellchecking efforts

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-20 17:59:38 -04:00
Quentin Young
4f113d6066 lib: fix dynamic stack buffer overflow
oops

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-20 16:40:46 -04:00
Russ White
7b9fdc412d
Merge pull request #2092 from dslicenc/import-table-change
zebra: resolve issue when changing import-table route-map config
2018-04-20 08:10:39 -04:00
Russ White
9ae97474fe
Merge pull request #2086 from donaldsharp/zebra_capabilities
zebra: Add pass up through zapi what zebra is capable of handling
2018-04-20 08:06:54 -04:00
Russ White
6effe4e220
Merge pull request #2083 from LabNConsulting/working/master/bvl-routemap-defined
bgpd: vpn-vrf routemaps: no leak if named route-map not defined
2018-04-20 08:05:22 -04:00
Russ White
751423e441
Merge pull request #2079 from qlyoung/exit-vrf-memes
Always explicitly exit vrf contexts
2018-04-20 08:01:32 -04:00
Russ White
eb5d7cbe3d
Merge pull request #2077 from donaldsharp/static_warn
zebra: Leave some warning breadcrumbs
2018-04-20 07:59:37 -04:00
Russ White
ea1c08342f
Merge pull request #2072 from donaldsharp/blackhole_this
zebra: Allow blackhole route deletion for prefixes
2018-04-20 07:58:03 -04:00
Russ White
5e572e886a
Merge pull request #2057 from donaldsharp/fix_1916
Fix 1916
2018-04-20 07:56:48 -04:00
Russ White
5998141e07
Merge pull request #2051 from donaldsharp/PBRD_EXTRA
Pbrd extra
2018-04-20 07:54:30 -04:00
Donald Sharp
cc66d7a427
Merge pull request #2088 from ajones-rvbd/ajones-issue-2087
alpine build docs: Document docker images and alpine packages
2018-04-20 07:22:09 -04:00
Don Slice
3660beec29 zebra: resolve issue when changing import-table route-map config
When changing from "ip import-table 10 route-map rdn" to "ip
import-table 10" without a route-map, routes would be deleted
and not reinstalled.  This fix resolves that problem.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-04-19 14:07:20 -07:00
Jafar Al-Gharaibeh
2f77318e19
Merge pull request #2084 from donaldsharp/move_mpls
Move mpls
2018-04-18 15:53:17 -05:00
Arthur Jones
cdb18eaa45 alpine build docs: Document docker images and alpine packages
https://hub.docker.com/r/ajones17/frr/ contains pre-built docker
images and alpine packages for the master branch of frr.  Document
this continuous delivery system on the alpine build page.

Issue: https://github.com/FRRouting/frr/issues/2087
Signed-of-by: Arthur Jones <arthur.jones@riverbed.com>
2018-04-18 10:37:11 -07:00
Rafael Zalamena
d61a30687b
Merge pull request #2082 from qlyoung/sa-fixes
Even more static analysis fixes
2018-04-18 14:22:08 -03:00
Quentin Young
6612590d9a pbrd: fix multiple unsafe string copies
Coverity #1467828
Coverity #1467827
Coverity #1467826
Coverity #1467825
Coverity #1467824
Coverity #1467823
Coverity #1467822

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-18 12:16:19 -04:00
Quentin Young
68a63f60ae pbrd: remove potential null dereference
Coverity #1467832

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-18 12:16:19 -04:00
Quentin Young
d64169679f pbrd: remove pbr-policy resource leak
Removing a non-existent pbr-policy caused a pbr_interface to leak.

Coverity #1467829

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-18 12:16:19 -04:00
Quentin Young
5f504f14a9 pbrd: remove unsafe string copy
A user could overflow the pbr_ifp->mapname buffer by entering a pbr-map
name longer than 100 characters.

Coverity #1467821
Coverity #1467821

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-18 12:16:19 -04:00
Quentin Young
6898d846c5 bgpd: avoid indexing with negative integer
Coverity #1399286

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-18 12:16:19 -04:00
Quentin Young
25521d49a7 pimd: avoid writing to negative fd
Coverty #1465483

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-18 12:16:19 -04:00
Quentin Young
6451e84664 lib: avoid writing to negative fd
Coverity #1399341

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-18 12:16:19 -04:00
Donald Sharp
09924cffad zebra: Add pass up through zapi what zebra is capable of handling
Zebra is starting to have some run-time capabilites that would be
useful to pass up to the higher level protocols so that they
can act in an appropriate manner when needed.

Send the ecmp value zebra is being run with and whether or not
we believe mpls is enabled in the kernel or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-18 11:10:27 -04:00
Rafael Zalamena
c477dd0e7c
Merge pull request #2078 from dslicenc/fix-import-table-fix
zebra: fix flaw in fix for import-table crash
2018-04-18 10:21:38 -03:00
Donald Sharp
036fdaad9f lib, zebra: Move label conversion strings to lib
The mpls_label2str and mpls_str2label functions should not
be zebra exclusive functions.  Move them to lib/mpls.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-18 07:06:11 -04:00
Donald Sharp
f890b1461d lib, zebra: Move help string to appropriate header
The MPLS_LABEL_HELPSTR belongs in lib/mpls.h in case
any other protocol wants to use it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-18 07:00:12 -04:00
G. Paul Ziemba
d92a55dfb6 bgpd: vpn-vrf routemaps: no leak if named route-map not defined
given a configuration such as this:

    router bgp 7777 vrf A
	address-family ipv4 unicast
	    route-map vpn import FOO
	    import vpn

or this:

    router bgp 7777 vrf A
	address-family ipv4 unicast
	    rd vpn export 1:3
	    rt vpn export 1:100
	    route-map vpn export FOO
	    export vpn

Previous code allowed leaking if the named FOO route-map was not defined.

Since the configuration is logically incomplete, if a route-map is named
for "vpn export" or "vpn import" but is not defined, leaking should not
occur until the route-map is defined.

This changeset implements the correct behavior.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-04-17 22:42:39 -07:00
Donald Sharp
e49b64dee7
Merge pull request #2035 from vincentbernat/fix/no-etag-esi-ignore
bgpd: add basic support for ETI and ESI for BGP EVPN
2018-04-17 18:59:48 -04:00
Donald Sharp
98cbbaea91 lib: Handle if up/down and vrf enable/disable events
Properly notice when we get if up/down and vrf enable/disable
events and attempt to properly install nexthops as they
come in.

Ticket: CM20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-17 18:44:33 -04:00
Donald Sharp
d7b3ad4016 pbrd: Use proper decode function for interface
Use a proper decode function for a interface state change.

Ticket: CM-20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-17 18:43:47 -04:00
Donald Sharp
c57bd6bbe1 lib: Store nexthop information independently
Store Nexthop's as the incoming raw data.  This will allow
us to separate the act of inputting the cli from the
act of instantiating the cli.

Ticket: CM-20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-17 18:43:47 -04:00
Donald Sharp
24010e9231 pbrd: Fix unused function
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-17 18:43:47 -04:00
Donald Sharp
d02e9432b5 pbrd: Allow pbr-policy add/removal to install/remove rules
The pbrm->installed variable was being used only in a couple
of places and it has no real bearing on whether or not
we should install a rule or not.  Remove this value.

Ticket: CM-20429
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-17 18:43:47 -04:00
Quentin Young
56c63eeb23 pbrd: don't collapse pbr debugs
While compact, collapsing the various debugs into simply `debug pbr` if
all debugs are on is potentially confusing to users.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-17 18:43:47 -04:00
Quentin Young
e14f43ccae pbrd: move debug vty into pbr_vty.c
Dev docs say that CLI goes in _vty.c files

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-17 18:43:47 -04:00
Donald Sharp
0f03639ded pbrd, zebra: Properly notice rule deletion
When a rule is deleted properly notice it in pbr.

Ticket: CM-20394
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-17 18:43:47 -04:00
Donald Sharp
37c606ffbf pbrd, zebra: Fix multiple pbr-policy install
Somewhere along the way the ability to install multiple
pbr-policys for the same pbr-map was lost.

Add this back.  There is a limitation in that we are limited
to 64 interfaces per pbr-policy.

Ticket: CM-20429
Signed-off-by: Donald Sharp sharpd@cumulusnetworks.com>
2018-04-17 18:43:46 -04:00
Donald Sharp
9b71ea4ba5 pbrd: Fix installation and deletion in some cases
When a nexthop group is modified do not assume that it
is not installed.  The creation of the pnhgc is enough
to set the installed to false.  If we are reinstalling
it is not needed to set it as not installed.

When a pbrms is being installed/removed check to see if it
is already installed/deleted and do the right thing from
there.

Ticket: CM-20371
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-17 18:40:17 -04:00