]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoMerge pull request #2057 from donaldsharp/fix_1916
Russ White [Fri, 20 Apr 2018 11:56:48 +0000 (07:56 -0400)]
Merge pull request #2057 from donaldsharp/fix_1916

Fix 1916

6 years agoMerge pull request #2051 from donaldsharp/PBRD_EXTRA
Russ White [Fri, 20 Apr 2018 11:54:30 +0000 (07:54 -0400)]
Merge pull request #2051 from donaldsharp/PBRD_EXTRA

Pbrd extra

6 years agoMerge pull request #2088 from ajones-rvbd/ajones-issue-2087
Donald Sharp [Fri, 20 Apr 2018 11:22:09 +0000 (07:22 -0400)]
Merge pull request #2088 from ajones-rvbd/ajones-issue-2087

alpine build docs: Document docker images and alpine packages

6 years agoMerge pull request #2084 from donaldsharp/move_mpls
Jafar Al-Gharaibeh [Wed, 18 Apr 2018 20:53:17 +0000 (15:53 -0500)]
Merge pull request #2084 from donaldsharp/move_mpls

Move mpls

6 years agoalpine build docs: Document docker images and alpine packages
Arthur Jones [Wed, 18 Apr 2018 17:18:00 +0000 (10:18 -0700)]
alpine build docs: Document docker images and alpine packages

https://hub.docker.com/r/ajones17/frr/ contains pre-built docker
images and alpine packages for the master branch of frr.  Document
this continuous delivery system on the alpine build page.

Issue: https://github.com/FRRouting/frr/issues/2087
Signed-of-by: Arthur Jones <arthur.jones@riverbed.com>
6 years agoMerge pull request #2082 from qlyoung/sa-fixes
Rafael Zalamena [Wed, 18 Apr 2018 17:22:08 +0000 (14:22 -0300)]
Merge pull request #2082 from qlyoung/sa-fixes

Even more static analysis fixes

6 years agopbrd: fix multiple unsafe string copies
Quentin Young [Tue, 17 Apr 2018 22:20:53 +0000 (18:20 -0400)]
pbrd: fix multiple unsafe string copies

Coverity #1467828
Coverity #1467827
Coverity #1467826
Coverity #1467825
Coverity #1467824
Coverity #1467823
Coverity #1467822

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: remove potential null dereference
Quentin Young [Tue, 17 Apr 2018 21:59:47 +0000 (17:59 -0400)]
pbrd: remove potential null dereference

Coverity #1467832

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: remove pbr-policy resource leak
Quentin Young [Tue, 17 Apr 2018 21:51:48 +0000 (17:51 -0400)]
pbrd: remove pbr-policy resource leak

Removing a non-existent pbr-policy caused a pbr_interface to leak.

Coverity #1467829

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: remove unsafe string copy
Quentin Young [Tue, 17 Apr 2018 20:55:59 +0000 (16:55 -0400)]
pbrd: remove unsafe string copy

A user could overflow the pbr_ifp->mapname buffer by entering a pbr-map
name longer than 100 characters.

Coverity #1467821
Coverity #1467821

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: avoid indexing with negative integer
Quentin Young [Tue, 17 Apr 2018 20:40:09 +0000 (16:40 -0400)]
bgpd: avoid indexing with negative integer

Coverity #1399286

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopimd: avoid writing to negative fd
Quentin Young [Tue, 17 Apr 2018 20:36:56 +0000 (16:36 -0400)]
pimd: avoid writing to negative fd

Coverty #1465483

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: avoid writing to negative fd
Quentin Young [Tue, 17 Apr 2018 20:34:25 +0000 (16:34 -0400)]
lib: avoid writing to negative fd

Coverity #1399341

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2078 from dslicenc/fix-import-table-fix
Rafael Zalamena [Wed, 18 Apr 2018 13:21:38 +0000 (10:21 -0300)]
Merge pull request #2078 from dslicenc/fix-import-table-fix

zebra: fix flaw in fix for import-table crash

6 years agolib, zebra: Move label conversion strings to lib
Donald Sharp [Wed, 18 Apr 2018 11:06:11 +0000 (07:06 -0400)]
lib, zebra: Move label conversion strings to lib

The mpls_label2str and mpls_str2label functions should not
be zebra exclusive functions.  Move them to lib/mpls.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib, zebra: Move help string to appropriate header
Donald Sharp [Wed, 18 Apr 2018 11:00:12 +0000 (07:00 -0400)]
lib, zebra: Move help string to appropriate header

The MPLS_LABEL_HELPSTR belongs in lib/mpls.h in case
any other protocol wants to use it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2035 from vincentbernat/fix/no-etag-esi-ignore
Donald Sharp [Tue, 17 Apr 2018 22:59:48 +0000 (18:59 -0400)]
Merge pull request #2035 from vincentbernat/fix/no-etag-esi-ignore

bgpd: add basic support for ETI and ESI for BGP EVPN

6 years agolib: Handle if up/down and vrf enable/disable events
Donald Sharp [Tue, 10 Apr 2018 19:57:09 +0000 (15:57 -0400)]
lib: Handle if up/down and vrf enable/disable events

Properly notice when we get if up/down and vrf enable/disable
events and attempt to properly install nexthops as they
come in.

Ticket: CM20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Use proper decode function for interface
Donald Sharp [Tue, 10 Apr 2018 19:54:35 +0000 (15:54 -0400)]
pbrd: Use proper decode function for interface

Use a proper decode function for a interface state change.

Ticket: CM-20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Store nexthop information independently
Donald Sharp [Tue, 10 Apr 2018 13:23:34 +0000 (09:23 -0400)]
lib: Store nexthop information independently

Store Nexthop's as the incoming raw data.  This will allow
us to separate the act of inputting the cli from the
act of instantiating the cli.

Ticket: CM-20489
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Fix unused function
Donald Sharp [Tue, 10 Apr 2018 12:03:25 +0000 (08:03 -0400)]
pbrd: Fix unused function

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Allow pbr-policy add/removal to install/remove rules
Donald Sharp [Mon, 9 Apr 2018 19:41:37 +0000 (15:41 -0400)]
pbrd: Allow pbr-policy add/removal to install/remove rules

The pbrm->installed variable was being used only in a couple
of places and it has no real bearing on whether or not
we should install a rule or not.  Remove this value.

Ticket: CM-20429
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: don't collapse pbr debugs
Quentin Young [Tue, 3 Apr 2018 20:48:53 +0000 (16:48 -0400)]
pbrd: don't collapse pbr debugs

While compact, collapsing the various debugs into simply `debug pbr` if
all debugs are on is potentially confusing to users.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: move debug vty into pbr_vty.c
Quentin Young [Tue, 3 Apr 2018 20:46:11 +0000 (16:46 -0400)]
pbrd: move debug vty into pbr_vty.c

Dev docs say that CLI goes in _vty.c files

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd, zebra: Properly notice rule deletion
Donald Sharp [Mon, 9 Apr 2018 13:41:08 +0000 (09:41 -0400)]
pbrd, zebra: Properly notice rule deletion

When a rule is deleted properly notice it in pbr.

Ticket: CM-20394
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd, zebra: Fix multiple pbr-policy install
Donald Sharp [Fri, 6 Apr 2018 20:38:20 +0000 (16:38 -0400)]
pbrd, zebra: Fix multiple pbr-policy install

Somewhere along the way the ability to install multiple
pbr-policys for the same pbr-map was lost.

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

Ticket: CM-20429
Signed-off-by: Donald Sharp sharpd@cumulusnetworks.com>
6 years agopbrd: Fix installation and deletion in some cases
Donald Sharp [Fri, 6 Apr 2018 15:41:10 +0000 (11:41 -0400)]
pbrd: Fix installation and deletion in some cases

When a nexthop group is modified do not assume that it
is not installed.  The creation of the pnhgc is enough
to set the installed to false.  If we are reinstalling
it is not needed to set it as not installed.

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

Ticket: CM-20371
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopbrd: Prevent attempt at re-install for several scenarios
Donald Sharp [Fri, 30 Mar 2018 17:38:45 +0000 (13:38 -0400)]
pbrd: Prevent attempt at re-install for several scenarios

There exists several places we attempt to re-install the
same rule.  Figure out when we need to not make an attempt
at doing anything and do it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Tell rib_process to actually rethink pbr routes.
Donald Sharp [Fri, 30 Mar 2018 14:33:25 +0000 (10:33 -0400)]
zebra: Tell rib_process to actually rethink pbr routes.

When I implemented this code change I was only testing against
static routes and with one nexthop.  I missed the fact that
we needed to tell rib_process to actually rethink the nexthops.

Ticket: CM-20274
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Clean up delete of a nexthop from a nexthop group
Donald Sharp [Wed, 28 Mar 2018 23:31:40 +0000 (19:31 -0400)]
lib: Clean up delete of a nexthop from a nexthop group

The delete was not properly deleting the nexthop from
the nexthop group and it was not properly setting the
nexthop's pointers to NULL.

Ticket: CM-20261
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 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>
6 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

6 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

6 years agoospfd: use __func__ in ospf_te.c
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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agozebra: fix flaw in fix for import-table crash
Don Slice [Tue, 17 Apr 2018 17:48:30 +0000 (10:48 -0700)]
zebra: fix flaw in fix for import-table crash

Realized (with coverity's help) the fix had a mistake by pasting in
the wrong route entry to unset the selected flag.  This fix takes
care of that mistake.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 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

6 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

6 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

6 years agotools: more lsan suppressions for clippy
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>
6 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

6 years agozebra: Check for NULL in connected_add_ipv6
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>
6 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

6 years agozebra: resolve assert when adding ip import-table entry
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>
6 years agozebra: rename pbr_unique structure to pbr_rule_unique
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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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

6 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

6 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

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 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>
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: bugfix vpn-vrf leak: consider route changed if labels change
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>
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 agopbrd: Allow PBR to ignore Access List commands
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>
6 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>
6 years agolib: rename parameter for netns function
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>
6 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>
6 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>
6 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>
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 agozebra: Cleanup lines over 80 columns
Donald Sharp [Thu, 12 Apr 2018 13:20:20 +0000 (09:20 -0400)]
zebra: Cleanup lines over 80 columns

Cleanup warnings in lines over 80 columns.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: add EVPN learned neighbors as NUD_NOARP
Mitesh Kanjariya [Mon, 26 Feb 2018 22:10:50 +0000 (14:10 -0800)]
zebra: add EVPN learned neighbors as NUD_NOARP

EVPN owns the remote neigh entries which are programed in the kernel.
This entries should not age out and the only way to delete should be
from EVPN. We should program these entries with NUD_NOARP instead of
NUD_REACHABLE to avoid aging of this macs.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agozebra: act on kernel notifications for remote neighbors as well
Mitesh Kanjariya [Fri, 2 Mar 2018 23:28:33 +0000 (15:28 -0800)]
zebra: act on kernel notifications for remote neighbors as well

There can be a race condition between kernel and frr as follows.
Frr sends remote neigh notification.
At the (almost) same time kernel might send a notification saying
neigh is local.
After processing this notifications, the state in frr is local while
state in kernel is remote. This causes kernel and frr to be out of sync.
This problem will be avoided if FRR acts on the kernel notifications for
remote neighbors. When FRR sees a remote neighbor notification for a
neighbor which it thinks is local, FRR will change the neigh state to remote.

Ticket: CM-19923/CM-18830
Review: CCR-7222
Testing: Manual

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
6 years agobgpd: change advertise-subnet to a hidden command
Mitesh Kanjariya [Thu, 15 Mar 2018 10:29:50 +0000 (03:29 -0700)]
bgpd: change advertise-subnet to a hidden command

We have changed the flow in which we advertise the VNI subnet.
We will mark this command as hidden for all future purposes.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
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>