Commit Graph

9544 Commits

Author SHA1 Message Date
Donald Sharp
7aacfd1b46 bgpd: Allow 'match peer' for all route-map types
There are multiple places that we use route-maps in bgp
There is no need to limit the route-map 'match peer ...' command
to just import and export route-map types.  I see need for
using this in table-maps as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-25 09:24:53 -04:00
Donald Sharp
7d4aea3007 bgpd: Allow route-map match peer... to have auto-complete
The match peer command doees not currently have an auto-complete
ability.  Let's add it in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-25 09:24:53 -04:00
Donald Sharp
8c3433e490 bgpd: Allow peer interface name to match
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-25 09:24:53 -04:00
Donald Sharp
ef47f23b91 Merge pull request #1358 from opensourcerouting/isis-lsp_tick-fixes
Isis lsp_tick fix and improve perfomance for processing LSP updates
2017-10-25 09:19:06 -04:00
Don Slice
8dc8a4b693 zebra: only pass mpls proto type if doing install
Problem reported with not deleting LSPs from the zebra kernal mpls table
when a delete occurred in bgp.  Found that we were exiting the delete
process incorrectly due to not being able to derive the route_type from
the best_nhlre on the lsp while deleting. Since this info was only
needed for route installation, removed this early exit in the case of
deleting the lsp.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Ticket: CM-18309
Reviewed By: CCR-6781
Testing Done:  Manual testing looks good.  mpls tests successful
2017-10-25 08:19:22 -04:00
Donald Sharp
ff2f3a8290 Merge pull request #1361 from opensourcerouting/vtysh_mem_leak
vtysh: properly fix memory leak
2017-10-25 07:00:19 -04:00
Renato Westphal
80c872f699 vtysh: properly fix memory leak
Commit 44f12f20 fixed the memory leak in the wrong way and introduced a
"uninitialized variable" warning.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-25 07:56:42 -02:00
Donald Sharp
b5b583aa8d Merge pull request #1357 from opensourcerouting/coverity_fixes
Coverity fixes
2017-10-24 19:36:30 -04:00
Renato Westphal
b11b57723b lib: optimize sockunion_connect()
This function is only called with non-blocking sockets [1], so there's
no need to worry about setting O_NONBLOCK and unsetting it later if the
given fd was a blocking socket. This saves us 4 syscalls per connect,
which is not much but is something.

Also, remove an outdated comment about the return values of this
function. It returns a 'connect_result' enum now, whose values are
self-explanatory (connect_error, connect_success and connect_in_progress).

This also fixes a coverity scan warning where we weren't checking the
return value of the fcntl() syscall.

[1] bgp_connect() and pim_msdp_sock_connect().

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 19:30:31 -02:00
Renato Westphal
cbb65f5ef5 *: fix coverity warnings - error handling issues
Ignore the return value of some functions in the places we know they
can't fail, and other small fixes.

Regarding the change in bgpd/rfapi/rfapi_rib.c, asserting that
rfapiRaddr2Qprefix() didn't fail is the common idiom inside the rfapi
code.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 19:30:30 -02:00
Renato Westphal
44f12f209f *: fix coverity warnings - resource leaks
These are mostly trivial fixes for leaks in the error path of some functions.

The changes in bgpd/bgp_mpath.c deserves a bit of explanation though. In
the bgp_info_mpath_aggregate_update() function, we were allocating memory
for the lcomm variable but doing nothing with it. Since the code for
communities, extended communities and large communities is pretty much
the same in this function, it's clear that this was a copy and paste
error where most of the ext. community code was copied but not all of
it as it should have been.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 19:30:30 -02:00
Renato Westphal
a1d6bbb1f3 ospfd: fix coverity warnings - security best practices violations
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 19:30:30 -02:00
Renato Westphal
efd7904eab *: add missing \n in some help strings
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 19:30:30 -02:00
Renato Westphal
5b8524f5c2 lib: fix coverity warnings introduced by the iface rb-tree conversion
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 18:26:02 -02:00
Lou Berger
47473bbbc7 Merge pull request #1346 from donaldsharp/apply_routemap
bgpd: Note routemap information even if peer not activated.
2017-10-24 11:46:32 -04:00
Lou Berger
0f1fe4ff22 Merge pull request #1337 from donaldsharp/debug_nht_bgp
bgpd: Allow turn off of 'debug bgp nht' from 'no debug bgp'
2017-10-24 11:13:12 -04:00
Rafael Zalamena
a2e087becc Merge pull request #1296 from donaldsharp/eigrp_table
eigrpd: Convert topology list to a table
2017-10-24 11:30:37 -02:00
Donald Sharp
9ca66cc76d eigrpd: Convert topology list to a table
The EIGRP topology list is an extremely inefficient
way to store data about the known routes.  Convert
to using a table.

Signed-off-by: Donald Sharp <sharpd@cumulusnetorks.com>
2017-10-24 08:36:15 -04:00
Renato Westphal
ce0ff16bd9 zebra: fix route node leak on error path
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 10:23:33 -02:00
Renato Westphal
a3e13ef37f zebra: 'show ip route' with multiple options at the same time
Now it's possible to specify multiple options when viewing the RIB or
FIB.

Example: 'show ip route 192.168.0.0/16 longer-prefixes tag 10 ospf'

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 10:23:33 -02:00
Renato Westphal
ecffa493c0 zebra: unify the ipv4/ipv6 'show ip route' commands - part 1/2
Note: I had to remove one assert in clidef.py in order to fix a build
error when using a preprocessor string (FRR_IP_REDIST_STR_ZEBRA) inside
a DEFPY command. This should be revisited later.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 10:12:40 -02:00
Renato Westphal
ba7773964c build: include our own copies of some linux kernel headers
This is the definitive solution to avoid build issues on old Linux
systems, where the system kernel headers might not contain some constants
or macros used by FRR (e.g. MPLS_IPTUNNEL_DST, introduced on 2015).

This is the same strategy adopted by other projects, like iproute2,
libnl, lldpd, strongswan, etc. These header files don't need to be in
sync with upstream, they only need to be updated when necessary (e.g. if
we want to use a new feature introduced by a recent kernel).

Fixes #962 using the solution suggested by David Lamparter.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2017-10-24 09:20:12 -02:00
Renato Westphal
a81c0c948c Merge pull request #1330 from donaldsharp/zclient_shenanigans
Zclient shenanigans
2017-10-23 21:54:09 -02:00
Renato Westphal
ccd05df5d3 Merge pull request #1354 from chiragshah6/mdev1
ospfd: show comand for ospf packet stats
2017-10-23 21:51:08 -02:00
Donald Sharp
afb6d3f5c1 bgpd: Use stored ifindex for zebra_announce
In some situations we already know the ifp and by extension
the ifindex there is no need to look it up for every
route we send to zebra.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:12:33 -04:00
Donald Sharp
5a762c8a6e zebra: Allow zebra_client_read to handle up to 10 messages
The zebra_client_read functionality was reading 1 message
from a peer at a time.  Modify the code so that we can
read up to 10 at a time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:12:33 -04:00
Donald Sharp
342213eac0 *: Modify zclient_init to require privs data
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:12:29 -04:00
Donald Sharp
5cb6ce9c67 ripngd: Make 'struct zebra_privs_t' available
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
32b5a49362 ripd: Make 'struct zebra_privs_t' available
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
101dc9bc6c ospf6d: Make 'struct zebra_privs_t' available
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
e5c2502292 ospfd: Make 'struct zebra_privs_t' available.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
76e292f994 isisd: Allow struct zebra_privs_t to be available
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
f77519c867 eigrpd: Make struct zebra_privs_t available
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
26efbc7b99 nhrpd: Let struct zebra_privs_t be available
signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
346526cc5b babeld: Make the zebra_privs_t available for use
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
2c73b25897 zebra: Set zapi send/receive buffer to a larger value
Allow a bit more to buffer before we stop zebra
from sending/receiving.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
bf2394f08b lib: Cleanup some missed reformat
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
0c5e7be5b3 zebra: Add a function handler for zserv commands
The zserv command handlers make an already long function
even longer.  Isolate this code so that we can rearrange
the zebra_client_read function.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
6680688cf2 zebra: Make all zserv handler functions use zvrf instead of vrf_id
Some handler functions were using vrf_id, standardize onto
zvrf being passed around instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:23 -04:00
Donald Sharp
e4bd522a31 zebra: No need to pass sock descriptor around.
Standardize the api to read zapi requests from protocols.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:22 -04:00
Donald Sharp
bf6e101c16 zebra: Always read full zapi message in ptm code
The ptm code when it encountered an error situation
was not fully reading all the data in the stream
meant for it.  Ensure that this is read.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-10-23 18:09:22 -04:00
Chirag Shah
85c8ef0663 ospfd: reset ospf interface protocol stats
Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-10-23 14:48:22 -07:00
Chirag Shah
c93396633c ospfd: show comand for ospf packet stats
Display OSPFv2 Protocol packets stats per interface.

tor-1# show ip ospf vrf all interface traffic

Interface    HELLO    DB-Desc   LS-Req LS-Update   LS-Ack
             Rx/Tx    Rx/Tx     Rx/Tx  Rx/Tx       Rx/Tx
------------------------------------------------------------
swp1         1/0      2/3       1/1    2/2         1/1
swp2         6/0      2/7       1/1    1/4         3/2

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-10-23 14:47:59 -07:00
Renato Westphal
72806e2d23 Merge pull request #1341 from chiragshah6/ospf_vrf_dev
ospf6d: Divide LSupdate to keep size small
2017-10-23 11:27:02 -02:00
Donald Sharp
e8a993398f Merge pull request #1353 from opensourcerouting/rpm-fix-master
Rpm fix master
2017-10-23 08:33:30 -04:00
Donald Sharp
d0cc0fdbe8 Merge pull request #1349 from opensourcerouting/bgpd_listen_queue
bgpd: bump listen() backlog
2017-10-21 08:19:09 -04:00
Martin Winter
de481ae61f redhat: Fix doc by removing outdated package information and point to main doc/ directory for it
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-10-20 18:56:26 -07:00
Martin Winter
c88ca85d39 redhat: Fix rpm scripts to correctly restart daemons on upgrade
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-10-20 18:56:04 -07:00
Martin Winter
75429e11b9 redhat: Add fix to correct watchfrr config during upgrade
- /etc/frr/daemon is a config file and won't be replaced, do quick sed fix
- Updated changelog

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>

Conflicts:
	redhat/frr.spec.in
2017-10-20 18:55:30 -07:00
Martin Winter
486da96666 redhat: systemd file should not be executable
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2017-10-20 18:53:56 -07:00