Commit Graph

10887 Commits

Author SHA1 Message Date
Quentin Young
aaf24c74e4 babeld: be more explicit about route resize result
Resizing the route array can fail. Although the error condition is
already correctly handled, if we're more explicit about the variables we
expect to be initialized then clang-analyze is happier.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
316f27e169 bgpd: rfapi xcallocs guaranteed non-null
The return value of XCALLOC will always be non-null. Even if it were to
be null, this code would still crash with a NPD.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
039c1e8d4f lib: add asserts on returned matcher vals
These asserts verify that the status correlates with the expected result
and fixes a clang-analyze warning.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
8934b81c69 ospf6d: assert that we set a variable
Assert that prefix_lsa was set. Suppresses clang-analyze warnings.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
bcfdc78784 ospfd: remove interface param npd
OSPF_IF_PARAM_CONFIGURED(S, P) checks both the nullity of S and the
value of P; assuming either one from the value of this macro is
incorrect.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
1ec890a76b lib: ignore cli lexer in clang-analyze
Lexer code is generated by Flex and we don't care about false positives
in it.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
988258b427 bgpd: move attr display into checked block
Here we have a block conditional on the nullity of a pointer, followed
by a dereferennce of the same pointer. Move the deref into the
conditional block.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
e0981960cd bgpd: double-check notify data when debugging
clang-analyze complains that data may be null, and since we didn't
explicitly check it (although we did check the overall packet length
minus the header length) it has a point.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
44b301a24b ospf6d: remove ospf6_interface_if_del
Unused and contains obvious NPD

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Quentin Young
12a81f8eb1 ospfd: set external_info instance value to 0
This value is used but never set. Set it to zero to suppress static
analysis errors.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-13 17:17:42 -04:00
Lou Berger
b667cbc638
Merge pull request #2062 from chiragshah6/ospfv3_dev
ospf6d: router-id change to display msg to restart
2018-04-13 13:56:45 -04:00
Lou Berger
99d09e7d51
Merge pull request #2061 from donaldsharp/aspath_silly
bgpd: Fix another aspath %d that should be %u
2018-04-13 13:55:41 -04:00
Chirag Shah
6b1886f511 ospf6d: router-id change to display msg to restart
When neighbor state transition from LOADING to
FULL state, active full neighbors count incremented.
The full neighbors count is used for router-id change
if any full neighbor exist, displays message to restart
ospf6/frr to activate new router-id.

In the case of P-t-P neighbor type neighbor transition
from EXCHANGE to FULL which missed full neighbors count.

Ticket:CM-20574
Testing Done:
Initially, Bring up zebra assigned router-id in ospf6
with point-to-point link based neighbor.
Configure static router-id where restart of ospf6 message
is displayed.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2018-04-12 21:06:29 -07:00
Donald Sharp
c66faab1ca bgpd: Fix another aspath %d that should be %u
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-12 21:11:39 -04:00
Rafael Zalamena
a6528075a8
Merge pull request #2039 from qlyoung/docuser
doc: more cleanup, config syntax highlighting
2018-04-12 18:02:22 -03:00
Donald Sharp
d4c58fa8f4
Merge pull request #2040 from ajones-rvbd/ajones-issue-2030
alpine packaging: use a more standard packaging format
2018-04-12 10:17:37 -04:00
Donald Sharp
14ccd2cbcf
Merge pull request #2033 from pguibert6WIND/flowspec_redirect_ip
Flowspec redirect ip
2018-04-12 10:00:20 -04:00
Lou Berger
0b984829be
Merge pull request #1989 from qlyoung/defpy-hidden
lib, python: DEFPY_ATTR, DEFPY_HIDDEN
2018-04-11 20:12:25 -04:00
Renato Westphal
cdbd64bd5c
Merge pull request #2052 from qlyoung/style
zebra: fix style error
2018-04-11 20:45:24 -03:00
Quentin Young
cef91a1813
zebra: fix style error
Introduced e3bb770

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-11 11:25:32 -04:00
Russ White
08097fedd0
Merge pull request #2050 from chipitsine/master
resolve issue found by cppcheck
2018-04-11 09:08:51 -04:00
Russ White
058054cac1
Merge pull request #1903 from donaldsharp/PBRD
Pbrd
2018-04-11 09:06:45 -04:00
Ilya Shipitsin
e3bb770c4f resolve issue found by cppcheck
[zebra/zebra_vxlan.c:5779] -> [zebra/zebra_vxlan.c:5778]:
(warning) Either the condition 'if(svi_if_zif&&svi_if_link)'
is redundant or there is possible null pointer dereference: svi_if_zif.

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
2018-04-11 17:02:34 +05:00
Russ White
fb22abc60a
Merge pull request #2047 from LabNConsulting/working/master/bgp-vpn-leak-encode-label-bugfix
bgpd: vrf-vpn leak: when no export label is set, encode implicit-null correctly
2018-04-11 07:53:29 -04:00
Russ White
171238aae0
Merge pull request #2049 from donaldsharp/rip_snmp_fix
ripd: rip_snmp.c - Remove not needed check
2018-04-11 07:46:08 -04:00
Ilya Shipitsin
47e5a60f29 ripd: rip_snmp.c - Remove not needed check
rn cannot be null here

issue detected by cppcheck:

[ripd/rip_snmp.c:208] -> [ripd/rip_snmp.c:207]: (warning) Either the condition
'if(rn&&!strncmp(i->name,ifp->name,INTERFACE_NAMSIZ))' is redundant or there is
possible null pointer dereference: rn.

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
2018-04-11 07:35:20 -04:00
G. Paul Ziemba
291e32c391 bgpd: vrf-vpn leak: when no export label is set, encode implicit-null correctly
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-04-10 21:09:23 -07:00
Renato Westphal
0742ce0a86
Merge pull request #2043 from donaldsharp/v6_shenanigans
V6 shenanigans
2018-04-10 17:38:00 -03:00
Renato Westphal
15da01e92d
Merge pull request #1973 from donaldsharp/static_nh_vrf
Static nh vrf
2018-04-10 17:27:57 -03:00
Quentin Young
aef62d258b
doc: gracefully handle missing config.status
The docs extract various configuration values from config.status and
substitute them into placeholders throughout the docs. Add the ability
to build the docs with some reasonable defaults set instead of failing
when config.status doesn't exist.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-10 15:26:56 -04:00
Quentin Young
dff213a968
doc: load lexer differently
Pygments 2.2+ has `load_lexer_from_file`, but it looks like some of our
build platforms are on an older version.

Also gotta include the new file in dist tarball.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-10 13:51:50 -04:00
Quentin Young
d3c2e31675
doc: update style exceptions list
And make note of future policy

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-10 13:19:32 -04:00
Quentin Young
e1a8a773a2
Merge pull request #1883 from LabNConsulting/working/master/community-document-checkpatch
COMMUNITY.md: document more details of current coding style process
2018-04-10 12:26:08 -04:00
Quentin Young
bb7f2da88d
tools: update indent.py for DEFPY_* macros
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-10 12:19:14 -04:00
Quentin Young
e31f4dbec6
lib, python: DEFPY_ATTR, DEFPY_HIDDEN
Add support for element attributes in DEFPY macros.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-10 12:19:03 -04:00
Lou Berger
8f5e860092
Merge pull request #2038 from qlyoung/graph-find-node
lib: add graph_find_node
2018-04-10 12:04:50 -04:00
Lou Berger
ebf58e2e48
Merge pull request #2009 from donaldsharp/self_originate
zebra: Notice when our route is deleted and re-install.
2018-04-10 11:57:13 -04:00
Jafar Al-Gharaibeh
aa2fc55b20
Merge pull request #1982 from qlyoung/fixup-vtysh-read
vtysh: fixup incorrect read logic
2018-04-10 13:20:00 +04:00
Arthur Jones
915c81b3ef alpine packaging: use a more standard packaging format
Currently, we just package the frr daemons, but we don't run
them.  This is fine for basic tests, but it is inconvenient to
orchestrate the daemons from downstream test environments.

Here, we follow the redhat and debianpkg formats more closely,
putting the daemons in /usr/lib/frr and including the frr user
and groups in the package.  We also include a docker specific
startup script and a sysvinit link in /etc/init.d/frr for
openrc based alpine installs.

Testing done:

Built packages, built base images, everything seems to work fine.
Uninstalled the package, all the daemons stopped.

Issue: https://github.com/FRRouting/frr/issues/2030
Signed-off-by: Arthur Jones <arthur.jones@riverbed.com>
2018-04-09 15:34:50 -07:00
Quentin Young
9eb95b3b0a
doc: use frr syntax highlighting
* Use highlighter added in previous commit
* Correct indentation where I came across it

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-09 17:30:57 -04:00
Quentin Young
d5403d4f40
doc: add frr.conf syntax highlighting
Vincent Bernat has written a small Pygments lexer for IOS / Quagga
config files that works just as well on FRR stuff. Pulled that into our
docs with his blessing.

Also changed the background color on our code blocks away from that
kinda ugly green to gray, which looks way better with the syntax
highlighting changes that are about to happen in the next commit.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-09 17:30:53 -04:00
Quentin Young
75ca3b1123
doc: stylin'
Use the proper section markup as defined in workflow.rst.
This helps Sphinx organize sections properly.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-09 17:30:48 -04:00
Quentin Young
c936589468
doc: cleanup daemon option flags
Short and long form options can be written on the same line, Sphinx
understands how to cross-reference using either one of them. Also
replace some - with _ where appropriate.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-09 17:30:47 -04:00
Donald Sharp
c1d63a9346 zebra: Only send down pertinent information on RTM_DELROUTE
Background:

v6 does not have route replace semantics.  If you want to add a nexthop
to an existing route, you just send RTM_NEWROUTE and the new nexthop.
If you want to delete a nexthop you should just send RTM_DELROUTE
with the removed nexthop.

This leads to situations where if zebra is processing a route
and has lost track of intermediate nexthops( yes this sucks )
then v6 routes will get out of sync when we try to implement
route replace semantics.

So notice when we are doing a route delete and the route is
not being updated, just send the prefix and tell it too delete.

Ticket: CM-20391
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-09 14:16:00 -04:00
Donald Sharp
45df4e9667 zebra: Cleanup debugs and add a bit more info
This commit does 2 things:

1) When receiving a route from the kernel, display the incoming
table as part of the debug, to facilatate knowing what we are
talking about as part of the debug.

2) When displaying nexthop information for routes we were sending
to the kernel, no need to display the route information every time
Display the route then the individual nexthops for what we are doing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-09 14:09:35 -04:00
Donald Sharp
20089ae2e4 zebra: Notice when our neighbor entry is removed and fight back
Notice when someone deletes a neighbor entry we've put in for
rfc-5549 gets deleted by some evil evil person.  When this happens
notice and push it back in, immediately.

Ticket: CM-18612
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-04-09 08:04:39 -04:00
Donald Sharp
b8faa875f7 zebra: Notice when our route is deleted and re-install.
The code to reinstall self originated routes was not behaving
correctly.  For some reason we were looking for self originated
routes from the kernel to be of type KERNEL.  This was probably
missed when we started installing the route types.  We should
depend on the self originated flag that we determine from
the callback from the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
2018-04-09 07:54:57 -04:00
Philippe Guibert
026b914a40 bgpd: the nexthop IP is displayed for FS entries.
Most presumably, the nexthop IP is present, only when ECOM redirect IP
is present. The nexthop is displayed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-09 11:04:14 +02:00
Philippe Guibert
b72220fccd bgpd: handle ecom redirect-ip
This extended ecommunity is defined with
draft-ietf-idr-flowspec-redirect-ip-02 and is read from the BGP update
received.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-04-09 11:04:14 +02:00
G. Paul Ziemba
115e70a1b7 doc: workflow.rst: more details of current coding style process
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2018-04-07 17:24:23 -07:00