]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
5 years agoMerge pull request #3679 from chiragshah6/evpn_dev2
Russ White [Tue, 5 Feb 2019 15:47:35 +0000 (10:47 -0500)]
Merge pull request #3679 from chiragshah6/evpn_dev2

zebra: reinstate bgp evpn remote route on local evpn route delete

5 years agoMerge pull request #3732 from qlyoung/fix-missing-backtic-doc
Renato Westphal [Tue, 5 Feb 2019 15:10:59 +0000 (13:10 -0200)]
Merge pull request #3732 from qlyoung/fix-missing-backtic-doc

doc: fix missing backtick

5 years agoMerge pull request #3698 from donaldsharp/netlink_is_serious_business
Renato Westphal [Tue, 5 Feb 2019 13:52:33 +0000 (11:52 -0200)]
Merge pull request #3698 from donaldsharp/netlink_is_serious_business

Netlink is serious business

5 years agoMerge pull request #3602 from donaldsharp/mlag_debug
David Lamparter [Mon, 4 Feb 2019 23:54:16 +0000 (00:54 +0100)]
Merge pull request #3602 from donaldsharp/mlag_debug

zebra cleanup and some mlag additions

5 years agoMerge pull request #3694 from qlyoung/fix-assegment-heap-uaf
David Lamparter [Mon, 4 Feb 2019 17:57:58 +0000 (18:57 +0100)]
Merge pull request #3694 from qlyoung/fix-assegment-heap-uaf

bgpd: fix as-path prepend heap uaf

5 years agodoc: fix missing backtick
Quentin Young [Mon, 4 Feb 2019 17:37:54 +0000 (17:37 +0000)]
doc: fix missing backtick

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #3714 from donaldsharp/thread_strlcpy
Mark Stapp [Thu, 31 Jan 2019 14:32:38 +0000 (15:32 +0100)]
Merge pull request #3714 from donaldsharp/thread_strlcpy

lib: snprintf to strlcpy in frr_pthread.c

5 years agozebra: Add ability to send to all clients updated capability information
Donald Sharp [Mon, 14 Jan 2019 16:08:19 +0000 (11:08 -0500)]
zebra: Add ability to send to all clients updated capability information

When capability information changes, allow for resending of data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Add hidden 'ip pim active-active` command
Donald Sharp [Mon, 14 Jan 2019 15:43:53 +0000 (10:43 -0500)]
pimd: Add hidden 'ip pim active-active` command

Add a command to track if an interface should be in active-active
mode or not.  This command is hidden at this time because it
is not finished fully.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add code to allow us to add debug for mlag
Donald Sharp [Fri, 11 Jan 2019 21:16:09 +0000 (16:16 -0500)]
zebra: Add code to allow us to add debug for mlag

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Add mlag information to zrouter
Donald Sharp [Fri, 11 Jan 2019 18:17:45 +0000 (13:17 -0500)]
zebra: Add mlag information to zrouter

Since this is zebra router global level information
store mlag data in the zrouter structure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Remove `struct zebra_t`
Donald Sharp [Fri, 11 Jan 2019 20:43:17 +0000 (15:43 -0500)]
zebra: Remove `struct zebra_t`

This structure is unused anymore and does not belong in zserv.h

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move packets_to_process to zrouter
Donald Sharp [Fri, 11 Jan 2019 20:35:45 +0000 (15:35 -0500)]
zebra: Move packets_to_process to zrouter

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move lsp_process_q to zrouter
Donald Sharp [Fri, 11 Jan 2019 20:33:20 +0000 (15:33 -0500)]
zebra: Move lsp_process_q to zrouter

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move the mq data structure to zrouter
Donald Sharp [Fri, 11 Jan 2019 20:30:57 +0000 (15:30 -0500)]
zebra: Move the mq data structure to zrouter

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move ribq from zebrad to zrouter
Donald Sharp [Fri, 11 Jan 2019 20:11:38 +0000 (15:11 -0500)]
zebra: Move ribq from zebrad to zrouter

The zrouter should own this data structure and it should not
be defined in zserv.h

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move rtm_table_default to zrouter
Donald Sharp [Fri, 11 Jan 2019 19:59:36 +0000 (14:59 -0500)]
zebra: Move rtm_table_default to zrouter

The zrouter should own this particular piece of data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Make zebrad.sock zserv.c private data
Donald Sharp [Fri, 11 Jan 2019 18:52:09 +0000 (13:52 -0500)]
zebra: Make zebrad.sock zserv.c private data

The zebra.sock data is the listener socket for the zapi protocol.
The rest of the zebra router does not need to see this data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move client_list to the zebra_router data structure
Donald Sharp [Fri, 11 Jan 2019 18:38:19 +0000 (13:38 -0500)]
zebra: Move client_list to the zebra_router data structure

The client_list should be owned by the zebra_router data structure
as that it is part of global state information.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Move the master thread handler to the zrouter structure
Donald Sharp [Fri, 11 Jan 2019 18:31:46 +0000 (13:31 -0500)]
zebra: Move the master thread handler to the zrouter structure

The master thread handler is really part of the zrouter structure.
So let's move it over to that.  Eventually zserv.h will only be
used for zapi messages.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: snprintf to strlcpy in frr_pthread.c
Donald Sharp [Thu, 31 Jan 2019 12:51:07 +0000 (07:51 -0500)]
lib: snprintf to strlcpy in frr_pthread.c

Convert to using strlcpy to erase those pesky little
gcc warnings->errors

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3699 from donaldsharp/zebra_rib_debugs
David Lamparter [Thu, 31 Jan 2019 00:51:52 +0000 (01:51 +0100)]
Merge pull request #3699 from donaldsharp/zebra_rib_debugs

Zebra Respect my authority

5 years agoRevert "include: Add linux header mroute.h to our build"
David Lamparter [Thu, 31 Jan 2019 00:35:42 +0000 (01:35 +0100)]
Revert "include: Add linux header mroute.h to our build"

This reverts commit 086841cf0bddebc21e72dcb24755c222ed29072c.

Oops, broke the build... shoulda waited for CI...

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #3713 from opensourcerouting/yang-embed-extensions-2
Donald Sharp [Thu, 31 Jan 2019 00:36:18 +0000 (19:36 -0500)]
Merge pull request #3713 from opensourcerouting/yang-embed-extensions-2

[master] yang: embed extensions (v2)

5 years agobuild: fix a whole bunch of *FLAGS
David Lamparter [Wed, 30 Jan 2019 17:11:54 +0000 (18:11 +0100)]
build: fix a whole bunch of *FLAGS

- some target_CFLAGS that needed to include AM_CFLAGS didn't do so
- libyang/sysrepo/sqlite3/confd CFLAGS + LIBS weren't used at all
- consistently use $(FOO_CFLAGS) instead of @FOO_CFLAGS@
- 2 dependencies were missing for clippy

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #3712 from donaldsharp/mroute_stuff
David Lamparter [Wed, 30 Jan 2019 17:30:48 +0000 (18:30 +0100)]
Merge pull request #3712 from donaldsharp/mroute_stuff

include: Add linux header mroute.h to our build

5 years agobuild, lib/yang: bake in extensions if possible (v2)
David Lamparter [Fri, 30 Nov 2018 20:42:25 +0000 (21:42 +0100)]
build, lib/yang: bake in extensions if possible (v2)

LIBS<>LDFLAGS was wrong on this one.

Fixes: 02a0df1f22c5cef8e4d3392d56e7db82da0d49cf
Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoinclude: Add linux header mroute.h to our build
Donald Sharp [Wed, 30 Jan 2019 17:28:35 +0000 (12:28 -0500)]
include: Add linux header mroute.h to our build

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3704 from donaldsharp/route_replace
Mark Stapp [Wed, 30 Jan 2019 16:09:52 +0000 (17:09 +0100)]
Merge pull request #3704 from donaldsharp/route_replace

zebra: On route update context is sometimes indeterminate in post-processing

5 years agozebra: On route update context is sometimes indeterminate in post-processing
Donald Sharp [Wed, 30 Jan 2019 14:31:32 +0000 (09:31 -0500)]
zebra: On route update context is sometimes indeterminate in post-processing

When we get into rib_process_result and the operation we are handling
is DPLANE_OP_ROUTE_UPDATE *and* the route entry being looked at
is a route replace, we currently have no way to decode to the old_re
and the re due to how we have stored context.  As such they are the
same pointer.

As such the route replace for the same route type is causing the re
to set the installed flag and then immediately unset the installed
flag, leaving us in a state where the kernel has the route but
the rib thinks we are not installed.

Since the true old_re( the one being replaced by the update operation )
is going away( as that it zebra deletes the old one for us already )
this fix is not optimal but will get us moving forward.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3690 from pguibert6WIND/detach_vrf_labels_del_bgp
Donald Sharp [Wed, 30 Jan 2019 12:36:57 +0000 (07:36 -0500)]
Merge pull request #3690 from pguibert6WIND/detach_vrf_labels_del_bgp

bgpd: detach vrf labels allocated, when removing bgp instance

5 years agozebra: When the kernel passes up a onlink route respect those flags
Donald Sharp [Wed, 30 Jan 2019 02:57:32 +0000 (21:57 -0500)]
zebra: When the kernel passes up a onlink route respect those flags

Read the onlink flag from the kernel for routes and pass them
up and through to zebra so that we are consistent with what
the kernel is telling us.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Trust kernel and System routes
Donald Sharp [Wed, 30 Jan 2019 02:45:02 +0000 (21:45 -0500)]
zebra: Trust kernel and System routes

If we receive a valid message from the kernel that
is either a kernel or system route, we should trust
that the route is legit and just use it.

Old behavior:

K * 172.22.0.0/15 [0/0] via 172.22.2.254, eva_dummy1 inactive, 00:00:16

New Behavior:

K>* 172.22.0.0/15 [0/0] via 172.22.2.254, eva_dummy1, 00:02:35

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Convert route entry id number to string in debugs
Donald Sharp [Wed, 30 Jan 2019 02:35:07 +0000 (21:35 -0500)]
zebra: Convert route entry id number to string in debugs

The route entry being displayed in debugs was displaying
the originating route type as a number.  While numbers
are cool, I for one am not terribly interested in
memorizing them.  Modify the (type %d) to a (%s) to
just list the string type of the route.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib, zebra: Fix 'show ip route' char collision
Donald Sharp [Wed, 30 Jan 2019 01:29:20 +0000 (20:29 -0500)]
lib, zebra: Fix 'show ip route' char collision

Apparently 'f' means both OpenFabric and a Failed kernel
route installation.

Let's switch the 'f' for the failed kernel route installation
to 'r - rejected route'.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: some v4 attributes were being written 2 times
Donald Sharp [Wed, 30 Jan 2019 01:17:36 +0000 (20:17 -0500)]
zebra: some v4 attributes were being written 2 times

When the nexthop->type is NEXTHOP_TYPE_IPV4_IFINDEX we
were writing the RTA_PREFSRC 2 times for the build_singlepath
and build_multipath functions.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: some v6 attributes were being written twice
Donald Sharp [Wed, 30 Jan 2019 01:07:49 +0000 (20:07 -0500)]
zebra: some v6 attributes were being written twice

Some v6 attributes for the netlink_route_build_singlepath
code were being written two times for the NEXTHOP_TYPE_IPV6_IFINDEX
nexthop type.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3414 from pguibert6WIND/iprule_any_flowspec_handling_2
Donald Sharp [Tue, 29 Jan 2019 19:01:38 +0000 (14:01 -0500)]
Merge pull request #3414 from pguibert6WIND/iprule_any_flowspec_handling_2

Iprule any flowspec handling

5 years agoMerge pull request #3692 from nitinsoniism/valgrind_errors_fix
David Lamparter [Tue, 29 Jan 2019 18:45:26 +0000 (19:45 +0100)]
Merge pull request #3692 from nitinsoniism/valgrind_errors_fix

bgpd: fix valgrind flagged errors

5 years agoMerge pull request #3691 from pguibert6WIND/debug_rule_fwmark
David Lamparter [Tue, 29 Jan 2019 16:38:11 +0000 (17:38 +0100)]
Merge pull request #3691 from pguibert6WIND/debug_rule_fwmark

zebra: add fwmark information at netlink level

5 years agoMerge pull request #3687 from donaldsharp/ifp_flags
Renato Westphal [Tue, 29 Jan 2019 16:35:09 +0000 (14:35 -0200)]
Merge pull request #3687 from donaldsharp/ifp_flags

zebra: Use the kernel flags from the IFA_FLAGS if it is available

5 years agobgpd: fix as-path prepend heap uaf
Quentin Young [Tue, 29 Jan 2019 16:13:39 +0000 (16:13 +0000)]
bgpd: fix as-path prepend heap uaf

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #3288 from nitinsoniism/show_intf_brief
David Lamparter [Tue, 29 Jan 2019 15:23:36 +0000 (16:23 +0100)]
Merge pull request #3288 from nitinsoniism/show_intf_brief

zebra: Support "brief" output for "show interface"

5 years agoMerge pull request #3681 from donaldsharp/onlink
Russ White [Tue, 29 Jan 2019 15:09:44 +0000 (10:09 -0500)]
Merge pull request #3681 from donaldsharp/onlink

*: The onlink attribute should be owned by the nexthop not the route.

5 years agoMerge pull request #3678 from chiragshah6/evpn_dev1
Russ White [Tue, 29 Jan 2019 15:05:50 +0000 (10:05 -0500)]
Merge pull request #3678 from chiragshah6/evpn_dev1

zebra: EVPN fix duplicate address detection remote macip add case

5 years agoMerge pull request #3659 from nitinsoniism/route_map_type_5_filter
Russ White [Tue, 29 Jan 2019 15:02:59 +0000 (10:02 -0500)]
Merge pull request #3659 from nitinsoniism/route_map_type_5_filter

bgpd: route-map fails to filter type-5 routes

5 years agoMerge pull request #3657 from nitinsoniism/ospf_mtu_crash
Russ White [Tue, 29 Jan 2019 14:58:53 +0000 (09:58 -0500)]
Merge pull request #3657 from nitinsoniism/ospf_mtu_crash

ospfd: ospfd core if hello packet exceeds link MTU

5 years agoMerge pull request #3653 from dslicenc/bgpd-remote-as
Russ White [Tue, 29 Jan 2019 14:58:02 +0000 (09:58 -0500)]
Merge pull request #3653 from dslicenc/bgpd-remote-as

bgpd: improve peer-group remote-as definitions

5 years agoMerge pull request #3616 from donaldsharp/route_notification
Russ White [Tue, 29 Jan 2019 14:55:41 +0000 (09:55 -0500)]
Merge pull request #3616 from donaldsharp/route_notification

Route notification

5 years agoMerge pull request #3395 from donaldsharp/bgp_interface
Russ White [Tue, 29 Jan 2019 14:38:16 +0000 (09:38 -0500)]
Merge pull request #3395 from donaldsharp/bgp_interface

Bgp interface

5 years agobgpd: fix valgrind flagged errors
Nitin Soni [Tue, 29 Jan 2019 14:29:57 +0000 (06:29 -0800)]
bgpd: fix valgrind flagged errors

Executed some evpn related tests with valgrind and saw some errors
related to uninitialized memory and overlapping memcpy. This commit
fixes those.

Ticket: CM-21218
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8249
5 years agoMerge pull request #3686 from qlyoung/fix-termtable-overflow
Renato Westphal [Tue, 29 Jan 2019 14:01:16 +0000 (12:01 -0200)]
Merge pull request #3686 from qlyoung/fix-termtable-overflow

lib: protect termtable from bad fmt string

5 years agoMerge pull request #3621 from donaldsharp/modules_doc_update
Renato Westphal [Tue, 29 Jan 2019 13:58:55 +0000 (11:58 -0200)]
Merge pull request #3621 from donaldsharp/modules_doc_update

doc: Update modules.rst to better represent what is needed

5 years agozebra: add fwmark information at netlink level
Philippe Guibert [Thu, 29 Nov 2018 14:22:27 +0000 (15:22 +0100)]
zebra: add fwmark information at netlink level

ip rule configuration is being equipped with extra log information for
fwmark information.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: display the list of iprules attached to a fs entry
Philippe Guibert [Fri, 30 Nov 2018 13:56:40 +0000 (14:56 +0100)]
bgpd: display the list of iprules attached to a fs entry

the list of iprules is displayed in the 'show bgp ipv4 flowspec detail'
The list of iprules is displayed, only if it is installed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: change priority of fs pbr rules
Philippe Guibert [Fri, 30 Nov 2018 13:13:37 +0000 (14:13 +0100)]
bgpd: change priority of fs pbr rules

two kind of rules are being set from bgp flowspec: ipset based rules,
and ip rule rules. default route rules may have a lower priority than
the other rules ( that do not support default rules). so, if an ipset
rule without fwmark is being requested, then priority is arbitrarily set
to 1. the other case, priority is set to 0.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: notify callback when ip rule from/to rule has been configured
Philippe Guibert [Thu, 29 Nov 2018 13:35:41 +0000 (14:35 +0100)]
bgpd: notify callback when ip rule from/to rule has been configured

because ip rule creation is used to not only handle traffic marked by
fwmark; but also for conveying traffic with from/to rules, a check of
the creation must be done in the linked list of ip rules.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: conversion from fs to pbr: support for ip rule from/to
Philippe Guibert [Thu, 29 Nov 2018 14:17:36 +0000 (15:17 +0100)]
bgpd: conversion from fs to pbr: support for ip rule from/to

adding/suppressing flowspec to pbr is supported. the add and the remove
code is being added. now,bgp supports the hash list of ip rule list.
The removal of bgp ip rule is done via search. The search uses the
action field. the reason is that when a pbr rule is added, to replace an
old one, the old one is kept until the new one is installed, so as to
avoid traffic to be cut. This is why at one moment, one can have two
same iprules with different actions. And this is why the algorithm
covers this case.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: ip rule zebra layer adapted to handle both cases
Philippe Guibert [Thu, 29 Nov 2018 14:14:41 +0000 (15:14 +0100)]
bgpd: ip rule zebra layer adapted to handle both cases

now, ip rule can be created from two differnt ways; however a single
zebra API has been defined. so make it consistent by adding a parameter
to the bgp zebra layer. the function will handle the rest.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: the fs entry is valid for any rule only, by using ipruleset cmd
Philippe Guibert [Thu, 29 Nov 2018 14:08:36 +0000 (15:08 +0100)]
bgpd: the fs entry is valid for any rule only, by using ipruleset cmd

Before, it was not possible to create any rules. Now, it is possible to
have flowspec rules relying only on ip rule command. The check is done
here.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: an hash list of pbr iprule is created
Philippe Guibert [Thu, 29 Nov 2018 14:12:03 +0000 (15:12 +0100)]
bgpd: an hash list of pbr iprule is created

that iprule list stands for the list of fs entries that are created,
based only on ip rule from/to rule.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: upon bgp fs study, determine if iprule can be used
Philippe Guibert [Thu, 29 Nov 2018 14:04:52 +0000 (15:04 +0100)]
bgpd: upon bgp fs study, determine if iprule can be used

instead of using ipset based mechanism to forward packets, there are
cases where it is possible to use ip rule based mechanisms (without
ipset). Here, this applies to simple fs rules with only 'from any' or
'to any'.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: remove useless fields in bgp_pbr_entry_main
Philippe Guibert [Thu, 29 Nov 2018 14:03:03 +0000 (15:03 +0100)]
bgpd: remove useless fields in bgp_pbr_entry_main

main bgp structure that contains fs information is being cleaned.
some fields are removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobgpd: detach vrf labels allocated, when removing bgp instance
Philippe Guibert [Mon, 28 Jan 2019 16:54:50 +0000 (17:54 +0100)]
bgpd: detach vrf labels allocated, when removing bgp instance

bgp instance is disabling the label allocated to reach vrf entity.
previously, only vrf disabling was removing the label. now, when bgp
leaves, bgp instance also frees the label used.

PR=62306
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Acked-by: Julien Floret <julien.floret@6wind.com>
5 years agozebra: Use the kernel flags from the IFA_FLAGS if it is available
Donald Sharp [Mon, 28 Jan 2019 21:14:03 +0000 (16:14 -0500)]
zebra: Use the kernel flags from the IFA_FLAGS if it is available

The ifa_flags value in the netlink message was originally a uint8_t
value.  The linux kernel quickly ran out of 8 bits of data to
pass and the IFA_FLAGS value was added to the netlink message to allow
more than 8 bits of data to be passed.  So replace the ifa_flags
with the IFA_FLAGS value if it exists in the interface netlink
message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: protect termtable from bad fmt string
Quentin Young [Mon, 28 Jan 2019 20:44:20 +0000 (20:44 +0000)]
lib: protect termtable from bad fmt string

Termtable can write out-of-bounds if given a format string with too many
column separators.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #3664 from opensourcerouting/yang-embed-extensions
Donald Sharp [Mon, 28 Jan 2019 15:38:56 +0000 (10:38 -0500)]
Merge pull request #3664 from opensourcerouting/yang-embed-extensions

yang: embed extensions

5 years agoMerge pull request #3680 from opensourcerouting/ospf6-fix-mcast
Donald Sharp [Mon, 28 Jan 2019 14:45:30 +0000 (09:45 -0500)]
Merge pull request #3680 from opensourcerouting/ospf6-fix-mcast

ospf6d: fix multicast join race on FreeBSD

5 years agoospfd: ospfd core if hello packet exceeds link MTU
Nitin Soni [Thu, 24 Jan 2019 08:44:42 +0000 (00:44 -0800)]
ospfd: ospfd core if hello packet exceeds link MTU

Ospfd cored because of an assert when we try to write more than the MTU
size to the ospf packet buffer stream. The problem is - we allocate only MTU
sized buffer. The expectation is that Hello packets are never large
enough to approach MTU. Instead of crashing, this fix discards hello and
logs an error. One should not have so many neighbors behind an
interface.

Ticket: CM-22380
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8204
5 years ago*: The onlink attribute should be owned by the nexthop not the route.
Donald Sharp [Sun, 27 Jan 2019 01:44:42 +0000 (20:44 -0500)]
*: The onlink attribute should be owned by the nexthop not the route.

The onlink attribute was being passed from upper level protocols
as an attribute of the route *not* the individual nexthop.  When
we pass this data to the kernel, we treat the onlink as a attribute
of the nexthop.  This commit modifies the code base to allow
us to pass the ONLINK attribute as an attribute of the nexthop.

This commit also fixes static routes that have multiple nexthops
some onlink and some not.

ip route 4.5.6.7/32 192.168.41.1 eveth1 onlink
ip route 4.5.6.7/32 192.168.42.2

S>* 4.5.6.7/32 [1/0] via 192.168.41.1, eveth1 onlink, 00:03:04
  *                  via 192.168.42.2, eveth2, 00:03:04

sharpd@robot ~/frr2> sudo ip netns exec EVA ip route show
4.5.6.7 proto 196 metric 20
nexthop via 192.168.41.1 dev eveth1 weight 1 onlink
nexthop via 192.168.42.2 dev eveth2 weight 1

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoospf6d: fix FreeBSD IPv6 multicast group join race
Rafael Zalamena [Sat, 26 Jan 2019 15:49:35 +0000 (13:49 -0200)]
ospf6d: fix FreeBSD IPv6 multicast group join race

Avoid a IPv6 multicast group join race by delaying the group install
before processing all event queue.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobgpd: interface based peers should automatically override it's peer group
Donald Sharp [Wed, 28 Nov 2018 23:46:36 +0000 (18:46 -0500)]
bgpd: interface based peers should automatically override it's peer group

When a interface based peer is setup and if it is part of a peer
group we should ignore this and just use the PEER_FLAG_CAPABILITY_ENHE
no matter what.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Fix crash in various 'show bgp neighbor json' commands
Donald Sharp [Wed, 28 Nov 2018 23:21:08 +0000 (18:21 -0500)]
bgpd: Fix crash in various 'show bgp neighbor json' commands

bgp would crash with various `show bgp neighbor json` commands
based upon whether or not it did a pretty print of the output
or not.  This is because we were freeing the data 2 times.
Cleanup so that we free the json data 1 time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Keep track of when routes are queued/dequeued from the dataplane
Donald Sharp [Tue, 15 Jan 2019 12:40:20 +0000 (07:40 -0500)]
zebra: Keep track of when routes are queued/dequeued from the dataplane

When we process the dataplane data, keep track of whether or not a route
is in transit or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Use ROUTE_ENTRY_INSTALLED as decision for route is installed
Donald Sharp [Mon, 14 Jan 2019 21:37:53 +0000 (16:37 -0500)]
zebra: Use ROUTE_ENTRY_INSTALLED as decision for route is installed

zebra is using NEXTHOP_FLAG_FIB as the basis of whether or not
a route_entry is installed.  This is problematic in that we plan
to separate out nexthop handling from route installation.  So modify
the code to keep track of whether or not a route_entry is installed/failed.

This basically means that every place we set/unset NEXTHOP_FLAG_FIB, we
actually also set/unset ROUTE_ENTRY_INSTALLED on the route_entry.
Additionally where we check for route installed via NEXTHOP_FLAG_FIB
switch over to checking if the route think's it is installed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib, zebra: Abstract character selection for nexthop display
Donald Sharp [Mon, 14 Jan 2019 21:32:26 +0000 (16:32 -0500)]
lib, zebra: Abstract character selection for nexthop display

When we are selecting nexthops for disply, abstract the notion
of what character we display to the end user about the status
of the nexthop.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Fix use before initialized
Donald Sharp [Tue, 15 Jan 2019 12:21:22 +0000 (07:21 -0500)]
zebra: Fix use before initialized

When we discover that a command given to the route add/delete
function in rt_socket.c is bogus, print out a debug message
but don't attempt to actually use a nexthop that we have not
figured out yet as part of the data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: Having one goto in a function to just return is silly
Donald Sharp [Tue, 15 Jan 2019 12:26:00 +0000 (07:26 -0500)]
zebra: Having one goto in a function to just return is silly

Just return right there, goto's are useful if you have common
code that needs to be cleaned up before exiting this function,
of which this function has none and there is only one goto.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agozebra: reinstate bgp route on local delete
Chirag Shah [Wed, 26 Dec 2018 23:05:15 +0000 (15:05 -0800)]
zebra: reinstate bgp route on local delete

Neigh detected duplicate detected during local update,
upon receiving kernel neigh delete, set neigh inactive
flag so BGPd can install remote route entry if present.

Only if freeze action enabled, local duplicate detected
entry will not be present in BGPd thus marking neigh
inactive is safe. BGPd will simply attempt install
remote entry if present.

Ticket:CM-23438
Testing Done:
Validated MAC-IP pair, trigger mobility of between two
VTEPs, upon local freeze perform neigh delete which
triggers BGP to install remote type-2 route into kernel.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agoMerge pull request #3614 from donaldsharp/connected_route_cost_fixes
Jafar Al-Gharaibeh [Fri, 25 Jan 2019 22:50:26 +0000 (17:50 -0500)]
Merge pull request #3614 from donaldsharp/connected_route_cost_fixes

Asundry EVPN fixes

5 years agozebra: fix dup addr detect remote macip add case
Chirag Shah [Thu, 24 Jan 2019 20:19:53 +0000 (12:19 -0800)]
zebra: fix dup addr detect remote macip add case

A MACIP is detected as duplicate and after that
the host continue to move behind different VTEPs results
in local VTEP receiving remote mobility events.
In remote_macip_add, ensure to trigger dad if
MAC is marked as duplicate. In case of freeze
action enabled, is_dup_detect will be set to
avoids installing frozen MAC into kernel.

Ticket:CM-23649
Testing Done:
Configured detection action freeze with detection count
as 7 at DUT and >7 at remote VTEP,
trigger MAC-IP mobility between VTEPs.
once tdetection count reached, MAC detected as duplicate,
post detection move the host to remote. The local VTEP
receives remote macip add and entry is not installed into
kernel with fix.

root@VTEP1:~# net show evpn mac vni 1002 mac aa:aa:aa:aa:aa:aa
MAC: aa:aa:aa:aa:aa:aa
Remote VTEP: 27.0.0.16
Local Seq: 7 Remote Seq: 8
Duplicate, detected at Fri Jan 25 05:03:29 2019
Neighbors:
11.11.11.11 Inactive

Kernel entry still points to LOCAL
root@VTEP1:~# bridge fdb show | grep aa:aa:aa
aa:aa:aa:aa:aa:aa dev hostbond3 vlan 1002 master VxLanA-1

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
5 years agozebra: display metric for connected routes
Anuradha Karuppiah [Mon, 14 Jan 2019 23:56:30 +0000 (15:56 -0800)]
zebra: display metric for connected routes

In a VRR/VRRP setup we can have connected routes with different costs.
So this change eliminates suppressing metric display for connected routes.

Sample output -
root@TORC11:~# vtysh -c "show ipv6 route vrf vrf1"
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR,
       > - selected route, * - FIB route

VRF vrf1:
K * ::/0 [255/8192] unreachable (ICMP unreachable), 00:00:36
C * 2001:aa:1::/64 [0/100] is directly connected, vlan1002-v0, 00:00:36
C>* 2001:aa:1::/64 [0/90] is directly connected, vlan1002, 00:00:36

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: set connected route metric based on the devaddr metric
Anuradha Karuppiah [Mon, 14 Jan 2019 23:45:33 +0000 (15:45 -0800)]
zebra: set connected route metric based on the devaddr metric

MACVLAN devices are typically used for applications such as VRR/VRRP that
require a second MAC address (virtual). These devices have a corresponding
SVI/VLAN device -
root@TORC11:~# ip addr show vlan1002
39: vlan1002@bridge: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9152 qdisc noqueue master vrf1 state UP group default
    link/ether 00:02:00:00:00:2e brd ff:ff:ff:ff:ff:ff
    inet6 2001:aa:1::2/64 scope global
       valid_lft forever preferred_lft forever
root@TORC11:~# ip addr show vlan1002-v0
40: vlan1002-v0@vlan1002: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9152 qdisc noqueue master vrf1 state UP group default
    link/ether 00:00:5e:00:01:01 brd ff:ff:ff:ff:ff:ff
    inet6 2001:aa:1::a/64 metric 1024 scope global
       valid_lft forever preferred_lft forever
root@TORC11:~#

The macvlan device is used primarily for RX (VR-IP/VR-MAC). And TX is via
the SVI. To acheive that functionality the macvlan network's metric
is set to a higher value.

Zebra currently ignores the devaddr metric sent by the kernel and hardcodes
it to 0. This commit eliminates that hardcoding. If the devaddr metric
is available (METRIC_MAX) it is used for setting up the connected route
otherwise we fallback to the dev/interface metric.

Setting the macvlan metric to a higher value ensures that zebra will always
select the connected route on the SVI (and subsequently use it for next hop
resolution etc.) -
root@TORC11:~# vtysh -c "show ip route vrf vrf1 2001:aa:1::/64"
Routing entry for 2001:aa:1::/64
  Known via "connected", distance 0, metric 1024, vrf vrf1
  Last update 11:30:56 ago
  * directly connected, vlan1002-v0

Routing entry for 2001:aa:1::/64
  Known via "connected", distance 0, metric 0, vrf vrf1, best
  Last update 11:30:56 ago
  * directly connected, vlan1002

root@TORC11:~#

Ticket: CM-23511
Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agobgpd: reinstate current bgp best route on an inactive neigh del
Anuradha Karuppiah [Mon, 14 Jan 2019 23:24:43 +0000 (15:24 -0800)]
bgpd: reinstate current bgp best route on an inactive neigh del

When an inactive-neigh delete is rxed bgp will not have a local path to
remove (and re-run path selection). Instead it simply re-installs the
current best remote path if any.

Ticket: CM-23018
Testing Done: evpn-min

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agozebra: propagate inactive neigh deletes to bgpd
Anuradha Karuppiah [Mon, 14 Jan 2019 23:19:48 +0000 (15:19 -0800)]
zebra: propagate inactive neigh deletes to bgpd

When a local neigh is added with a MAC that is remote or absent the
neigh is kept in zebra as local/in-active. But not propagated to bgpd.
Similarly when an inactive neigh is deleted the del-msg is not propagated
to bgpd.

Without this change bgp and zebra would fall out of sync as that
bgp would not know to rerun bestpath and for it to reinstall a
known remote path for the mac-ip in question.  To fix this we
now propagate inactive neigh deletes to bgpd.

Ticket: CM-23018
Testing Done:
1. evpn-min
2. manually triggered the out-of-sync state and verified the fix

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agobgpd: fill the zebra mac-ip route via a common api
Anuradha Karuppiah [Mon, 14 Jan 2019 23:10:42 +0000 (15:10 -0800)]
bgpd: fill the zebra mac-ip route via a common api

Move the info filling for zebra mac-ip install (sent by bgpd) to a
common place.

The commit also fixes missing ROUTER flag for one of the cases
added in a code branch that doesn't have the ROUTER changes -
[
6d8c603a
bgpd: use IP address as tie breaker if the MM seq number is the same
]

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
5 years agoMerge pull request #3675 from donaldsharp/pim_static_air
Jafar Al-Gharaibeh [Fri, 25 Jan 2019 19:13:39 +0000 (14:13 -0500)]
Merge pull request #3675 from donaldsharp/pim_static_air

Pim static air crash

5 years agopimd: Convert to using an ifindex_t for the vif
Donald Sharp [Fri, 25 Jan 2019 17:05:33 +0000 (12:05 -0500)]
pimd: Convert to using an ifindex_t for the vif

Let's stay consistent in the data type for the vif index

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agopimd: Prevent crash from using pim static mroutes
Donald Sharp [Fri, 25 Jan 2019 16:57:09 +0000 (11:57 -0500)]
pimd: Prevent crash from using pim static mroutes

If you have an interface being added to a static mroute
and that interface has been configured w/ pim but does
not have a valid ip address yet, we do not create a
VIF for that device yet.  As such when we attempt
to assign the vif array in the pim static data structure
we attempt to write into -1 of that array.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agodoc: fix mistaken indentation
Quentin Young [Fri, 25 Jan 2019 16:32:18 +0000 (16:32 +0000)]
doc: fix mistaken indentation

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #3668 from opensourcerouting/fix-file-and-syslog
Quentin Young [Thu, 24 Jan 2019 22:10:07 +0000 (17:10 -0500)]
Merge pull request #3668 from opensourcerouting/fix-file-and-syslog

[master] fix "log file" + "log syslog"

5 years agolib: don't disable "log file" on "log syslog"
David Lamparter [Thu, 24 Jan 2019 17:59:03 +0000 (18:59 +0100)]
lib: don't disable "log file" on "log syslog"

FRR log targets are independent, so "log syslog" must not disable
"log file" output.

Fixes: #3551
Fixes: 0204baa87630b210c71d9ae0e2569cff0fb0539b
Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agobuild, lib/yang: bake in extensions if possible
David Lamparter [Fri, 30 Nov 2018 20:42:25 +0000 (21:42 +0100)]
build, lib/yang: bake in extensions if possible

Starting with libyang 0.16.74, we can load internally embedded yang
extensions instead of going through the file system/dlopen.  Detect
support for this at build time and use if available.

NB: the fallback mechanism will go away in a short while.

Signed-off-by: David Lamparter <equinox@diac24.net>
5 years agoMerge pull request #3642 from donaldsharp/sequence
Mark Stapp [Thu, 24 Jan 2019 14:16:12 +0000 (09:16 -0500)]
Merge pull request #3642 from donaldsharp/sequence

zebra: Add code to track sequence number from zebra_router

5 years agozebra: Add code to track sequence number from zebra_router
Donald Sharp [Tue, 22 Jan 2019 12:39:14 +0000 (07:39 -0500)]
zebra: Add code to track sequence number from zebra_router

The sequence number used should be unique and increase by 1
for netlink commands.  This will allow the code to match
up batched commands to actual requests, so that we can signal
the failure correctly back.

So start the movement and tracking of sequence numbers as
an atomic uint32_t in zebra_router.  Modify the dataplane
code to start tracking contexts from this value.

In future commits we will move more of the sequencing
data into using this value.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3655 from rubenk/macos-fixes
David Lamparter [Thu, 24 Jan 2019 12:51:37 +0000 (13:51 +0100)]
Merge pull request #3655 from rubenk/macos-fixes

A few small build fixes for Mac OS

5 years agoMerge pull request #3658 from rubenk/fix-old-style-definitions
Donald Sharp [Thu, 24 Jan 2019 11:47:22 +0000 (06:47 -0500)]
Merge pull request #3658 from rubenk/fix-old-style-definitions

Treewide: use ANSI function definitions

5 years agoTreewide: use ANSI function definitions
Ruben Kerkhof [Thu, 24 Jan 2019 09:12:36 +0000 (10:12 +0100)]
Treewide: use ANSI function definitions

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
5 years agobgpd: route-map fails to filter type-5 routes
Nitin Soni [Thu, 24 Jan 2019 09:43:48 +0000 (01:43 -0800)]
bgpd: route-map fails to filter type-5 routes

Route-map filtering is based on the value of
"bgp->adv_cmd_rmap[afi][safi].map". For example, we advertise routes in
bgp_evpn_advertise_type5_routes() based on the value of
"bgp->adv_cmd_rmap[afi][safi].map". This variable gets populated in vty
handler bgp_evpn_advertise_type5. This variable will not get populated
if we have not yet applied the route-map configuration. The fix is to
correctly populate "bgp->adv_cmd_rmap[afi][safi].map" in
bgp_route_map_process_update() if it has not been populated before.

Ticket: CM-23263
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
Reviewed-by: CCR-8163
5 years agoMerge pull request #3508 from chiragshah6/evpn_dev2
Russ White [Wed, 23 Jan 2019 18:44:46 +0000 (13:44 -0500)]
Merge pull request #3508 from chiragshah6/evpn_dev2

zebra: EVPN remote entry delete check local entry presence