]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agoFix 'make clean' os Mac OS
Ruben Kerkhof [Tue, 22 Jan 2019 16:50:02 +0000 (17:50 +0100)]
Fix 'make clean' os Mac OS

The find command on Mac OS needs a path as first argument, or else
it outputs:

find -name __pycache__ -o -name .pytest_cache | xargs rm -rf
find: illegal option -- n
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
       find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
find -name "*.pyc" -o -name "*_clippy.c" | xargs rm -f
find: illegal option -- n
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
       find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
5 years agoMerge pull request #3631 from opensourcerouting/zapi_fixes
Russ White [Tue, 22 Jan 2019 01:25:08 +0000 (20:25 -0500)]
Merge pull request #3631 from opensourcerouting/zapi_fixes

Small zapi fixes

5 years agoMerge pull request #3632 from opensourcerouting/cli-xpath-fixes
Russ White [Tue, 22 Jan 2019 01:19:41 +0000 (20:19 -0500)]
Merge pull request #3632 from opensourcerouting/cli-xpath-fixes

Fix CLI issue introduced by the northbound + simplifications

5 years agoMerge pull request #3635 from opensourcerouting/rsock-debug-fix
Russ White [Tue, 22 Jan 2019 00:24:55 +0000 (19:24 -0500)]
Merge pull request #3635 from opensourcerouting/rsock-debug-fix

zebra: fix routing socket debug messages

5 years agoMerge pull request #3638 from pguibert6WIND/crash_manual_config_l3vpn
Russ White [Tue, 22 Jan 2019 00:20:53 +0000 (19:20 -0500)]
Merge pull request #3638 from pguibert6WIND/crash_manual_config_l3vpn

bgpd: do not crash when removing ip vpn entries

5 years agobgpd: do not crash when removing ip vpn entries
Philippe Guibert [Mon, 21 Jan 2019 16:19:53 +0000 (17:19 +0100)]
bgpd: do not crash when removing ip vpn entries

when removing bgp instance, the parsing of rm->info contexts must be
protected. Also, the main level of hierarchy of rds must not be
allocated more than once.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: make routing socket debug user friendlier
Rafael Zalamena [Thu, 17 Jan 2019 22:24:31 +0000 (20:24 -0200)]
zebra: make routing socket debug user friendlier

Implement a addrs RTA to string translator to provide more useful
debug output.

Example:

ifam_read_mesg: ifindex 2, ifname em1, ifam_addrs NETMASK,IFP,IFA
  ifam_flags 0x4, addr 2001:db8:1::1/64 broad (unspec) dst (unspec)
  gateway (unspec)

Instead of:

ifam_read_mesg: ifindex 2, ifname em1, ifam_addrs 0x34
  ifam_flags 0x4, addr 2001:db8:1::1/64 broad (unspec) dst (unspec)
  gateway (unspec)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agozebra: fix debug messages in ifam_read_mesg
Rafael Zalamena [Thu, 17 Jan 2019 16:37:53 +0000 (14:37 -0200)]
zebra: fix debug messages in ifam_read_mesg

Use the proper address family to convert binary address to string.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agozebra: fix debug prefix string size
Rafael Zalamena [Thu, 17 Jan 2019 15:15:20 +0000 (13:15 -0200)]
zebra: fix debug prefix string size

`gate_buf` should be big enough to hold IPv6 addresses and `inet_ntop`
should be run in the correct `sockaddr` struct member.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agozebra: fix debug messages with prefixes
Rafael Zalamena [Thu, 17 Jan 2019 15:12:13 +0000 (13:12 -0200)]
zebra: fix debug messages with prefixes

Debug messages should use `prefix_buf` and `prefix2str` should only be
called once in `kernel_rtm`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agolib: simplify detection of when the user is leaving the CLI config mode
Renato Westphal [Sat, 19 Jan 2019 01:23:45 +0000 (23:23 -0200)]
lib: simplify detection of when the user is leaving the CLI config mode

We can make use of the vty->config variable to know when the CLI
user is in the configuration mode or not. This is much simpler
than obtaining this information from the vty node, and also a more
robust solution (the three switch statements below, for example,
were out of sync).

Also, fix a bug where vty->config wasn't being unset in the
vty_config_exit() function (bug introduced by commit f344c66ea3).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: reset the vty xpath index when entering the config mode
Renato Westphal [Sat, 19 Jan 2019 00:58:58 +0000 (22:58 -0200)]
lib: reset the vty xpath index when entering the config mode

The CLI code uses the vty->xpath[] array and the vty->xpath_index
variables to keep track of where the user is in the configuration
hierarchy. As such, we were resetting vty->xpath_index to zero
whenever the user exited from the configuration mode in order to
keep the index valid. We weren't doing this in the vty_stop_input()
function however, which is called when the user types ^C in the
terminal. This was leading to bugs like this:

  zebra> en
  zebra# conf t
  zebra(config)# interface eth0
  zebra(config-if)# ^C
  zebra# conf t
  zebra(config)# interface eth0
  % Configuration failed.

  Schema node not found.
  YANG path: /frr-interface:lib/interface[name='eth0'][vrf='default']/frr-interface:lib

To fix this, do something more clever: instead of resetting the
XPath index whenever the user exits from the configuration mode,
do that when the user enters in the configuration mode. This way
the XPath index needs to be reset in a single place only, not to
mention it's a more robust solution.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #3618 from chiragshah6/ospf_vrf_dev
Renato Westphal [Fri, 18 Jan 2019 21:48:05 +0000 (19:48 -0200)]
Merge pull request #3618 from chiragshah6/ospf_vrf_dev

ospfd: remove default originate max aged lsa

5 years agodoc: fix small inconsistencies in the table of zapi command values
Renato Westphal [Fri, 18 Jan 2019 18:06:00 +0000 (16:06 -0200)]
doc: fix small inconsistencies in the table of zapi command values

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agozebra: send link parameters to zclients once they request interface info
Renato Westphal [Fri, 18 Jan 2019 18:06:00 +0000 (16:06 -0200)]
zebra: send link parameters to zclients once they request interface info

We were sending ZEBRA_INTERFACE_LINK_PARAMS messages under the
following circumstances:
* New interface was created (via kernel or config);
* Interface went from down to up;
* Update in the link-params configuration.

Now also send ZEBRA_INTERFACE_LINK_PARAMS messages whenever a zclient
connects and sends a ZEBRA_INTERFACE_ADD request. Without this fix,
the client daemons don't receive interface link parameters if they
are configured in the zebra startup configuration.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: use the correct VRF ID when parsing INTERFACE_LINK_PARAMS messages
Renato Westphal [Fri, 18 Jan 2019 18:06:00 +0000 (16:06 -0200)]
lib: use the correct VRF ID when parsing INTERFACE_LINK_PARAMS messages

Bug found during code inspection.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: fix checking of clients subscribed to receive default routes
Renato Westphal [Fri, 18 Jan 2019 18:06:00 +0000 (16:06 -0200)]
lib: fix checking of clients subscribed to receive default routes

In these two functions, we were using VRF_DEFAULT instead of the
VRF ID passed as a parameter when checking if the given client
subscribed to receive default routes or not. This prevented the
"default-originate" command from ospfd/isisd from working correctly
under specific circumstances.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agozebra: fix checking of clients subscribed to receive interface info
Renato Westphal [Fri, 18 Jan 2019 18:06:00 +0000 (16:06 -0200)]
zebra: fix checking of clients subscribed to receive interface info

client->ifinfo is a VRF bitmap, hence we need to use
vrf_bitmap_check() to check if a client is subscribed to receive
interface information for a particular VRF. Just checking if
the client->ifinfo value is set will always succeed since it's
a pointer initialized by zserv_client_create(). With this fix,
we'll stop sending interface messages from all VRFs to all clients,
even those that didn't subscribe to it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #3625 from donaldsharp/clist_strlen
Mark Stapp [Thu, 17 Jan 2019 16:25:45 +0000 (11:25 -0500)]
Merge pull request #3625 from donaldsharp/clist_strlen

bgpd: Use string length not sizeof the array

5 years agobgpd: Use string length not sizeof the array
Donald Sharp [Thu, 17 Jan 2019 01:43:53 +0000 (20:43 -0500)]
bgpd: Use string length not sizeof the array

strlen is the same as sizeof when the memory is dynamically allocated
but it is not the same when the memory being looked at is an array.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3624 from mjstapp/fix_ldpd_bind
Rafael Zalamena [Wed, 16 Jan 2019 23:58:50 +0000 (21:58 -0200)]
Merge pull request #3624 from mjstapp/fix_ldpd_bind

ldpd: fix missing return value in bindany

5 years agoldpd: fix missing return value in bindany
Mark Stapp [Wed, 16 Jan 2019 21:35:10 +0000 (16:35 -0500)]
ldpd: fix missing return value in bindany

One of the socket utilities was missing a return value in
one of its ifdef'd paths.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoospfd: remove default origin max age lsa
Chirag Shah [Tue, 15 Jan 2019 00:55:44 +0000 (16:55 -0800)]
ospfd: remove default origin max age lsa

default-information originate does not work
if config is removed and re-added.

Ticket:CM-20026
Testing Done:
Validate default-information originate config
removed and re-added, check ospf lsa database, and peer
route cache entry for default route.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #3617 from donaldsharp/cleanup_old_stale_netlink
Jafar Al-Gharaibeh [Tue, 15 Jan 2019 16:53:49 +0000 (11:53 -0500)]
Merge pull request #3617 from donaldsharp/cleanup_old_stale_netlink

zebra: Cleanup unnecessary check

5 years agoMerge pull request #3570 from donaldsharp/dire_warning
Lou Berger [Tue, 15 Jan 2019 16:44:25 +0000 (11:44 -0500)]
Merge pull request #3570 from donaldsharp/dire_warning

more doc stuff for configure

5 years agoMerge pull request #3610 from donaldsharp/bgp_default_doc
Lou Berger [Tue, 15 Jan 2019 15:27:09 +0000 (10:27 -0500)]
Merge pull request #3610 from donaldsharp/bgp_default_doc

doc: Add `[no] bgp default ipv4-unicast` documentation

5 years agoMerge pull request #3532 from donaldsharp/community_list_speedup
Lou Berger [Tue, 15 Jan 2019 15:05:20 +0000 (10:05 -0500)]
Merge pull request #3532 from donaldsharp/community_list_speedup

bgp Community list speedup

5 years agozebra: Cleanup unnecessary check
Donald Sharp [Tue, 15 Jan 2019 13:55:34 +0000 (08:55 -0500)]
zebra: Cleanup unnecessary check

We self include the enum that has the RTA_EXPIRES in it,
as such this will always be true.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3180 from qlyoung/prefixlen-u8-to-u16
Renato Westphal [Tue, 15 Jan 2019 02:39:39 +0000 (00:39 -0200)]
Merge pull request #3180 from qlyoung/prefixlen-u8-to-u16

lib: convert prefixlen to 16-bit integer

5 years agoMerge pull request #3611 from opensourcerouting/nb-fixes
Donald Sharp [Mon, 14 Jan 2019 22:28:49 +0000 (17:28 -0500)]
Merge pull request #3611 from opensourcerouting/nb-fixes

Minor northbound fixes

5 years agodoc: update build instructions for freebsd on how to obtain libyang
Renato Westphal [Mon, 14 Jan 2019 18:29:18 +0000 (16:29 -0200)]
doc: update build instructions for freebsd on how to obtain libyang

Unfortunately the first version of the FreeBSD libyang port contained
a bug in which the libyang pkginfo file wasn't being installed
correctly in the system, and this prevented the FRR build system from
detecting the library. This bug was already fixed months ago but some
FreeBSD package repositories still have the old bugged version of the
port. This means we can't suggest people to install libyang using
"pkg install" since this causes problems for most people. In this
case, suggest FreeBSD users to build and install libyang manually
as we suggest for other BSD platforms.

This commit should be reverted once all FreeBSD package repositories
are updated with the new version of the libyang port.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: update suggestions related to some northbound errors
Renato Westphal [Mon, 14 Jan 2019 18:29:18 +0000 (16:29 -0200)]
lib: update suggestions related to some northbound errors

Since commit 3a11599c, the FRR YANG modules are embedded inside the
binaries and no longer need to be loaded from the file system. This
way, it's impossible for the FRR binaries and YANG modules to be out
of sync anymore. As such, update the suggestions of the northbound
error codes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: don't abort when incomplete xpath is given by the user
Renato Westphal [Mon, 14 Jan 2019 18:29:18 +0000 (16:29 -0200)]
lib: don't abort when incomplete xpath is given by the user

Instead of aborting when an incomplete xpath is given to the
nb_oper_data_iterate() function, just return an error so that the
callers have a chance to treat this error. Aborting based on invalid
user input is never the right thing to do.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: fix "use of uninitialised value" valgrind warning
Renato Westphal [Mon, 14 Jan 2019 18:29:18 +0000 (16:29 -0200)]
lib: fix "use of uninitialised value" valgrind warning

When FRR is built without the --enable-config-rollbacks option,
the nb_db_transaction_save() function does nothing and the
"transaction_id" output parameter is left uninitialized. For
this reason, all northbound clients should initialize the
"transaction_id" argument before calling nb_candidate_commit() or
nb_candidate_commit_apply() (except when a NULL pointer is given,
which is the case of the confd and sysrepo plugins).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agolib: fix "may be used uninitialized" build warning
Renato Westphal [Mon, 14 Jan 2019 18:29:18 +0000 (16:29 -0200)]
lib: fix "may be used uninitialized" build warning

We are already handling all possible four cases from the "nb_event"
enumeration, so this problem can't happen in practice. Initialize the
"ref" variable to zero to silence the warning.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #3607 from opensourcerouting/default_information_afi
Donald Sharp [Mon, 14 Jan 2019 17:04:11 +0000 (12:04 -0500)]
Merge pull request #3607 from opensourcerouting/default_information_afi

lib, zebra: add AFI parameter to the ZEBRA_REDISTRIBUTE_DEFAULT_* messages

5 years agodoc: Add `[no] bgp default ipv4-unicast` documentation
Donald Sharp [Mon, 14 Jan 2019 16:32:44 +0000 (11:32 -0500)]
doc: Add `[no] bgp default ipv4-unicast` documentation

This command had no documentation so add it in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
5 years agolib, zebra: add AFI parameter to the ZEBRA_REDISTRIBUTE_DEFAULT_* messages
Renato Westphal [Fri, 11 Jan 2019 21:20:13 +0000 (19:20 -0200)]
lib, zebra: add AFI parameter to the ZEBRA_REDISTRIBUTE_DEFAULT_* messages

Some daemons like ospfd and isisd have the ability to advertise a
default route to their peers only if one exists in the RIB. This
is what the "default-information originate" commands do when used
without the "always" parameter.

For that to work, these daemons use the ZEBRA_REDISTRIBUTE_DEFAULT_ADD
message to request default route information to zebra. The problem
is that this message didn't have an AFI parameter, so a default route
from any address-family would satisfy the requests from both daemons
(e.g. ::/0 would trigger ospfd to advertise a default route to its
peers, and 0.0.0.0/0 would trigger isisd to advertise a default route
to its IPv6 peers).

Fix this by adding an AFI parameter to the
ZEBRA_REDISTRIBUTE_DEFAULT_{ADD,DELETE} messages and making the
corresponding code changes.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoMerge pull request #3605 from donaldsharp/bfd_24_minutes
Rafael Zalamena [Mon, 14 Jan 2019 13:20:54 +0000 (11:20 -0200)]
Merge pull request #3605 from donaldsharp/bfd_24_minutes

bfdd: Fix timer print-out function

5 years agoMerge pull request #3567 from donaldsharp/cleanup_route_table_creation
Renato Westphal [Mon, 14 Jan 2019 12:56:07 +0000 (10:56 -0200)]
Merge pull request #3567 from donaldsharp/cleanup_route_table_creation

Route Table Handling and shows

5 years agoMerge pull request #3564 from chiragshah6/evpn_dev1
Renato Westphal [Mon, 14 Jan 2019 12:50:20 +0000 (10:50 -0200)]
Merge pull request #3564 from chiragshah6/evpn_dev1

zebra: use default vrf_id for zvrf reference

5 years agoMerge pull request #3588 from donaldsharp/bgp_label_nonsense
Renato Westphal [Mon, 14 Jan 2019 12:46:42 +0000 (10:46 -0200)]
Merge pull request #3588 from donaldsharp/bgp_label_nonsense

bgpd: Do not send a label to zebra that it doesn't understand

5 years agoMerge pull request #3600 from opensourcerouting/bfd-zebra-if
Donald Sharp [Mon, 14 Jan 2019 00:18:38 +0000 (19:18 -0500)]
Merge pull request #3600 from opensourcerouting/bfd-zebra-if

bfdd: use zebra API to learn about interfaces

5 years agobfdd: Fix timer print-out function
Donald Sharp [Sat, 12 Jan 2019 21:22:32 +0000 (16:22 -0500)]
bfdd: Fix timer print-out function

The timer2str function thought 24 minutes was an hour and had a
couple of other issues that needed to be corrected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3563 from donaldsharp/minimize_the_stuff
Mark Stapp [Fri, 11 Jan 2019 21:34:20 +0000 (16:34 -0500)]
Merge pull request #3563 from donaldsharp/minimize_the_stuff

Zebra - Some Cleanup

5 years agoMerge pull request #3601 from mjstapp/fix_prov_uninit
Donald Sharp [Fri, 11 Jan 2019 20:55:26 +0000 (15:55 -0500)]
Merge pull request #3601 from mjstapp/fix_prov_uninit

zebra: Fix uninitialized value warning in dplane code

5 years agozebra: Fix uninitialized value warning in dplane code
Mark Stapp [Fri, 11 Jan 2019 18:38:41 +0000 (13:38 -0500)]
zebra: Fix uninitialized value warning in dplane code

Fix a gcc-8 warning (at least) about a possible uninitialized
value in the zebra_dplane code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: Add a switch statement for rib_process_after
Donald Sharp [Thu, 3 Jan 2019 18:50:23 +0000 (13:50 -0500)]
zebra: Add a switch statement for rib_process_after

Future commits are going to introduce more rigor in
state setting in the case of received results from
the data plane.  So let us move the DPLANE_OP_ROUTE_DELETE
state check to the same spot as the rest of the code that
is handling a particular operation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Modify the status flag to 32 bits, add more flags
Donald Sharp [Thu, 3 Jan 2019 18:35:58 +0000 (13:35 -0500)]
zebra: Modify the status flag to 32 bits, add more flags

Modify the status flag from 8 bits to 32 bits and to add
a few new flags that will be used in future commits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Limit meta_queue insertion to one time.
Donald Sharp [Thu, 3 Jan 2019 16:56:35 +0000 (11:56 -0500)]
zebra: Limit meta_queue insertion to one time.

Modify the meta_queue insertion such that we only enqueue
the route_node into one meta_queue instead of several.

Suppose we have multiple route_entries associated with
a particular node from rip, bgp, staticd.  If we receive a
route update from rip, we would enqueue the route_node into
the 1, 2, 3 meta-nodes.  Which means that we would run
the entire process of figuring out a route 3 times, while
nothing would change the second two times.

Modify the code to choose the lowest meta-queue and
install it into that one for processing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3599 from donaldsharp/vtysh_sharp
Mark Stapp [Fri, 11 Jan 2019 15:27:36 +0000 (10:27 -0500)]
Merge pull request #3599 from donaldsharp/vtysh_sharp

sharpd: Clean up vtysh warning about insufficient doc string

5 years agoMerge pull request #3597 from mjstapp/dplane_return_prov
Donald Sharp [Fri, 11 Jan 2019 15:24:25 +0000 (10:24 -0500)]
Merge pull request #3597 from mjstapp/dplane_return_prov

zebra: return dataplane provider plugin handle

5 years agosharpd: Clean up vtysh warning about insufficient doc string
Donald Sharp [Fri, 11 Jan 2019 13:58:36 +0000 (08:58 -0500)]
sharpd: Clean up vtysh warning about insufficient doc string

Not sure why this wasn't caught by our CI system.  I thought it
would.  My screw up this should have been right from the start.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
5 years agozebra: return dataplane provider plugin handle
Mark Stapp [Thu, 10 Jan 2019 18:50:33 +0000 (13:50 -0500)]
zebra: return dataplane provider plugin handle

When a dataplane provider/plugin registers, return the new
handle/object - that's needed to use some provider apis
later on.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #3591 from donaldsharp/sharp_v6
Mark Stapp [Fri, 11 Jan 2019 12:54:18 +0000 (07:54 -0500)]
Merge pull request #3591 from donaldsharp/sharp_v6

Sharp v6 and stuff

5 years agosharpd: Do addition/subtraction for me
Donald Sharp [Thu, 10 Jan 2019 00:27:10 +0000 (19:27 -0500)]
sharpd: Do addition/subtraction for me

Write a bit of code to track the start/stop times and do subtraction!
In the future we expect this code to slice and dice as well.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agosharpd: Allow route install/removal of v6 routes.
Donald Sharp [Wed, 9 Jan 2019 23:58:36 +0000 (18:58 -0500)]
sharpd: Allow route install/removal of v6 routes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Add another 32 bit accessor to the prefix data structure
Donald Sharp [Wed, 9 Jan 2019 23:28:10 +0000 (18:28 -0500)]
lib: Add another 32 bit accessor to the prefix data structure

It would be nice to have the ability to access the prefix data structure
address as a block of 4 uint32_t's.  This will allow me to easily/quickly
update the v6 address by 1.  This will be used in subsuquent commits.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3511 from pguibert6WIND/handle_multiple_netns_delete_event
Donald Sharp [Fri, 11 Jan 2019 00:21:34 +0000 (19:21 -0500)]
Merge pull request #3511 from pguibert6WIND/handle_multiple_netns_delete_event

zebra: handle multiple events for netns deletion event

5 years agoMerge pull request #3526 from mjstapp/dplane_lists
Donald Sharp [Fri, 11 Jan 2019 00:20:35 +0000 (19:20 -0500)]
Merge pull request #3526 from mjstapp/dplane_lists

zebra: pass lists of results from dataplane to zebra

5 years agobfdd: remove unused OS specific functions
Rafael Zalamena [Thu, 10 Jan 2019 19:20:09 +0000 (17:20 -0200)]
bfdd: remove unused OS specific functions

We are using zebra to learn about the network interfaces and no longer
need to use OS specific system calls to get it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobfdd: use zebra to learn about network interfaces
Rafael Zalamena [Thu, 10 Jan 2019 19:13:32 +0000 (17:13 -0200)]
bfdd: use zebra to learn about network interfaces

Don't use system calls to search for and get interface information,
instead use the FRR provided API to learn and cache it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agozebra: pass lists of results from dataplane to zebra
Mark Stapp [Fri, 21 Dec 2018 19:12:33 +0000 (14:12 -0500)]
zebra: pass lists of results from dataplane to zebra

Pass lists of results back to zebra from the dataplane subsystem
(and pthread). This helps reduce the lock/unlock cycles when
zebra is busy. Also remove a couple of typedefs that made their
way into the dataplane header file - those violate the FRR style
guidelines.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #3589 from donaldsharp/self_vs_thread
Mark Stapp [Thu, 10 Jan 2019 13:49:01 +0000 (08:49 -0500)]
Merge pull request #3589 from donaldsharp/self_vs_thread

lib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can

5 years agoMerge pull request #3590 from donaldsharp/zebra_pthread_setnames
Mark Stapp [Thu, 10 Jan 2019 13:36:11 +0000 (08:36 -0500)]
Merge pull request #3590 from donaldsharp/zebra_pthread_setnames

FRR pthread setnames

5 years agoMerge pull request #3198 from donaldsharp/mac_rejection
Renato Westphal [Thu, 10 Jan 2019 13:21:18 +0000 (11:21 -0200)]
Merge pull request #3198 from donaldsharp/mac_rejection

Mac rejection

5 years agoMerge pull request #3415 from pguibert6WIND/flowspec_support_nh_tracking
Donald Sharp [Wed, 9 Jan 2019 20:41:16 +0000 (15:41 -0500)]
Merge pull request #3415 from pguibert6WIND/flowspec_support_nh_tracking

Flowspec support nh tracking

5 years agoMerge pull request #3525 from pguibert6WIND/priorise_default_vrf_configured
Donald Sharp [Wed, 9 Jan 2019 20:30:50 +0000 (15:30 -0500)]
Merge pull request #3525 from pguibert6WIND/priorise_default_vrf_configured

zebra: start the netns notification mechanism after ns initialisation

5 years agolib, bgpd: Convert frr_pthread_set_name to only cause it to set os name of the thread
Donald Sharp [Wed, 9 Jan 2019 19:59:22 +0000 (14:59 -0500)]
lib, bgpd: Convert frr_pthread_set_name to only cause it to set os name of the thread

The current invocation of frr_pthread_set_name was causing it reset the os_name.
There is no need for this, we now always create the pthread appropriately
to have both name and os_name.  So convert this function to a simple
call through of the pthread call now.

Before(any of these changes):
sharpd@robot ~/frr1> ps -L -p 16895
  PID   LWP TTY          TIME CMD
16895 16895 ?        00:01:39 bgpd
16895 16896 ?        00:00:54
16895 16897 ?        00:00:07 bgpd_ka

After:
sharpd@donna ~/frr1> ps -L -p 1752
  PID   LWP TTY          TIME CMD
 1752  1752 ?        00:00:00 bgpd
 1752  1753 ?        00:00:00 bgpd_io
 1752  1754 ?        00:00:00 bgpd_ka

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Cleanup thread name setting to happen at start
Donald Sharp [Wed, 9 Jan 2019 19:32:44 +0000 (14:32 -0500)]
lib: Cleanup thread name setting to happen at start

When we start a thread we always call fpt_run and since
the last commit we know os_name is filled with something,
therefore we can just set the name on startup.

This creates this output now for zebra:

sharpd@donna ~/frr2> ps -L -p 25643
  PID   LWP TTY          TIME CMD
25643 25643 ?        00:00:00 zebra
25643 25644 ?        00:00:00 Zebra dplane
25643 25684 ?        00:00:00 zebra_apic
sharpd@donna ~/frr2>

I removed the abstraction to frr_pthread_set_name because
it was snprintf'ing into the same buffer which was the
real bug here( the first character of os_name became null).
In the next commit I'll remove that api because
it is unneeded and was a horrible hack to get
this to work for the one place it was wanted.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: On frr_pthread_new save a os_name
Donald Sharp [Wed, 9 Jan 2019 18:41:46 +0000 (13:41 -0500)]
lib: On frr_pthread_new save a os_name

On call of frr_pthread_new, save the os_name if given,
if not given use the name passed in( shortening to fit
in available space ) and finally if the name was not
passed in use the default value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: do not create vrf if name already set to default vrf at startup
Philippe Guibert [Fri, 28 Dec 2018 13:27:45 +0000 (14:27 +0100)]
zebra: do not create vrf if name already set to default vrf at startup

if the default vrf name is manually set, by passing -o parameter to
zebra, then this should be detected when walking the list of netns
available in the system. If a netns called vrf0 is present, then it
should be ignored.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: start the netns notification mechanism after ns initialisation
Philippe Guibert [Fri, 21 Dec 2018 15:25:20 +0000 (16:25 +0100)]
zebra: start the netns notification mechanism after ns initialisation

when zebra is run, by using vrf netns backend mode, then the parser
detector of netns is run before forcing the default vrf to a possible
value. In that case, there is a possibility that the forced '-o' option
will create a second vrf with same name, whereas this option should be
there to uniquely have a default vrf with a value.
To make things consistent, the forced value will be priorised. Then, the
notifier will attempt to create vrf contexts. The expectation is that
the creation will fail, due to an already present vrf with same name.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agolib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can
Donald Sharp [Wed, 9 Jan 2019 17:18:21 +0000 (12:18 -0500)]
lib: Convert RUSAGE_SELF to RUSAGE_THREAD where we can

When using getrusage, we have multiple choices about what
to call for data gathering about this particular thread of execution.

RUSAGE_SELF -> This means gather all cpu run time for all pthreads associated
with this process.

RUSAGE_THREAD -> This means gather all cpu run time for this particular
pthread.

Clearly with data gathering for slow thread as well as `show thread cpu`
it would be preferable to gather only data about the current running
pthread.  This probably was the original behavior of using RUSAGE_SELF
when we didn't have multiple pthreads.  So it didn't matter so much.

Prior to this change, 10 iterations of 1 million routes install/remove
from zebra would give us this cpu time for the dataplane pthread:

Showing statistics for pthread Zebra dplane thread
--------------------------------------------------
                      CPU (user+system): Real (wall-clock):
Active   Runtime(ms)   Invoked Avg uSec Max uSecs Avg uSec Max uSecs  Type  Thread
    0     280902.149    326541      860   2609982      550   2468910    E  dplane_thread_loop

After this change we are seeing this:

Showing statistics for pthread Zebra dplane thread
--------------------------------------------------
                      CPU (user+system): Real (wall-clock):
Active   Runtime(ms)   Invoked Avg uSec Max uSecs Avg uSec Max uSecs  Type  Thread
    0      58045.560    334944      173    277226      539   2502268    E  dplane_thread_loop

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Do not send a label to zebra that it doesn't understand
Donald Sharp [Wed, 9 Jan 2019 13:48:37 +0000 (08:48 -0500)]
bgpd: Do not send a label to zebra that it doesn't understand

When using an `import vrf` mechanism we are marking
the vrf label as BGP_PREVENT_VRF_2_VRF_LEAK, and then sending
this down to zebra.  Since zebra knows nothing about this special
value, convert it to a value that it does know MPLS_LABEL_NONE.

This bug was introduced by: 13b7e7f007833c4e2942f40cbd2c2f93a2767e78

And shows up with this error message in the zebra log:

2019/01/09 08:25:16 ZEBRA: Extended Error: Label >= configured maximum in platform_labels
2019/01/09 08:25:16 ZEBRA: [EC 4043309093] netlink-cmd (NS 0) error: Invalid argument, type=RTM_NEWROUTE(24), seq=8, pid=3321825991
2019/01/09 08:25:16 ZEBRA: [EC 4043309103] LSP Install Failure: 4294967294

And zebra kept the label as:
donna.cumulusnetworks.com# show mpls table
 Inbound                            Outbound
   Label     Type          Nexthop     Label
--------  -------  ---------------  --------
      -2      BGP            GREEN
      -2      BGP             BLUE

After this fix, neither the labels are stored in zebra nor do we see
the log error message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agodoc: Add more documentation around configure options
Donald Sharp [Sat, 5 Jan 2019 00:46:16 +0000 (19:46 -0500)]
doc: Add more documentation around configure options

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoconfigure: Add a bit more warning to the enable-shell option
Donald Sharp [Sat, 5 Jan 2019 00:43:40 +0000 (19:43 -0500)]
configure: Add a bit more warning to the enable-shell option

This option probably did not have enough of a please be careful
warning around it.  Let's add a bit more.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Further refine hash lookup to store hash value
Donald Sharp [Wed, 9 Jan 2019 01:23:11 +0000 (20:23 -0500)]
bgpd: Further refine hash lookup to store hash value

Further refine the previous commit to store the hash value in
both the `struct community_list` as well as the `struct rmap_community`
structures.  This allows us to know a priori what our hash value
is.  This change cuts another couple of seconds of convergence
off to ~55 seconds and further reduces cpu load of bgp:

   16      40061.706    433732       92    330102      129   1242965 RWTEX TOTAL

Down from ~43 seconds previously.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Add a hash for quick lookup in community_list_lookup
Donald Sharp [Wed, 26 Dec 2018 18:21:10 +0000 (13:21 -0500)]
bgpd: Add a hash for quick lookup in community_list_lookup

The community_list_lookup function in a situation where you have
a large number of communities and route-maps that reference them
becomes a very expensive operation( effectively a linked list walk
per route per route-map you apply per peer that has a routemap that
refereces a community, ecommunity or lcommunity.  This is a very
expensive operation.

In my testbed, I have a full bgp feed that feeds into 14 namespace
view based bgp processes and finally those 14 feed into a final
namespace FRR instance that has route-maps applied to each
incoming peer for in and out:

!
router bgp 65033
 bgp bestpath as-path multipath-relax
 neighbor 192.168.41.1 remote-as external
 neighbor 192.168.42.2 remote-as external
 neighbor 192.168.43.3 remote-as external
 neighbor 192.168.44.4 remote-as external
 neighbor 192.168.45.5 remote-as external
 neighbor 192.168.46.6 remote-as external
 neighbor 192.168.47.7 remote-as external
 neighbor 192.168.48.8 remote-as external
 neighbor 192.168.49.9 remote-as external
 neighbor 192.168.50.10 remote-as external
 neighbor 192.168.51.11 remote-as external
 neighbor 192.168.52.12 remote-as external
 neighbor 192.168.53.13 remote-as external
 neighbor 192.168.54.14 remote-as external
 !
 address-family ipv4 unicast
  neighbor 192.168.42.2 prefix-list two-in in
  neighbor 192.168.42.2 route-map two-in in
  neighbor 192.168.42.2 route-map two-out out
  neighbor 192.168.43.3 prefix-list three-in in
  neighbor 192.168.43.3 route-map three-in in
  neighbor 192.168.43.3 route-map three-out out
  neighbor 192.168.44.4 prefix-list four-in in
  neighbor 192.168.44.4 route-map four-in in
  neighbor 192.168.44.4 route-map four-out out
  neighbor 192.168.45.5 prefix-list five-in in
  neighbor 192.168.45.5 route-map five-in in
  neighbor 192.168.45.5 route-map five-out out
  neighbor 192.168.46.6 prefix-list six-in in
  neighbor 192.168.46.6 route-map six-in in
  neighbor 192.168.46.6 route-map six-out out
  neighbor 192.168.47.7 prefix-list seven-in in
  neighbor 192.168.47.7 route-map seven-in in
  neighbor 192.168.47.7 route-map seven-out out
  neighbor 192.168.48.8 prefix-list eight-in in
  neighbor 192.168.48.8 route-map eight-in in
  neighbor 192.168.48.8 route-map eight-out out
  neighbor 192.168.49.9 prefix-list nine-in in
  neighbor 192.168.49.9 route-map nine-in in
  neighbor 192.168.49.9 route-map nine-out out
  neighbor 192.168.50.10 prefix-list ten-in in
  neighbor 192.168.50.10 route-map ten-in in
  neighbor 192.168.50.10 route-map ten-out out
  neighbor 192.168.51.11 prefix-list eleven-in in
  neighbor 192.168.51.11 route-map eleven-in in
  neighbor 192.168.51.11 route-map eleven-out out
  neighbor 192.168.52.12 prefix-list twelve-in in
  neighbor 192.168.52.12 route-map twelve-in in
  neighbor 192.168.52.12 route-map twelve-out out
  neighbor 192.168.53.13 prefix-list thirteen-in in
  neighbor 192.168.53.13 route-map thirteen-in in
  neighbor 192.168.53.13 route-map thirteen-out out
  neighbor 192.168.54.14 prefix-list fourteen-in in
  neighbor 192.168.54.14 route-map fourteen-in in
  neighbor 192.168.54.14 route-map fourteen-out out
 exit-address-family
!

This configuration on my machine before this change takes about 2:45 to converge
and bgp takes:

Total thread statistics
   16     151715.050    493440      307   3464919      335   7376696 RWTEX TOTAL

CPU time as reported by 'show thread cpu'.

After this change BGP takes 58 seconds to converge and uses:
Total thread statistics
-------------------------
   16      42954.284    350319      122    295743      157   1194820 RWTEX TOTAL

almost 43 seconds of CPU time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Use `struct rmap_community` when we use community_list_lookup
Donald Sharp [Wed, 26 Dec 2018 18:01:06 +0000 (13:01 -0500)]
bgpd: Use `struct rmap_community` when we use community_list_lookup

The community_list_lookup function is being changed in a future
commit.  As such we want to use the `struct rmap_community` data
structure for storing compiled information about communities,ecommunities
or lcommunities.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3565 from rhonda/patch-1
Donald Sharp [Tue, 8 Jan 2019 21:40:45 +0000 (16:40 -0500)]
Merge pull request #3565 from rhonda/patch-1

debianpkg: use getent instead of egrepping files

5 years agodebianpkg: use getent instead of egrepping files
Rhonda D'Vine [Fri, 4 Jan 2019 10:34:13 +0000 (11:34 +0100)]
debianpkg: use getent instead of egrepping files

User data might not be stored in the files in etc. getent is the
dedicated tool to extract those information, regardless of where the
user data is stored

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
5 years agoMerge pull request #3569 from donaldsharp/recursive_nexthops
Mark Stapp [Tue, 8 Jan 2019 17:15:10 +0000 (12:15 -0500)]
Merge pull request #3569 from donaldsharp/recursive_nexthops

Small cleanup of zebra_rnh.c code

5 years agoMerge pull request #3552 from donaldsharp/zebra_combined_meta_peanuts
Mark Stapp [Tue, 8 Jan 2019 16:59:45 +0000 (11:59 -0500)]
Merge pull request #3552 from donaldsharp/zebra_combined_meta_peanuts

zebra: Consolidate meta_queue_map into route_info

5 years agoMerge pull request #3531 from marauderlabs/docs-fix
Quentin Young [Tue, 8 Jan 2019 16:04:46 +0000 (11:04 -0500)]
Merge pull request #3531 from marauderlabs/docs-fix

doc: Fix typos and grammar

5 years agoMerge pull request #3566 from pguibert6WIND/fix_vrf_netns_broken
Donald Sharp [Tue, 8 Jan 2019 15:48:16 +0000 (10:48 -0500)]
Merge pull request #3566 from pguibert6WIND/fix_vrf_netns_broken

zebra: fix vrf netns broken

5 years agoMerge pull request #3582 from opensourcerouting/freebsd-route-fix
Donald Sharp [Tue, 8 Jan 2019 15:41:52 +0000 (10:41 -0500)]
Merge pull request #3582 from opensourcerouting/freebsd-route-fix

zebra: fix FreeBSD breakage

5 years agozebra: update local ns_id field
Philippe Guibert [Mon, 7 Jan 2019 08:55:10 +0000 (09:55 +0100)]
zebra: update local ns_id field

ns_id field must be synced with ns_id from netns service.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: fix another FreeBSD warning message
Rafael Zalamena [Tue, 8 Jan 2019 12:37:22 +0000 (10:37 -0200)]
zebra: fix another FreeBSD warning message

When an empty netmask a wrong end size is calculated, lets handle this
corner case to avoid spurious warning messages.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #3575 from LabNConsulting/working/master/no-bgp-attr-255
Donald Sharp [Tue, 8 Jan 2019 12:35:11 +0000 (07:35 -0500)]
Merge pull request #3575 from LabNConsulting/working/master/no-bgp-attr-255

bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined

5 years agozebra: fix FreeBSD warning on fresh OS boot
Rafael Zalamena [Tue, 8 Jan 2019 12:32:28 +0000 (10:32 -0200)]
zebra: fix FreeBSD warning on fresh OS boot

Handle corner case where a warning log message is issued on interface
address netmask handling with sockaddr type AF_LINK: it may come empty
or with match all (all 0xFF).

In the first case all lengths are zero and we only need to copy the
first bytes, second case it comes with a zero index and all 0xFF bytes.

In any case we only need to figure out a few of the first bytes instead
of all data.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #3562 from donaldsharp/sharp_multiple_installs
Lou Berger [Tue, 8 Jan 2019 11:55:27 +0000 (06:55 -0500)]
Merge pull request #3562 from donaldsharp/sharp_multiple_installs

Sharp multiple installs

5 years agozebra: implement FreeBSD route attr handling
Rafael Zalamena [Tue, 8 Jan 2019 10:14:28 +0000 (08:14 -0200)]
zebra: implement FreeBSD route attr handling

When porting routing socket macro data handling to functions, the
attribute function was forgotten. The only difference between the
attribute and address handler is the family type check.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agodoc: Fix typos and grammar
Anand [Tue, 8 Jan 2019 04:41:14 +0000 (04:41 +0000)]
doc: Fix typos and grammar

Signed-off-by: Anand <anandakumar.u@gmail.com>
5 years agobgp_rfapi_basic_sanity_config2: delayed timeouts not supported without VNC attr
Lou Berger [Mon, 7 Jan 2019 22:16:37 +0000 (22:16 +0000)]
bgp_rfapi_basic_sanity_config2: delayed timeouts not supported without VNC attr

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agobgp_rfapi_basic_sanity: delayed timeouts not supported without VNC attr
Lou Berger [Mon, 7 Jan 2019 20:00:34 +0000 (20:00 +0000)]
bgp_rfapi_basic_sanity: delayed timeouts not supported without VNC attr

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agobgpd: Modify End of Rib notification to INFO
Donald Sharp [Sat, 22 Dec 2018 00:16:52 +0000 (19:16 -0500)]
bgpd: Modify End of Rib notification to INFO

The End of Rib notification in BGP is useful to know no matter
the circumstances.  So change this from a debug message to
an info and cleanup the message a bit and add vrf we are in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined
Lou Berger [Mon, 7 Jan 2019 16:32:54 +0000 (11:32 -0500)]
bgpd: don't use BGP_ATTR_VNC(255) unless ENABLE_BGP_VNC_ATTR is defined

Signed-off-by: Lou Berger <lberger@labn.net>
5 years agoMerge pull request #3572 from manuhalo/fix_isisd_p2p
Donald Sharp [Mon, 7 Jan 2019 14:26:38 +0000 (09:26 -0500)]
Merge pull request #3572 from manuhalo/fix_isisd_p2p

isisd: fix point-to-point network type config

5 years agoisisd: fix point-to-point network type config
Emanuele Di Pascale [Mon, 7 Jan 2019 11:29:29 +0000 (12:29 +0100)]
isisd: fix point-to-point network type config

`isis network point-to-point` was being rejected from the configuration
file as it was being processed before the reception of the UP zebra
notification for the interface. This meant that the `circ_type` was set
at CIRCUIT_T_UNKNOWN, which led the northbound callback to fail. This
check was removed as it was not really necessary; when the zebra
notification is received, the correct circuit type will be enforced,
but now the point-to-point config will be saved and correctly applied
when zebra recognizes the interface as a broadcast one.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>