]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoMerge pull request #2054 from qlyoung/sa-fixes
Renato Westphal [Sun, 15 Apr 2018 22:10:50 +0000 (19:10 -0300)]
Merge pull request #2054 from qlyoung/sa-fixes

Static analyzer fixes

6 years agoMerge pull request #2036 from LabNConsulting/working/master/bgp-vpn-leak-labelmgr
Renato Westphal [Sun, 15 Apr 2018 22:05:27 +0000 (19:05 -0300)]
Merge pull request #2036 from LabNConsulting/working/master/bgp-vpn-leak-labelmgr

bgpd: dynamic mpls label pool

6 years agoMerge pull request #2068 from LabNConsulting/working/master/rfapi-sa
Donald Sharp [Sun, 15 Apr 2018 15:25:43 +0000 (11:25 -0400)]
Merge pull request #2068 from LabNConsulting/working/master/rfapi-sa

bgp/rfapi: fix rfapiNhlAddNodeRoutes SA issue

6 years agobgp/rfapi: fix rfapiNhlAddNodeRoutes SA issue
G. Paul Ziemba [Sat, 14 Apr 2018 22:34:21 +0000 (15:34 -0700)]
bgp/rfapi: fix rfapiNhlAddNodeRoutes SA issue

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agobgpd: remove unused variable
Quentin Young [Wed, 11 Apr 2018 20:22:23 +0000 (16:22 -0400)]
bgpd: remove unused variable

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: verify that multipath infos are set
Quentin Young [Wed, 11 Apr 2018 19:26:28 +0000 (15:26 -0400)]
bgpd: verify that multipath infos are set

Makes clang-analyze happy

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoospf6d: assert nh list is non-null
Quentin Young [Wed, 11 Apr 2018 19:21:55 +0000 (15:21 -0400)]
ospf6d: assert nh list is non-null

clang-analyze

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobabeld: be more explicit about route resize result
Quentin Young [Wed, 11 Apr 2018 19:19:23 +0000 (15:19 -0400)]
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>
6 years agobgpd: rfapi xcallocs guaranteed non-null
Quentin Young [Wed, 11 Apr 2018 18:14:06 +0000 (14:14 -0400)]
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>
6 years agolib: add asserts on returned matcher vals
Quentin Young [Wed, 11 Apr 2018 18:09:21 +0000 (14:09 -0400)]
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>
6 years agoospf6d: assert that we set a variable
Quentin Young [Wed, 11 Apr 2018 18:05:32 +0000 (14:05 -0400)]
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>
6 years agoospfd: remove interface param npd
Quentin Young [Wed, 11 Apr 2018 17:58:53 +0000 (13:58 -0400)]
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>
6 years agolib: ignore cli lexer in clang-analyze
Quentin Young [Wed, 11 Apr 2018 17:33:12 +0000 (13:33 -0400)]
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>
6 years agobgpd: move attr display into checked block
Quentin Young [Wed, 11 Apr 2018 17:16:10 +0000 (13:16 -0400)]
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>
6 years agobgpd: double-check notify data when debugging
Quentin Young [Wed, 11 Apr 2018 16:54:42 +0000 (12:54 -0400)]
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>
6 years agoospf6d: remove ospf6_interface_if_del
Quentin Young [Wed, 11 Apr 2018 16:43:00 +0000 (12:43 -0400)]
ospf6d: remove ospf6_interface_if_del

Unused and contains obvious NPD

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoospfd: set external_info instance value to 0
Quentin Young [Wed, 11 Apr 2018 16:26:57 +0000 (12:26 -0400)]
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>
6 years agoMerge pull request #2062 from chiragshah6/ospfv3_dev
Lou Berger [Fri, 13 Apr 2018 17:56:45 +0000 (13:56 -0400)]
Merge pull request #2062 from chiragshah6/ospfv3_dev

ospf6d: router-id change to display msg to restart

6 years agoMerge pull request #2061 from donaldsharp/aspath_silly
Lou Berger [Fri, 13 Apr 2018 17:55:41 +0000 (13:55 -0400)]
Merge pull request #2061 from donaldsharp/aspath_silly

bgpd: Fix another aspath %d that should be %u

6 years agoospf6d: router-id change to display msg to restart
Chirag Shah [Fri, 13 Apr 2018 00:44:07 +0000 (17:44 -0700)]
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>
6 years agobgpd: Fix another aspath %d that should be %u
Donald Sharp [Fri, 13 Apr 2018 01:11:39 +0000 (21:11 -0400)]
bgpd: Fix another aspath %d that should be %u

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2039 from qlyoung/docuser
Rafael Zalamena [Thu, 12 Apr 2018 21:02:22 +0000 (18:02 -0300)]
Merge pull request #2039 from qlyoung/docuser

doc: more cleanup, config syntax highlighting

6 years agoMerge pull request #2040 from ajones-rvbd/ajones-issue-2030
Donald Sharp [Thu, 12 Apr 2018 14:17:37 +0000 (10:17 -0400)]
Merge pull request #2040 from ajones-rvbd/ajones-issue-2030

alpine packaging: use a more standard packaging format

6 years agoMerge pull request #2033 from pguibert6WIND/flowspec_redirect_ip
Donald Sharp [Thu, 12 Apr 2018 14:00:20 +0000 (10:00 -0400)]
Merge pull request #2033 from pguibert6WIND/flowspec_redirect_ip

Flowspec redirect ip

6 years agobgpd: vpn-vrf leaking: use dynamic label pool for "auto" labels
G. Paul Ziemba [Sat, 7 Apr 2018 18:32:52 +0000 (11:32 -0700)]
bgpd: vpn-vrf leaking: use dynamic label pool for "auto" labels

Add support for CLI "auto" keyword in vrf->vpn export label:

    router bgp NNN vrf FOO
address-family ipv4 unicast
    label vpn export auto
exit-address-family

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agobgpd: dynamic mpls label pool
G. Paul Ziemba [Sat, 7 Apr 2018 18:13:07 +0000 (11:13 -0700)]
bgpd: dynamic mpls label pool

MPLS label pool backed by allocations from the zebra label manager.

A caller requests a label (e.g., in support of an "auto" label
specification in the CLI) via lp_get(), supplying a unique ID and
a callback function. The callback function is invoked at a later
time with the unique ID and a label value to inform the requestor
of the assigned label.

Requestors may release their labels back to the pool via lp_release().

The label pool is stocked with labels allocated by the zebra label
manager. The interaction with zebra is asynchronous so that bgpd
is not blocked while awaiting a label allocation from zebra.

The label pool implementation allows for bgpd operation before (or
without) zebra, and gracefully handles loss and reconnection of
zebra. Of course, before initial connection with zebra, no labels
are assigned to requestors. If the zebra connection is lost and
regained, callbacks to requestors will invalidate old assignments
and then assign new labels.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agoMerge pull request #1989 from qlyoung/defpy-hidden
Lou Berger [Thu, 12 Apr 2018 00:12:25 +0000 (20:12 -0400)]
Merge pull request #1989 from qlyoung/defpy-hidden

lib, python: DEFPY_ATTR, DEFPY_HIDDEN

6 years agoMerge pull request #2052 from qlyoung/style
Renato Westphal [Wed, 11 Apr 2018 23:45:24 +0000 (20:45 -0300)]
Merge pull request #2052 from qlyoung/style

zebra: fix style error

6 years agozebra: fix style error
Quentin Young [Wed, 11 Apr 2018 15:25:32 +0000 (11:25 -0400)]
zebra: fix style error

Introduced e3bb770

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2050 from chipitsine/master
Russ White [Wed, 11 Apr 2018 13:08:51 +0000 (09:08 -0400)]
Merge pull request #2050 from chipitsine/master

resolve issue found by cppcheck

6 years agoMerge pull request #1903 from donaldsharp/PBRD
Russ White [Wed, 11 Apr 2018 13:06:45 +0000 (09:06 -0400)]
Merge pull request #1903 from donaldsharp/PBRD

Pbrd

6 years agoresolve issue found by cppcheck
Ilya Shipitsin [Wed, 11 Apr 2018 12:02:34 +0000 (17:02 +0500)]
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>
6 years agoMerge pull request #2047 from LabNConsulting/working/master/bgp-vpn-leak-encode-label...
Russ White [Wed, 11 Apr 2018 11:53:29 +0000 (07:53 -0400)]
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

6 years agoMerge pull request #2049 from donaldsharp/rip_snmp_fix
Russ White [Wed, 11 Apr 2018 11:46:08 +0000 (07:46 -0400)]
Merge pull request #2049 from donaldsharp/rip_snmp_fix

ripd: rip_snmp.c - Remove not needed check

6 years agoripd: rip_snmp.c - Remove not needed check
Ilya Shipitsin [Thu, 5 Apr 2018 20:09:56 +0000 (20:09 +0000)]
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>
6 years agobgpd: vrf-vpn leak: when no export label is set, encode implicit-null correctly
G. Paul Ziemba [Wed, 11 Apr 2018 02:03:01 +0000 (19:03 -0700)]
bgpd: vrf-vpn leak: when no export label is set, encode implicit-null correctly

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agoMerge pull request #2043 from donaldsharp/v6_shenanigans
Renato Westphal [Tue, 10 Apr 2018 20:38:00 +0000 (17:38 -0300)]
Merge pull request #2043 from donaldsharp/v6_shenanigans

V6 shenanigans

6 years agoMerge pull request #1973 from donaldsharp/static_nh_vrf
Renato Westphal [Tue, 10 Apr 2018 20:27:57 +0000 (17:27 -0300)]
Merge pull request #1973 from donaldsharp/static_nh_vrf

Static nh vrf

6 years agodoc: gracefully handle missing config.status
Quentin Young [Tue, 10 Apr 2018 19:26:56 +0000 (15:26 -0400)]
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>
6 years agodoc: load lexer differently
Quentin Young [Tue, 10 Apr 2018 17:37:47 +0000 (13:37 -0400)]
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>
6 years agodoc: update style exceptions list
Quentin Young [Tue, 10 Apr 2018 17:19:32 +0000 (13:19 -0400)]
doc: update style exceptions list

And make note of future policy

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #1883 from LabNConsulting/working/master/community-document-checkpatch
Quentin Young [Tue, 10 Apr 2018 16:26:08 +0000 (12:26 -0400)]
Merge pull request #1883 from LabNConsulting/working/master/community-document-checkpatch

COMMUNITY.md: document more details of current coding style process

6 years agotools: update indent.py for DEFPY_* macros
Quentin Young [Fri, 30 Mar 2018 02:13:17 +0000 (22:13 -0400)]
tools: update indent.py for DEFPY_* macros

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib, python: DEFPY_ATTR, DEFPY_HIDDEN
Quentin Young [Thu, 29 Mar 2018 17:01:06 +0000 (13:01 -0400)]
lib, python: DEFPY_ATTR, DEFPY_HIDDEN

Add support for element attributes in DEFPY macros.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2038 from qlyoung/graph-find-node
Lou Berger [Tue, 10 Apr 2018 16:04:50 +0000 (12:04 -0400)]
Merge pull request #2038 from qlyoung/graph-find-node

lib: add graph_find_node

6 years agoMerge pull request #2009 from donaldsharp/self_originate
Lou Berger [Tue, 10 Apr 2018 15:57:13 +0000 (11:57 -0400)]
Merge pull request #2009 from donaldsharp/self_originate

zebra: Notice when our route is deleted and re-install.

6 years agoMerge pull request #1982 from qlyoung/fixup-vtysh-read
Jafar Al-Gharaibeh [Tue, 10 Apr 2018 09:20:00 +0000 (13:20 +0400)]
Merge pull request #1982 from qlyoung/fixup-vtysh-read

vtysh: fixup incorrect read logic

6 years agoalpine packaging: use a more standard packaging format
Arthur Jones [Fri, 6 Apr 2018 00:52:15 +0000 (17:52 -0700)]
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>
6 years agodoc: use frr syntax highlighting
Quentin Young [Mon, 9 Apr 2018 21:26:32 +0000 (17:26 -0400)]
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>
6 years agodoc: add frr.conf syntax highlighting
Quentin Young [Mon, 9 Apr 2018 20:18:05 +0000 (16:18 -0400)]
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>
6 years agodoc: stylin'
Quentin Young [Mon, 9 Apr 2018 17:10:20 +0000 (13:10 -0400)]
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>
6 years agodoc: cleanup daemon option flags
Quentin Young [Fri, 6 Apr 2018 22:17:31 +0000 (18:17 -0400)]
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>
6 years agozebra: Only send down pertinent information on RTM_DELROUTE
Donald Sharp [Mon, 9 Apr 2018 18:16:00 +0000 (14:16 -0400)]
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>
6 years agozebra: Cleanup debugs and add a bit more info
Donald Sharp [Mon, 9 Apr 2018 18:09:35 +0000 (14:09 -0400)]
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>
6 years agozebra: Notice when our neighbor entry is removed and fight back
Donald Sharp [Mon, 9 Apr 2018 12:04:39 +0000 (08:04 -0400)]
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>
6 years agozebra: Notice when our route is deleted and re-install.
Donald Sharp [Sat, 31 Mar 2018 21:08:21 +0000 (17:08 -0400)]
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.
6 years agobgpd: the nexthop IP is displayed for FS entries.
Philippe Guibert [Fri, 6 Apr 2018 11:17:16 +0000 (13:17 +0200)]
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>
6 years agobgpd: handle ecom redirect-ip
Philippe Guibert [Fri, 6 Apr 2018 11:16:01 +0000 (13:16 +0200)]
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>
6 years agodoc: workflow.rst: more details of current coding style process
G. Paul Ziemba [Wed, 14 Mar 2018 00:32:51 +0000 (17:32 -0700)]
doc: workflow.rst: more details of current coding style process

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years agoMerge pull request #2037 from coreswitch/master
Donald Sharp [Fri, 6 Apr 2018 22:57:03 +0000 (18:57 -0400)]
Merge pull request #2037 from coreswitch/master

bgpd option '-p 0' means do not listen BGP port.

6 years agolib: add graph_find_node
Quentin Young [Fri, 6 Apr 2018 21:58:00 +0000 (17:58 -0400)]
lib: add graph_find_node

Allows finding a graph node by its data pointer.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoUpdate document about -p 0. When port number is 0, that means do not listen bgp...
kishiguro [Fri, 6 Apr 2018 21:43:36 +0000 (14:43 -0700)]
Update document about -p 0.  When port number is 0, that means do not listen bgp port.

Signed-off-by: Kunihiro Ishiguro <ishi@coreswitch.io>
6 years agobgpd option '-p 0' means do not listen BGP port.
kishiguro [Fri, 6 Apr 2018 21:01:05 +0000 (14:01 -0700)]
bgpd option '-p 0' means do not listen BGP port.

Signed-off-by: Kunihiro Ishiguro <ishi@coreswitch.io>
6 years agopbrd: adjust/remove the rule correctly when dst and/or src removed
Don Slice [Mon, 26 Mar 2018 19:16:09 +0000 (19:16 +0000)]
pbrd: adjust/remove the rule correctly when dst and/or src removed

When the last match criteria was removed (dst-ip or src-ip), we were
not deleting the rule correctly for ipv6. This fix retains the
needed src-ip/dst-ip during the pbr_send_pbr_map process so the
appropriate information is available for the rule delete.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agopbrd: Remove table and rule range commands
Donald Sharp [Mon, 26 Mar 2018 17:32:41 +0000 (13:32 -0400)]
pbrd: Remove table and rule range commands

Since PBR is meant to be for small deployments, allowing
end users to arbitrarily change rule and table ranges
without some more careful thought on what is going on
and how to do it, sets us up for issues.

At this time remove these knobs.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Indicate command failure a bit better
Donald Sharp [Mon, 26 Mar 2018 16:37:43 +0000 (12:37 -0400)]
pbrd: Indicate command failure a bit better

When a command is attempted to be configed and it
fails to be installed, indicate via vtysh return
codes that we did not accept the command

Ticket: CM-20216
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Add code to notice nexthop changes for pbr tables
Donald Sharp [Mon, 26 Mar 2018 15:05:52 +0000 (11:05 -0400)]
zebra: Add code to notice nexthop changes for pbr tables

When we have a PBR installed as a table, we need to notice
when a nexthop changes and rethink the routes for the pbr
tables.

Add code to nexthop tracking to notice the pbr watched
nexthop has changed in some manner.  If it is a pbr route
that depends on the nexthop then just enqueue it for
rethinking.

This is a bit of a hammer, we know that only pbr routes
are going to be installing routes in weird non-standard
tables as such we need to only handle nexthop changes
for nexthops that are actually changing that we care
about and to only requeue for route nodes we have
route entries for from PBR

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Do not use vrf_frame for pbrms display
Donald Sharp [Mon, 26 Mar 2018 01:18:56 +0000 (21:18 -0400)]
pbrd: Do not use vrf_frame for pbrms display

When displaying a pbr map sequence for a show run do not use the
vty_frame construct.  We should display the config even if we
do not have much to display.

Ticket: CM-20196
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Reduce range so we cannot go over the vrf rule
Donald Sharp [Mon, 26 Mar 2018 01:00:19 +0000 (21:00 -0400)]
pbrd: Reduce range so we cannot go over the vrf rule

The linux kernel puts the vrf rule at 1000, since pbr
rules need to be before this rule, don't allow us to go
beyond.

Ticket: CM-19946
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Prevent crash from partially configured interface
Donald Sharp [Thu, 22 Mar 2018 21:12:13 +0000 (17:12 -0400)]
pbrd: Prevent crash from partially configured interface

If an interface is in the process of coming up or
partially deconfigured, prevent pbrd from crashing

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: If we get the same prefix safely ignore
Donald Sharp [Thu, 22 Mar 2018 17:25:20 +0000 (13:25 -0400)]
pbrd: If we get the same prefix safely ignore

If the match src-ip or dst-ip command entered has already
been received and it's the same prefix, we are done and
do not need to do anything more.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: fix deletion of match or src of valid pbr-map
Don Slice [Thu, 22 Mar 2018 13:56:56 +0000 (13:56 +0000)]
pbrd: fix deletion of match or src of valid pbr-map

When removing either the match dst or match src of a previously
valid pbr map, we would just try to re-install the rule which
was rejected.  This fix deletes the old rule before we re-apply
the new rule.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agopbrd: add ability to delete routes and rules correctly
Don Slice [Wed, 21 Mar 2018 21:23:32 +0000 (21:23 +0000)]
pbrd: add ability to delete routes and rules correctly

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agolib: dont break display of nexthop-groups themselves
Quentin Young [Wed, 21 Mar 2018 16:07:20 +0000 (12:07 -0400)]
lib: dont break display of nexthop-groups themselves

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib, pbrd: rm extra space when displaying nexthop
Quentin Young [Tue, 20 Mar 2018 20:43:54 +0000 (16:43 -0400)]
lib, pbrd: rm extra space when displaying nexthop

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: fix null pointer deref when showing ifaces
Quentin Young [Tue, 20 Mar 2018 20:19:26 +0000 (16:19 -0400)]
pbrd: fix null pointer deref when showing ifaces

If there are no PBR interfaces configured and we do a 'show run', pbrd
crashes with a NPD when it tries to dereference ifp->info.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: Only allow one nexthop group or nexthop at a time
Donald Sharp [Tue, 20 Mar 2018 18:05:44 +0000 (14:05 -0400)]
pbrd: Only allow one nexthop group or nexthop at a time

When we are entering 'set nexthop' and 'set nexthop-group'
ensure that the cli only allows one of these to happen
at a time.

Ticket: CM-20125
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Remove pbr_events
Donald Sharp [Mon, 19 Mar 2018 13:04:17 +0000 (09:04 -0400)]
pbrd: Remove pbr_events

The pbr_events.c file was a mistake in that it overly complicated
the code and made it hard to think about what was happening.

Remove all the events and just do the work where needed.

Additionally rethink the sending of the pbr map to
zebra and only send one notification at a time instead
of having the sending function attempt to figure out
what to do.

Clean up some of the no form of commands to make them
work properly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agolib: Add hash and use const a bit more intelligently
Quentin Young [Mon, 19 Mar 2018 13:01:52 +0000 (09:01 -0400)]
lib: Add hash and use const a bit more intelligently

This commit adds code to notify the compiler that we
will not be changing the arguments to nexthop2str
and we expect thre return to be treated the same.

Additionally we add some code to allow nexthops to
be hashed to be used in a hash.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: bit of cleanup for pbr docs
Quentin Young [Fri, 16 Mar 2018 22:11:45 +0000 (18:11 -0400)]
doc: bit of cleanup for pbr docs

* Indent is 3 spaces
* Use CLI cross-references
* Wrap to 80 columns
* Adjust section capitalization

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoredhat: PBR modifications to allow it to build properly
Donald Sharp [Thu, 15 Mar 2018 16:46:18 +0000 (12:46 -0400)]
redhat: PBR modifications to allow it to build properly

Add to the redhat build the PBR daemon and it's ancillary
files.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Cleanup CI warnings
Donald Sharp [Thu, 15 Mar 2018 15:56:07 +0000 (11:56 -0400)]
pbrd: Cleanup CI warnings

There are a bunch of CI warnings that need to be cleaned up.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: Add documentation for PBRD
Donald Sharp [Thu, 15 Mar 2018 14:13:58 +0000 (10:13 -0400)]
doc: Add documentation for PBRD

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Add PBR to FRR
Donald Sharp [Tue, 23 Jan 2018 18:11:36 +0000 (13:11 -0500)]
pbrd: Add PBR to FRR

This is an implementation of PBR for FRR.

This implemenation uses a combination of rules and
tables to determine how packets will flow.

PBR introduces a new concept of 'nexthop-groups' to
specify a group of nexthops that will be used for
ecmp.  Nexthop-groups are specified on the cli via:

nexthop-group DONNA
  nexthop 192.168.208.1
  nexthop 192.168.209.1
  nexthop 192.168.210.1
!

PBR sees the nexthop-group and installs these as a default
route with these nexthops starting at table 10000
robot# show pbr nexthop-groups
Nexthop-Group: DONNA Table: 10001 Valid: 1 Installed: 1
Valid: 1  nexthop 192.168.209.1
Valid: 1  nexthop 192.168.210.1
Valid: 1  nexthop 192.168.208.1

I have also introduced the ability to specify a table
in a 'show ip route table XXX' to see the specified tables.

robot# show ip route table 10001
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, P - PIM, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR,
       > - selected route, * - FIB route

F>* 0.0.0.0/0 [0/0] via 192.168.208.1, enp0s8, 00:14:25
  *                 via 192.168.209.1, enp0s9, 00:14:25
  *                 via 192.168.210.1, enp0s10, 00:14:25

PBR tracks PBR-MAPS via the pbr-map command:

!
pbr-map EVA seq 10
  match src-ip 4.3.4.0/24
  set nexthop-group DONNA
!
pbr-map EVA seq 20
  match dst-ip 4.3.5.0/24
  set nexthop-group DONNA
!

pbr-maps can have 'match src-ip <prefix>' and 'match dst-ip <prefix>'
to affect decisions about incoming packets.  Additionally if you
only have one nexthop to use for a pbr-map you do not need
to setup a nexthop-group and can specify 'set nexthop XXXX'.

To apply the pbr-map to an incoming interface you do this:

interface enp0s10
 pbr-policy EVA
!

When a pbr-map is applied to interfaces it can be installed
into the kernel as a rule:

[sharpd@robot frr1]$ ip rule show
0: from all lookup local
309: from 4.3.4.0/24 iif enp0s10 lookup 10001
319: from all to 4.3.5.0/24 iif enp0s10 lookup 10001
1000: from all lookup [l3mdev-table]
32766: from all lookup main
32767: from all lookup default

[sharpd@robot frr1]$ ip route show table 10001
default proto pbr metric 20
nexthop via 192.168.208.1 dev enp0s8 weight 1
nexthop via 192.168.209.1 dev enp0s9 weight 1
nexthop via 192.168.210.1 dev enp0s10 weight 1

The linux kernel now will use the rules and tables to properly
apply these policies.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2027 from qlyoung/fix-vrf-static-holdem-display
Russ White [Fri, 6 Apr 2018 17:21:49 +0000 (13:21 -0400)]
Merge pull request #2027 from qlyoung/fix-vrf-static-holdem-display

zebra: display holdem statics correctly

6 years agoMerge pull request #2031 from chiragshah6/ospfv3_dev
Russ White [Fri, 6 Apr 2018 17:17:03 +0000 (13:17 -0400)]
Merge pull request #2031 from chiragshah6/ospfv3_dev

ospf6d: ECMP for Intra Area Prefix routes

6 years agoMerge pull request #2029 from cdwertmann/patch-1
Donald Sharp [Fri, 6 Apr 2018 12:22:03 +0000 (08:22 -0400)]
Merge pull request #2029 from cdwertmann/patch-1

add libpython-dev to 16.04 build dependencies

6 years agodebianpkg: add libpython-dev to 17.10 & 18.04 build dependencies
Christoph Dwertmann [Fri, 6 Apr 2018 07:14:55 +0000 (17:14 +1000)]
debianpkg: add libpython-dev to 17.10 & 18.04 build dependencies
Signed-off-by: Christoph Dwertmann <cdwertmann@gmail.com>
6 years agoospf6d: ECMP for Intra Area Prefix routes
Chirag Shah [Mon, 2 Apr 2018 21:37:10 +0000 (14:37 -0700)]
ospf6d: ECMP for Intra Area Prefix routes

Handle ECMP for Intra Area Prefix LSAs routes.

Ticket:CM-16139
Testing Done:

Configure ospf6 passive interface R2 and R3 with
same prefix address.
Check Intra Area Prefix LSA update  at R1 and R3
which would have ECMP paths with effective two
paths and two nexthops (from R2 and R4).
stop frr at R3 and R1 and R4 route changes back to
one nexthop and one paht.
R1 ---- R2
|       |
R3 ---- R4

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agodebianpkg: add libpython-dev to 16.04 build dependencies
Christoph Dwertmann [Thu, 5 Apr 2018 02:17:41 +0000 (12:17 +1000)]
debianpkg: add libpython-dev to 16.04 build dependencies
Signed-off-by: Christoph Dwertmann <cdwertmann@gmail.com>
6 years agozebra: display holdem statics correctly
Quentin Young [Wed, 4 Apr 2018 18:20:25 +0000 (14:20 -0400)]
zebra: display holdem statics correctly

Holdem statics display the dest (and mask, if present) string that the
user entered instead of converting to CIDR notation and applying the
mask. They need to do the latter.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2028 from qlyoung/cleanup-static-route-consistent-ordering
Russ White [Thu, 5 Apr 2018 00:55:59 +0000 (20:55 -0400)]
Merge pull request #2028 from qlyoung/cleanup-static-route-consistent-ordering

zebra: consistently order static route attributes

6 years agoMerge pull request #2022 from qlyoung/warn-vtysh-u-security
Russ White [Thu, 5 Apr 2018 00:54:31 +0000 (20:54 -0400)]
Merge pull request #2022 from qlyoung/warn-vtysh-u-security

doc: warn users about vtysh / telnet security

6 years agoMerge pull request #2013 from qlyoung/docuser
Russ White [Thu, 5 Apr 2018 00:53:46 +0000 (20:53 -0400)]
Merge pull request #2013 from qlyoung/docuser

doc: add more CLI documentation

6 years agoMerge pull request #2006 from qlyoung/remove-irdp-node
Russ White [Thu, 5 Apr 2018 00:52:45 +0000 (20:52 -0400)]
Merge pull request #2006 from qlyoung/remove-irdp-node

lib: remove IRDP_NODE

6 years agoMerge pull request #2002 from qlyoung/remove-undebug
Russ White [Thu, 5 Apr 2018 00:52:08 +0000 (20:52 -0400)]
Merge pull request #2002 from qlyoung/remove-undebug

bgpd, pim: remove undebug

6 years agoMerge pull request #1998 from qlyoung/fix-vrf-keyword-walkup
Russ White [Thu, 5 Apr 2018 00:51:02 +0000 (20:51 -0400)]
Merge pull request #1998 from qlyoung/fix-vrf-keyword-walkup

lib, vtysh: vrf walkup bugfix

6 years agoMerge pull request #1979 from LabNConsulting/working/master/bgp-nht-labels
Russ White [Thu, 5 Apr 2018 00:45:22 +0000 (20:45 -0400)]
Merge pull request #1979 from LabNConsulting/working/master/bgp-nht-labels

bgpd: nexthop tracking with labels for vrf-vpn leaking

6 years agoMerge pull request #2023 from LabNConsulting/working/master/confdate+release
Martin Winter [Thu, 5 Apr 2018 00:23:37 +0000 (01:23 +0100)]
Merge pull request #2023 from LabNConsulting/working/master/confdate+release

Use new way of avoiding deprecated related warnings in non-dev branches

6 years agoMakefile.am: change verstion type detection, if just numbers = _RELEASE, _DEV otherwise
Lou Berger [Wed, 4 Apr 2018 23:13:58 +0000 (19:13 -0400)]
Makefile.am: change verstion type detection, if just numbers = _RELEASE, _DEV otherwise

Signed-off-by: Lou Berger <lberger@labn.net>