]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
7 years agolib, pbrd: Do not allow v6 LL nexthops to be specified without an interface.
Donald Sharp [Wed, 28 Mar 2018 22:23:27 +0000 (18:23 -0400)]
lib, pbrd: Do not allow v6 LL nexthops to be specified without an interface.

Prevent the creation of a v6 LL nexthop that does not include an interface
for proper resolution.

Ticket: CM-20276
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #2064 from donaldsharp/redistribute_limitation
Lou Berger [Tue, 17 Apr 2018 19:55:35 +0000 (15:55 -0400)]
Merge pull request #2064 from donaldsharp/redistribute_limitation

redristribute and access list

7 years agoMerge pull request #2071 from qlyoung/sa-fixes
Rafael Zalamena [Tue, 17 Apr 2018 19:22:36 +0000 (16:22 -0300)]
Merge pull request #2071 from qlyoung/sa-fixes

More static analyzer fixes

7 years agoospfd: use __func__ in ospf_te.c 2071/head
Quentin Young [Tue, 17 Apr 2018 18:08:57 +0000 (14:08 -0400)]
ospfd: use __func__ in ospf_te.c

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobgpd: clean up clist management logic
Quentin Young [Mon, 16 Apr 2018 21:22:41 +0000 (17:22 -0400)]
bgpd: clean up clist management logic

* Remove unused parameter
* Restore behavior described by function comment
* Eliminate NPD caught by static analysis

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospf6d: handle realloc() failure in lsa test
Quentin Young [Mon, 16 Apr 2018 19:36:12 +0000 (15:36 -0400)]
ospf6d: handle realloc() failure in lsa test

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agobgpd: fix stylistic issue
Quentin Young [Mon, 16 Apr 2018 18:50:30 +0000 (14:50 -0400)]
bgpd: fix stylistic issue

Again, use of a macro as a conditional without wrapping in parens...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoeigrpd: remove unnecessary assignment
Quentin Young [Mon, 16 Apr 2018 18:49:16 +0000 (14:49 -0400)]
eigrpd: remove unnecessary assignment

Plot thickens, EIGRP SNMP code was copied from ospfd

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agolib: initialize imsg_hdr
Quentin Young [Mon, 16 Apr 2018 18:48:24 +0000 (14:48 -0400)]
lib: initialize imsg_hdr

Not fully initialized.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospfd: remove unnecessary assignment
Quentin Young [Mon, 16 Apr 2018 18:47:57 +0000 (14:47 -0400)]
ospfd: remove unnecessary assignment

Not sure what's going on here but it doesn't need to be

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoospfd: fix stylistic issue
Quentin Young [Mon, 16 Apr 2018 18:37:30 +0000 (14:37 -0400)]
ospfd: fix stylistic issue

Macro that expands to be wrapped in parentheses was being used as a raw
condition for an if statement, leading to some very weird and confusing
formatting...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agozebra: fix error-prone array iterator
Quentin Young [Mon, 16 Apr 2018 18:28:16 +0000 (14:28 -0400)]
zebra: fix error-prone array iterator

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
7 years agoMerge pull request #2058 from chipitsine/master
Quentin Young [Tue, 17 Apr 2018 15:45:41 +0000 (11:45 -0400)]
Merge pull request #2058 from chipitsine/master

more exclusions for clippy tool when running -fsanitize=address

7 years agoMerge pull request #2069 from donaldsharp/v6_tunnel_crash
Lou Berger [Tue, 17 Apr 2018 10:25:30 +0000 (06:25 -0400)]
Merge pull request #2069 from donaldsharp/v6_tunnel_crash

zebra: Fix crash with certain types of tunnels

7 years agoMerge pull request #2070 from dslicenc/import-table-crash-cm20450
Lou Berger [Tue, 17 Apr 2018 10:22:04 +0000 (06:22 -0400)]
Merge pull request #2070 from dslicenc/import-table-crash-cm20450

zebra: resolve assert when adding ip import-table entry

7 years agotools: more lsan suppressions for clippy 2058/head
Ilya Shipitsin [Tue, 17 Apr 2018 07:30:33 +0000 (12:30 +0500)]
tools: more lsan suppressions for clippy

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
7 years agoMerge pull request #1905 from pguibert6WIND/ipset_iptable_zebra
Donald Sharp [Tue, 17 Apr 2018 00:00:50 +0000 (20:00 -0400)]
Merge pull request #1905 from pguibert6WIND/ipset_iptable_zebra

Ipset iptable for zebra

7 years agozebra: Check for NULL in connected_add_ipv6 2069/head
Donald Sharp [Mon, 16 Apr 2018 15:17:52 +0000 (11:17 -0400)]
zebra: Check for NULL in connected_add_ipv6

When I implemented the same functionality in add_ipv6 that
add_ipv4 has I just assumed that broad would not be NULL with
the ZEBRA_IFA_PEER flag set.

Modify the code to act similiar to the flow of control
in add_ipv4.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agoMerge pull request #2067 from LabNConsulting/working/master/bgp-vpn-leak-new-label...
Donald Sharp [Mon, 16 Apr 2018 14:45:32 +0000 (10:45 -0400)]
Merge pull request #2067 from LabNConsulting/working/master/bgp-vpn-leak-new-label-new-route

bgpd: bugfix vpn-vrf leak: consider route changed if labels change

7 years agozebra: resolve assert when adding ip import-table entry 2070/head
Don Slice [Sun, 15 Apr 2018 19:25:24 +0000 (12:25 -0700)]
zebra: resolve assert when adding ip import-table entry

Problem was due to in certain route replace circumstances,
we would mark the old route_entry as removed to delete it but
would leave the selected flag set.  When the rn was pulled off the
work queue for process, we would find both the new re and old re
(being deleted) with the selected flag set and would assert.
In this change, when we decide to delete the old re, we also  mark
it as no longer selected.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
7 years agozebra: rename pbr_unique structure to pbr_rule_unique 1905/head
Philippe Guibert [Sat, 24 Mar 2018 13:58:04 +0000 (14:58 +0100)]
zebra: rename pbr_unique structure to pbr_rule_unique

This renaming of structure permits better identify which structure is
looked up, since policy routing will not only rely on iprule, but also
on some other structures.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agozebra: adapt zebra_pbr_rule based with pbr_rule
Philippe Guibert [Wed, 21 Mar 2018 10:59:02 +0000 (11:59 +0100)]
zebra: adapt zebra_pbr_rule based with pbr_rule

In order to avoid duplicates functions, the zebra_pbr_rule structure
used by zebra to decode the zapi message, and send netlink messages, is
slightly modified. the structure is derived from pbr_rule, but it also
includes sock identifier that is used to send back information to the
daemon that did the request. Also, the ifp pointer is stored in that
structure.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agolib: enhance pbr_rule structure for zapi encode and for common usage
Philippe Guibert [Wed, 21 Mar 2018 10:55:38 +0000 (11:55 +0100)]
lib: enhance pbr_rule structure for zapi encode and for common usage

The pbr_rule structure is derived from zebra_pbr_rule, and is
defined, so that a zclient will be able to encode the zebra_pbr_rule to
send ADD_RULE or DEL_RULE command. Also, the same structure can be used
by other daemons to derive a structure ( this will be the case for
zebra_pbr_rule).
Adding to this, an encoding function is defined, and will be used by
remote daemon to encode that message.
Those definitions are moved in new file pbr.h file.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agozebra: add a helper structure to look zebra_pbr_ipset per ipsetname
Philippe Guibert [Sat, 24 Mar 2018 13:55:06 +0000 (14:55 +0100)]
zebra: add a helper structure to look zebra_pbr_ipset per ipsetname

Add an intermediate helper structure that is used to walk the list of
ipset entries, and look for associated name.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agozebra: add IPTABLE_ADD and IPTABLE_DEL commands in zapi
Philippe Guibert [Mon, 12 Mar 2018 08:23:48 +0000 (09:23 +0100)]
zebra: add IPTABLE_ADD and IPTABLE_DEL commands in zapi

Those messages permit a remote daemon to configure an iptable entry. A
structure is defined that maps to an iptable entry. More specifically,
this structure proposes to associate fwmark, and a table ID.
Adding to the configuration, the initialisation of iptables hash list is
done into zebra netnamespace. Also a hook for notifying the sender that
the iptables has been correctly set is done.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agozebra: pbr rule structure is being added fwmark tag
Philippe Guibert [Thu, 8 Mar 2018 14:20:49 +0000 (15:20 +0100)]
zebra: pbr rule structure is being added fwmark tag

PBR rule is being added a 32 bit value that can be used to record a rule
in the kernel, by using a fwmark information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agozebra: handling notifications upon ipset creation/destruction done
Philippe Guibert [Wed, 7 Mar 2018 14:46:00 +0000 (15:46 +0100)]
zebra: handling notifications upon ipset creation/destruction done

Once ipset entries are injected in the kernel, the relevant daemon is
informed with a zebra message sent back.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agolib: add ZEBRA IPSET defines
Philippe Guibert [Wed, 7 Mar 2018 12:21:14 +0000 (13:21 +0100)]
lib: add ZEBRA IPSET defines

ZEBRA IPSET defines are added for creating/deleting ipset contexts.
Ans also create ipset hash sets.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agozebra: handle entry pointfs for ipset creation/destruction
Philippe Guibert [Wed, 7 Mar 2018 11:54:16 +0000 (12:54 +0100)]
zebra: handle entry pointfs for ipset creation/destruction

IPset and IPset entries structures are introduced. Those entries reflect
the ipset structures and ipset hash sets that will be created on the
kernel.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agoMerge pull request #2053 from LabNConsulting/working/master/bvl-bug-degenerate-no...
Donald Sharp [Mon, 16 Apr 2018 12:00:23 +0000 (08:00 -0400)]
Merge pull request #2053 from LabNConsulting/working/master/bvl-bug-degenerate-no-label

bgpd: bugfix vpn->vrf leak: unicast-originated routes are local non-LSP

7 years agoMerge pull request #2055 from opensourcerouting/fix-pathspace
Donald Sharp [Mon, 16 Apr 2018 11:59:24 +0000 (07:59 -0400)]
Merge pull request #2055 from opensourcerouting/fix-pathspace

Fix pathspace option -N

7 years agoMerge pull request #1950 from pguibert6WIND/issue_1949
Donald Sharp [Mon, 16 Apr 2018 11:51:31 +0000 (07:51 -0400)]
Merge pull request #1950 from pguibert6WIND/issue_1949

 VRF NETNS / add an indirection table for mapping NSID/VRFID

7 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

7 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

7 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

7 years agozebra: Fix crash with certain types of tunnels
Donald Sharp [Sun, 15 Apr 2018 14:57:19 +0000 (10:57 -0400)]
zebra: Fix crash with certain types of tunnels

Zebra did not have a handler for tunnels in v6 for
some reason.  Add code to handle the broadcast address
for both addition and deletion.

This appears to fix the crash.  There might still need
to be some work to make the code `work` properly for
this type of tunnel.

Fixes: #2063
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agobgp/rfapi: fix rfapiNhlAddNodeRoutes SA issue 2068/head
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>
7 years agobgpd: bugfix vpn-vrf leak: consider route changed if labels change 2067/head
G. Paul Ziemba [Wed, 11 Apr 2018 04:03:05 +0000 (21:03 -0700)]
bgpd: bugfix vpn-vrf leak: consider route changed if labels change

vpn-vrf leak code was not triggering a BGP update or an announce to zebra
if a route's labels changed. This changeset corrects that problem.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agobgpd: remove unused variable 2054/head
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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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>
7 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

7 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

7 years agopbrd: Allow PBR to ignore Access List commands 2064/head
Donald Sharp [Fri, 13 Apr 2018 14:02:32 +0000 (10:02 -0400)]
pbrd: Allow PBR to ignore Access List commands

PBR is hooked up to receive access-list commands automatically,
as are all daemons, add the bit of code to allow the PBR
daemon to safely receive the command and ignore it for the
moment.

Ticket: CM-20569
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: Restrict redistribution cli a bit
Donald Sharp [Fri, 13 Apr 2018 13:39:23 +0000 (09:39 -0400)]
lib: Restrict redistribution cli a bit

The PBR and PIM daemons, needed the ability to connect
to zebra.  Unfortunately this connection also implied
an ability to redistribute to other valid protocols.

Add a additional hook to the route_types.pl script
to allow us to specify if the client type should
be redistributed at all.

Additionally cleanup the PIM code to not show up
as a protocol under the header for a 'show ip route'
command

Ticket: CM-20568
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
7 years agolib: rename parameter for netns function 1950/head
Philippe Guibert [Thu, 12 Apr 2018 14:33:49 +0000 (16:33 +0200)]
lib: rename parameter for netns function

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agolib: Update netns_linux.c
Philippe Guibert [Mon, 26 Mar 2018 15:06:49 +0000 (15:06 +0000)]
lib: Update netns_linux.c

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agozebra: add an indirection table for ns_id
Philippe Guibert [Mon, 26 Mar 2018 10:22:18 +0000 (12:22 +0200)]
zebra: add an indirection table for ns_id

This list "table" is created in the case the netns backend for VRF is
used. This contains the mapping between the NSID value read from the
'ip netns list' and the ns id external used to create the VRF
value from vrf context. This mapping is
necessary in order to reserve default 0 value for vrf_default.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agolib: a vrf is searched first by its name, than its vrf id
Philippe Guibert [Tue, 20 Mar 2018 09:59:48 +0000 (10:59 +0100)]
lib: a vrf is searched first by its name, than its vrf id

Because at startup, remote daemons attempt to create default VRF,
the VRF_ID may be set to unknown. In that case, an event will be
triggered later by zebra to inform remote daemon that the vrf id of that
VRF has changed to valid value. In that case, two instances of default
VRF must not be created. By looking first at vrf name, this avoids
having two instances.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
7 years agoospf6d: router-id change to display msg to restart 2062/head
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>
7 years agobgpd: Fix another aspath %d that should be %u 2061/head
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>
7 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

7 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

7 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

7 years agobgpd: vpn-vrf leaking: use dynamic label pool for "auto" labels 2036/head
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>
7 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>
7 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

7 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

7 years agovtysh: fix pathspec option -N 2055/head
Christian Franke [Wed, 11 Apr 2018 20:15:00 +0000 (22:15 +0200)]
vtysh: fix pathspec option -N

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agolib: fix pathspace option -N
Christian Franke [Wed, 11 Apr 2018 20:14:56 +0000 (22:14 +0200)]
lib: fix pathspace option -N

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
7 years agobgpd: bugfix vpn->vrf leak: unicast-originated routes are local non-LSP 2053/head
G. Paul Ziemba [Wed, 11 Apr 2018 17:58:03 +0000 (10:58 -0700)]
bgpd: bugfix vpn->vrf leak: unicast-originated routes are local non-LSP

In general, routes leaked from the vpn rib to a vrf include any
labels that might have been attached to the vpn route. VRF routes
that have labels attached require a label-switched path and therefore
require nexthops with labels in order to be marked valid by the
nexthop-tracking logic.

However, some routes in the vpn RIB originated in vrfs local to this
router. Even though they may have labels, we must omit the labels
when leaking to a vrf because traffic using those resulting routes
will be carried by this router via IP routing and not label switching.
The nexthops of these routes do not need to indicate a label-switched
path, and thus the routes should be marked valid even when their nexthops
do not have labels.

This changeset omits labels from vpn->vrf leaked routes when the ultimate
source of the vpn route was a local vrf.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
7 years agozebra: fix style error 2052/head
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>
7 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

7 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

7 years agoresolve issue found by cppcheck 2050/head
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>
7 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

7 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

7 years agoripd: rip_snmp.c - Remove not needed check 2049/head
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>
7 years agobgpd: vrf-vpn leak: when no export label is set, encode implicit-null correctly 2047/head
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>
7 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

7 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

7 years agodoc: gracefully handle missing config.status 2039/head
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>
7 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>
7 years agodoc: update style exceptions list 1989/head
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>
7 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

7 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>
7 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>
7 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

7 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.

7 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

7 years agoalpine packaging: use a more standard packaging format 2040/head
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>
7 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>
7 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>
7 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>
7 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>
7 years agozebra: Only send down pertinent information on RTM_DELROUTE 2043/head
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>
7 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>
7 years agozebra: Notice when our neighbor entry is removed and fight back 2009/head
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>
7 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.
7 years agobgpd: the nexthop IP is displayed for FS entries. 2033/head
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>