]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agoMerge pull request #2182 from qlyoung/docuser
Jafar Al-Gharaibeh [Wed, 9 May 2018 04:40:21 +0000 (23:40 -0500)]
Merge pull request #2182 from qlyoung/docuser

doc: remove duplicate option doc

6 years agoMerge pull request #2179 from qlyoung/fix-maximum-prefix-override
Russ White [Wed, 9 May 2018 00:07:32 +0000 (20:07 -0400)]
Merge pull request #2179 from qlyoung/fix-maximum-prefix-override

bgpd: fix maximum-prefix + peer-group

6 years agoMerge pull request #2173 from chiragshah6/ospfv3_dev
Russ White [Wed, 9 May 2018 00:03:48 +0000 (20:03 -0400)]
Merge pull request #2173 from chiragshah6/ospfv3_dev

ospf6d: fix area border router duplicate

6 years agoMerge pull request #2160 from donaldsharp/prefix_sid
Russ White [Tue, 8 May 2018 23:52:56 +0000 (19:52 -0400)]
Merge pull request #2160 from donaldsharp/prefix_sid

bgpd: Handle multiple PREFIX_SID's at a time.

6 years agoMerge pull request #2137 from mkanjari/evpn-addr-change
Russ White [Tue, 8 May 2018 23:50:33 +0000 (19:50 -0400)]
Merge pull request #2137 from mkanjari/evpn-addr-change

*: change struct evpn_addr to include a union of all evpn route types

6 years agoospf6d: Fix ABR brouter calculation corruption
Chirag Shah [Mon, 7 May 2018 17:16:08 +0000 (10:16 -0700)]
ospf6d: Fix ABR brouter calculation corruption

During Intra brouter calculation, brouters will be
marked for remove. if one of the brouter is removed,
as part of its remove callback, ospf6_abr_examin_summary
is performed where marked for brouter would be removed.
Since refcount of next brouter node still higher, it will
retain one node with dangled next brouter pointer.
When intra brouter calculation iteration goes to next node,
where accessing free node causes a crash.

Ticket:CM-20807
Testing Done:
Configure multilple ABR routers between area 0 and area x, y.
Remove ospf6 configuration on area x, y abrs and check area 0
Intra brouter calculations.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoospf6d: fix area border router duplicate
Chirag Shah [Fri, 4 May 2018 02:39:07 +0000 (19:39 -0700)]
ospf6d: fix area border router duplicate

Avoid duplicate ABR brouter entry and
its nexthops.
The route lookup results in first element of the
route/redix node. In case of Intra and inter area
brouter, the first element always intra brouter.
the first element comparison results in always addition
of new element for inter area brouter in brouter table.
Now, iterate all elements of the route node and compare
for brouter origin, if it is same simply update its
nexthops to FIB.

brouter and brouter route nexthops should be merge to avoid
duplicate nexthops for the inter area routes.

Ticket:CM-20807

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agoMerge pull request #2178 from pguibert6WIND/issue_2177
Donald Sharp [Tue, 8 May 2018 18:41:28 +0000 (14:41 -0400)]
Merge pull request #2178 from pguibert6WIND/issue_2177

pbrd: encode null fwmark to be consistent with zebra decode rule

6 years agoMerge pull request #2185 from opensourcerouting/isis-redist-metric-fix
Donald Sharp [Tue, 8 May 2018 18:10:02 +0000 (14:10 -0400)]
Merge pull request #2185 from opensourcerouting/isis-redist-metric-fix

isisd: use 0 as default-metric for redistribution

6 years agoisisd: use 0 as default-metric for redistribution
Christian Franke [Mon, 7 May 2018 11:46:03 +0000 (13:46 +0200)]
isisd: use 0 as default-metric for redistribution

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
6 years agodoc: remove duplicate option doc
Quentin Young [Mon, 7 May 2018 22:12:17 +0000 (18:12 -0400)]
doc: remove duplicate option doc

Earlier commit added docs on `--enable-multipath` but it was already
documented.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2181 from zefanxu-bsn/patch-1
Quentin Young [Mon, 7 May 2018 21:19:14 +0000 (17:19 -0400)]
Merge pull request #2181 from zefanxu-bsn/patch-1

Default hello interval is wrong

6 years agoDefault hello interval is wrong
Zefan Xu [Mon, 7 May 2018 21:16:42 +0000 (14:16 -0700)]
Default hello interval is wrong

6 years agobgpd: fix maximum-prefix + peer-group
Quentin Young [Mon, 7 May 2018 17:25:10 +0000 (13:25 -0400)]
bgpd: fix maximum-prefix + peer-group

Attribute set on peer was being overridden when set on the peer-group.

This commit also adds a parallel flags array that indicates whether a
particular flag is sourced from the peer-group or is peer-specific. It
assumes the default state of all flags is unset. This looks to be true
except in the case of PEER_FLAG_SEND_COMMUNITY,
PEER_FLAG_SEND_EXT_COMMUNITY, and PEER_FLAG_SEND_LARGE_COMMUNITY; these
flags are set by default except when the user specifies to use
config-type = cisco. However the flag field can merely be flipped to
mean the negation of those options in a future commit.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agopbrd: encode null fwmark to be consistent with zebra decode rule
Philippe Guibert [Mon, 7 May 2018 16:59:41 +0000 (18:59 +0200)]
pbrd: encode null fwmark to be consistent with zebra decode rule

A null 4-byte long fwmark is encoded in pbr rule.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agoMerge pull request #2156 from donaldsharp/zebra_doc
Renato Westphal [Mon, 7 May 2018 15:18:14 +0000 (12:18 -0300)]
Merge pull request #2156 from donaldsharp/zebra_doc

doc: Explain ecmp building and startup for zebra

6 years agoMerge pull request #2166 from qlyoung/docuser
Renato Westphal [Mon, 7 May 2018 15:15:18 +0000 (12:15 -0300)]
Merge pull request #2166 from qlyoung/docuser

doc: add figures & fix some typos in arch. docs

6 years agoMerge pull request #2175 from chiragshah6/mdev
Renato Westphal [Mon, 7 May 2018 15:08:16 +0000 (12:08 -0300)]
Merge pull request #2175 from chiragshah6/mdev

ospf6d: add newline to show debugging cmd

6 years agoospf6d: add newline to show debugging cmd
Chirag Shah [Sat, 5 May 2018 22:38:11 +0000 (15:38 -0700)]
ospf6d: add newline to show debugging cmd

Ticket:CM-20738
Testing Done:
Before:
OSPF6 debugging status:debug ospf6 lsa inter-router examine
debug ospf6 lsa as-external examine
debug ospf6 route memory
debug ospf6 border-routers

After:
OSPF6 debugging status:
debug ospf6 lsa inter-router examine
debug ospf6 lsa as-external examine
debug ospf6 route memory
debug ospf6 border-routers

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agodoc: Explain ecmp building and startup for zebra
Donald Sharp [Tue, 1 May 2018 22:02:51 +0000 (18:02 -0400)]
doc: Explain ecmp building and startup for zebra

Explain the --enable-ecmp=X configure option as well as
modify the zebra user doc to explain the -e X option.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2169 from piotrjurkiewicz/eigrp_feasibility
Donald Sharp [Fri, 4 May 2018 03:02:36 +0000 (23:02 -0400)]
Merge pull request #2169 from piotrjurkiewicz/eigrp_feasibility

eigrpd: Consider only feasible successors as successors

6 years agoMerge pull request #2167 from piotrjurkiewicz/master
Donald Sharp [Fri, 4 May 2018 01:58:10 +0000 (21:58 -0400)]
Merge pull request #2167 from piotrjurkiewicz/master

eigrpd: Correctly calculate EIGRP packet MTU

6 years agoeigrpd: Consider only feasible successors as successors
Piotr Jurkiewicz [Fri, 4 May 2018 00:28:29 +0000 (02:28 +0200)]
eigrpd: Consider only feasible successors as successors

Meeting the feasibility condition is required also for routes
meeting the variance condition.

Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
6 years agoeigrpd: Use EIGRP_PACKET_MTU(mtu) macro
Piotr Jurkiewicz [Thu, 3 May 2018 20:07:54 +0000 (22:07 +0200)]
eigrpd: Use EIGRP_PACKET_MTU(mtu) macro

Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
6 years agoeigrpd: Correctly calculate EIGRP packet MTU
Piotr Jurkiewicz [Thu, 3 May 2018 18:17:21 +0000 (20:17 +0200)]
eigrpd: Correctly calculate EIGRP packet MTU

Someone forgot that EIGRP packets are encapsulated in IP.

Signed-off-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
6 years agodoc: add figures & fix some typos in arch. docs
Quentin Young [Thu, 3 May 2018 16:31:06 +0000 (12:31 -0400)]
doc: add figures & fix some typos in arch. docs

Found some old design documentation I wrote up and stole the figures.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2158 from donaldsharp/timeouts
Jafar Al-Gharaibeh [Thu, 3 May 2018 14:45:04 +0000 (09:45 -0500)]
Merge pull request #2158 from donaldsharp/timeouts

redhat, tools: Increase startup time out a bit

6 years agoMerge pull request #2164 from donaldsharp/pbr_nht_eats_gcc
Jafar Al-Gharaibeh [Thu, 3 May 2018 14:44:15 +0000 (09:44 -0500)]
Merge pull request #2164 from donaldsharp/pbr_nht_eats_gcc

pbrd: Fix nearly impossible truncation

6 years agoMerge pull request #2146 from qlyoung/docuser
Jafar Al-Gharaibeh [Thu, 3 May 2018 14:42:46 +0000 (09:42 -0500)]
Merge pull request #2146 from qlyoung/docuser

doc: add documentation on threading & process arch

6 years agoMerge pull request #2161 from donaldsharp/zebra_improved_out
Jafar Al-Gharaibeh [Thu, 3 May 2018 14:41:12 +0000 (09:41 -0500)]
Merge pull request #2161 from donaldsharp/zebra_improved_out

zebra: Add a few more breadcrumbs

6 years agoMerge pull request #2159 from donaldsharp/msdp_crash
Jafar Al-Gharaibeh [Thu, 3 May 2018 14:40:23 +0000 (09:40 -0500)]
Merge pull request #2159 from donaldsharp/msdp_crash

pimd: Fix some msdp crashes when some fundamentals change

6 years agoMerge pull request #2143 from donaldsharp/pimaroni
Jafar Al-Gharaibeh [Thu, 3 May 2018 14:39:55 +0000 (09:39 -0500)]
Merge pull request #2143 from donaldsharp/pimaroni

Pimaroni

6 years ago*: change struct evpn_addr to include a union of all evpn route types
mitesh [Fri, 13 Apr 2018 22:37:30 +0000 (15:37 -0700)]
*: change struct evpn_addr to include a union of all evpn route types

EVPN prefix depends on the EVPN route type.
Currently, in FRR we have a prefix_evpn/evpn_addr which relates to a evpn prefix.
We need to convert this to encompass an union of various EVPN route-types.

This diff handles the necessary code changes to adopt the new struct evpn_addr.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agopbrd: Fix nearly impossible truncation
Donald Sharp [Thu, 3 May 2018 00:12:31 +0000 (20:12 -0400)]
pbrd: Fix nearly impossible truncation

Since we are writing into the name field which is PBR_MAP_NAMELEN
size, we are expecting this to field to be at max 100 bytes.
Newer compilers understand that the %s portion may be up to
100 bytes( because of the size of the string.  The %u portion
is expected to be 10 bytes.  So in `theory` there are situations
where we might truncate.  The reality this is never going to
happen( who is going to create a nexthop group name that is
over say 30 characters? ).  As such we are expecting the
calling function to subtract 10 from the size_t l before
we pass it in to get around this new gcc fun.

Fixes: #2163
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2141 from chiragshah6/ospfv3_dev
Russ White [Wed, 2 May 2018 22:55:56 +0000 (18:55 -0400)]
Merge pull request #2141 from chiragshah6/ospfv3_dev

ospf6d: fix intra prefix ecmp

6 years agoMerge pull request #2073 from pguibert6WIND/bgp_fs_pbr
Russ White [Wed, 2 May 2018 22:54:11 +0000 (18:54 -0400)]
Merge pull request #2073 from pguibert6WIND/bgp_fs_pbr

Bgp Flowspec Policy Based Routing

6 years agotests: Add a prefix-sid test
Donald Sharp [Wed, 2 May 2018 22:46:18 +0000 (18:46 -0400)]
tests: Add a prefix-sid test

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Handle multiple PREFIX_SID's at a time.
Donald Sharp [Wed, 2 May 2018 18:03:39 +0000 (14:03 -0400)]
bgpd: Handle multiple PREFIX_SID's at a time.

Handle multiple PREFIX_SID's at the same time.  The draft clearly
states that multiple should be handled and we have a actual pcap
file that clearly has multiple PREFIX_SID's at the same time.

Fixes: #2153
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Add a few more breadcrumbs
Donald Sharp [Wed, 2 May 2018 20:50:37 +0000 (16:50 -0400)]
zebra: Add a few more breadcrumbs

re->status and re->flags both influence our decision states
for rib processing.  Yet it's impossible to see them.  Add
a tiny bit of code to allow us to look at them when things
are not behaving like we would expect.

Additionally dump the nexthop->flags at the same time for
the same reasons.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2154 from dslicenc/hostname-fix
Russ White [Wed, 2 May 2018 18:23:46 +0000 (14:23 -0400)]
Merge pull request #2154 from dslicenc/hostname-fix

lib: allow hostname to begin with a letter or number

6 years agoconfigure: Update version to 5.1-dev frr-5.1-dev
Martin Winter [Wed, 2 May 2018 14:28:39 +0000 (07:28 -0700)]
configure: Update version to 5.1-dev

We are now working on 5.1-dev for new work.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoMerge pull request #2157 from donaldsharp/zebra_zebra_zebra
Martin Winter [Wed, 2 May 2018 11:16:28 +0000 (04:16 -0700)]
Merge pull request #2157 from donaldsharp/zebra_zebra_zebra

zebra: Fix crash on *BSD

6 years agopimd: Fix some msdp crashes when some fundamentals change
Donald Sharp [Mon, 30 Apr 2018 21:33:16 +0000 (17:33 -0400)]
pimd: Fix some msdp crashes when some fundamentals change

When the underlying networking subsystem is fundamentally
changed via some system controls.  If we have msdp running
there exists a possibility that we need to stop some running
timers to prevent a crash.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoredhat, tools: Increase startup time out a bit
Donald Sharp [Wed, 2 May 2018 03:35:53 +0000 (23:35 -0400)]
redhat, tools: Increase startup time out a bit

We have run across a few cases where the startup timeout is
ocurring on heavily loaded systems.  This is especially true
in simulation environments where the hypervisor load is
extremely high.

Modify the code base to give ourselves more time to startup.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Fix crash on *BSD
Donald Sharp [Wed, 2 May 2018 03:24:53 +0000 (23:24 -0400)]
zebra: Fix crash on *BSD

The zns->ns pointer is not created until we get a callback
from the kernel that a ns exists.  This should potentially
fix a crash in the *BSD code path.

Fixes: #2152
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoospf6d: fix intra prefix ecmp
Chirag Shah [Mon, 23 Apr 2018 22:21:33 +0000 (15:21 -0700)]
ospf6d: fix intra prefix ecmp

When there are multiple advertisers/paths to reach
Intra-Prefix route, if any path is removed,
re-added back, it does add to the same route node.

ospf6 intra prefix, first stored in oa->route_table
then as part of add cb, it would add to ospf6->route_table
which adds to FIB.

When copying a route with its paths & NHs from oa->table to
ospf6->table the path origin should not be modified otherwise
ospf6->table would not find existing node rather it appends
new node.

Use spf_table to fetch nexthops for a given advertisers/path,
to form effective nexthop list for a route.

Ticket:CM-16139
Testing Done:
    R2 ---- R3
     |       |
    R1 ---- R4
Inject Intra Ara Prefix LSA from R1 & R3, validate R2 and R4
having two origination point/paths to reach for a route.
Trigger link flap, frr restart or remove/readd R3's INP one of the
injection point.
Remove link between R4 to R1 and validate R3 carrying single
path to reach prefix.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agolib: allow hostname to begin with a letter or number
Don Slice [Tue, 1 May 2018 21:13:51 +0000 (21:13 +0000)]
lib: allow hostname to begin with a letter or number

Customers have requested the ability to name their devices starting
with a number instead of a letter.  This fix changes the check for
hostname to allow either a letter or a number.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoMerge pull request #2148 from opensourcerouting/snapupdate
Lou Berger [Tue, 1 May 2018 16:15:42 +0000 (12:15 -0400)]
Merge pull request #2148 from opensourcerouting/snapupdate

Update SNAP Package to add EIGRP, Babel and PRD

6 years agoMerge pull request #2119 from qlyoung/fix-vtysh-no-write-config
Lou Berger [Tue, 1 May 2018 15:51:28 +0000 (11:51 -0400)]
Merge pull request #2119 from qlyoung/fix-vtysh-no-write-config

vtysh: fix failure to write config w/o watchfrr

6 years agoMerge pull request #2140 from donaldsharp/sharp_doc
Lou Berger [Tue, 1 May 2018 15:15:59 +0000 (11:15 -0400)]
Merge pull request #2140 from donaldsharp/sharp_doc

doc: Add some documentation for the sharp daemon

6 years agosnapcraft: Add PBR daemon to snap package
Martin Winter [Tue, 1 May 2018 01:53:18 +0000 (18:53 -0700)]
snapcraft: Add PBR daemon to snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agosnapcraft: Add eigrp daemon to snap package
Martin Winter [Tue, 1 May 2018 01:29:16 +0000 (18:29 -0700)]
snapcraft: Add eigrp daemon to snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agosnapcraft: Add babel daemon to snap package
Martin Winter [Tue, 1 May 2018 01:03:53 +0000 (18:03 -0700)]
snapcraft: Add babel daemon to snap package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agobabeld: fix cli option to override config file (-f)
Martin Winter [Tue, 1 May 2018 01:02:27 +0000 (18:02 -0700)]
babeld: fix cli option to override config file (-f)

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agoMerge pull request #2139 from donaldsharp/map
Renato Westphal [Tue, 1 May 2018 00:50:17 +0000 (21:50 -0300)]
Merge pull request #2139 from donaldsharp/map

Map

6 years agodoc: add documentation on threading & process arch
Quentin Young [Mon, 30 Apr 2018 23:54:40 +0000 (19:54 -0400)]
doc: add documentation on threading & process arch

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agosnapcraft: Fix missing runtime lib dependencies
Martin Winter [Mon, 30 Apr 2018 23:45:31 +0000 (16:45 -0700)]
snapcraft: Fix missing runtime lib dependencies

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
6 years agodoc: Add some documentation for the sharp daemon
Donald Sharp [Mon, 30 Apr 2018 00:35:02 +0000 (20:35 -0400)]
doc: Add some documentation for the sharp daemon

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2045 from LabNConsulting/working/master/nh-vrf-in-bgp-show
Renato Westphal [Mon, 30 Apr 2018 19:33:42 +0000 (16:33 -0300)]
Merge pull request #2045 from LabNConsulting/working/master/nh-vrf-in-bgp-show

bgpd: when showing routes, add nexthop vrf and announce-self flag

6 years agopimd: Remove expensive lookup for if a device is a vrf device
Donald Sharp [Mon, 30 Apr 2018 11:56:24 +0000 (07:56 -0400)]
pimd: Remove expensive lookup for if a device is a vrf device

Interfaces know if they are a vrf device or not and this data
is passed up to the protocol.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Cleanup pim_if_is_loopback
Donald Sharp [Mon, 30 Apr 2018 11:50:08 +0000 (07:50 -0400)]
pimd: Cleanup pim_if_is_loopback

The interface itself knows if it is a vrf device or
not, so let's just use a check for that in the decision
if a interface is a loopback or not.

Additionally modify function to return a bool.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agovtysh: add bgp_flowspec_vty to Makefile.am
Philippe Guibert [Wed, 25 Apr 2018 07:24:00 +0000 (09:24 +0200)]
vtysh: add bgp_flowspec_vty to Makefile.am

In order to be able to configure flowspec from vtysh, the bgp_vty
flowspec file is added into vtysh files to parse.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: handle bgp pbr hash list destroy upon BGP destroy
Philippe Guibert [Tue, 24 Apr 2018 14:35:00 +0000 (16:35 +0200)]
bgpd: handle bgp pbr hash list destroy upon BGP destroy

Upon BGP destroy, the hash list related to PBR are removed.
The pbr_match entries, as well as the contained pbr_match_entries
entries.
Then the pbr_action entries. The order is important, since the former
are referencing pbr_action. So the references must be removed, prior to
remove pbr action.
Also, the zebra associated contexts are removed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: rewiew bgp pbr log messages with debug bgp pbr
Philippe Guibert [Wed, 18 Apr 2018 15:49:25 +0000 (17:49 +0200)]
bgpd: rewiew bgp pbr log messages with debug bgp pbr

log messages are now guarded with debug bgp pbr.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add pbr error flag for pbr errors
Philippe Guibert [Wed, 18 Apr 2018 15:46:49 +0000 (17:46 +0200)]
bgpd: add pbr error flag for pbr errors

Some errors messages were not guarded. now those log messages
are guarded.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: handle FS redirect VRF rule in PBR
Philippe Guibert [Tue, 17 Apr 2018 16:32:49 +0000 (18:32 +0200)]
bgpd: handle FS redirect VRF rule in PBR

Upon redirect VRF message from FS, add a default route to the VRF
interface associated to the VRF.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: get table identifier from table manager
Philippe Guibert [Tue, 3 Apr 2018 13:06:50 +0000 (15:06 +0200)]
bgpd: get table identifier from table manager

A table chunk of 100000 is allocated from zebra, and when needed in
flowspec, the table identifier is extracted from that chunk.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: handle FS redirect IP rule in PBR
Philippe Guibert [Wed, 28 Mar 2018 12:51:57 +0000 (14:51 +0200)]
bgpd: handle FS redirect IP rule in PBR

If a new rule is identified, a new table identifier is created.
In that table, add a default route when possible. If redirect IP rule is
identified, then add a default route to that IP address.
If redirect VRF is identified, nothing is done for now

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: allow flowspec entries to be announced to zebra
Philippe Guibert [Fri, 26 Jan 2018 17:36:24 +0000 (18:36 +0100)]
bgpd: allow flowspec entries to be announced to zebra

Flowspec entries are allowed to be announced.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: hash lookup for iprule entries
Philippe Guibert [Mon, 12 Mar 2018 14:11:33 +0000 (15:11 +0100)]
bgpd: hash lookup for iprule entries

once an iprule has been created, a notification is sent back, and the
context of bgp_action is searched.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: hash lookup for ipset and ipset entries
Philippe Guibert [Mon, 12 Mar 2018 14:02:57 +0000 (15:02 +0100)]
bgpd: hash lookup for ipset and ipset entries

relevant structures, after being written to zebra, are lookup up with
their identifiers.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: hash_lookup for iptables
Philippe Guibert [Mon, 12 Mar 2018 11:56:06 +0000 (12:56 +0100)]
bgpd: hash_lookup for iptables

This commit is reading the installed2 value from bgp_pbr_match hash set.
Once value matches with the one received, the walk stops and the last
bgp_pbr_match structure is stored in a static entry, so that the entry
is obtained.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: inject policy route entry from bgp into zebra pbr entries.
Philippe Guibert [Thu, 15 Mar 2018 15:06:59 +0000 (16:06 +0100)]
bgpd: inject policy route entry from bgp into zebra pbr entries.

Once the bgp flowspec entry is validated, then that means that zebra is
able to handle the entries.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: handle configuration of iptables with zebra
Philippe Guibert [Mon, 12 Mar 2018 08:38:53 +0000 (09:38 +0100)]
bgpd: handle configuration of iptables with zebra

The API for filling in an IPTABLE_ADD and IPTABLE_DELETE message.
Also, the API is handling the notification callback, so as to know if
zebra managed to add or delete the relevant iptable entry.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add function handling flowspec entries to pass to zebra
Philippe Guibert [Thu, 8 Mar 2018 18:16:03 +0000 (19:16 +0100)]
bgpd: add function handling flowspec entries to pass to zebra

Add a policy-route API to handle flowspec entry.
The entry is analysed, converted, and
selected if it is possible to inject the flowspec entry in local policy
routing entries.
redirect IP and redirect VRF actions are handled. The former extracts
the IPv4 address to redirect traffic to. The latter calculates the
matching VRF to redirect traffic to.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: utility routine to convert flowspec actions into pbr actions
Philippe Guibert [Thu, 8 Mar 2018 18:13:44 +0000 (19:13 +0100)]
bgpd: utility routine to convert flowspec actions into pbr actions

This utility routine in bgp ecommunity converts the flowspec actions
into a readable format in a policy routing action context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add convert function from flowspec to pbr match
Philippe Guibert [Thu, 8 Mar 2018 18:11:39 +0000 (19:11 +0100)]
bgpd: add convert function from flowspec to pbr match

This utility function analyses flowspec nlri and converts it into
readable structures. The structure is based on bgp_pbr_match structure
previously defined.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add bgp_pbr_route structure
Philippe Guibert [Thu, 8 Mar 2018 16:41:15 +0000 (17:41 +0100)]
bgpd: add bgp_pbr_route structure

This structure is the model exchange between some bgp services like
flowspec and the policy routing service. This structure reflects what
the nlri entry means. To handle that structure, a dump routine is made
available. Also, a validation function is here to cancel a policy route
installation, whenever it is not possible to install the requested
policy routing.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: add [no] debug bgp pbr vty command
Philippe Guibert [Fri, 9 Mar 2018 09:02:25 +0000 (10:02 +0100)]
bgpd: add [no] debug bgp pbr vty command

This command is used to troubleshoot the routes that are installed inbgp
pbr fib, before being injected in zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: initialise hash lists for pbr
Philippe Guibert [Thu, 8 Mar 2018 16:23:02 +0000 (17:23 +0100)]
bgpd: initialise hash lists for pbr

bgp structure is being extended with hash sets that will be used by
flowspec to give policy routing facilities.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: communication with zebra for ipset & iprule handling
Philippe Guibert [Thu, 8 Mar 2018 14:39:19 +0000 (15:39 +0100)]
bgpd: communication with zebra for ipset & iprule handling

The APIs that handle ipset and iprule contexts from zebra are being
handled in this commit.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agobgpd: support for policy-routing context used with flowspec
Philippe Guibert [Thu, 8 Mar 2018 14:37:06 +0000 (15:37 +0100)]
bgpd: support for policy-routing context used with flowspec

BGP flowspec will be able to inject or remove policy-routing contexts,
thanks to some protocols like flowspec. This commit adds some the APIS
necessary to create/delete policy routing contexts that will be injected
then into zebra.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
6 years agovtysh: fix failure to write config w/o watchfrr
Quentin Young [Wed, 25 Apr 2018 19:09:02 +0000 (15:09 -0400)]
vtysh: fix failure to write config w/o watchfrr

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agolib: Convert internal sequence number to int64_t
Donald Sharp [Sun, 29 Apr 2018 16:40:12 +0000 (12:40 -0400)]
lib: Convert internal sequence number to int64_t

With the usage of a 32 bit number as a integer, but storing
non-signed values in it, we have cases where numbers greater
than 2 billion are being read in and stored and used before
lower value numbers, which of course is awful and mean.

Fixes: #2126
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: convert plist data structures to using a bool
Donald Sharp [Sun, 29 Apr 2018 00:39:20 +0000 (20:39 -0400)]
lib: convert plist data structures to using a bool

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2134 from donaldsharp/zzz-top
Lou Berger [Sun, 29 Apr 2018 12:50:52 +0000 (08:50 -0400)]
Merge pull request #2134 from donaldsharp/zzz-top

Clean up some issues found

6 years agolib: Convert true/false values to bool
Donald Sharp [Sat, 28 Apr 2018 23:52:41 +0000 (19:52 -0400)]
lib: Convert true/false values to bool

route_maps are using some int's as true/false so
let's convert them over to a bool.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: when showing routes, add nexthop vrf and announce-self flag
G. Paul Ziemba [Mon, 9 Apr 2018 20:28:11 +0000 (13:28 -0700)]
bgpd: when showing routes, add nexthop vrf and announce-self flag

As part of recent vpn-vrf leaking changes, it is now possible for a
route to refer to a nexthop in a different vrf. There is also a new
route flag that means "when announcing this route, indicate myself
as the next-hop."

route_vty_out(): nexthops are appended with:

    "@VRFID" (where VRFID is the numerical vrf id) when different from
    the route's vrf;

    "<" when the route's BGP_INFO_ANNC_NH_SELF is set

This change also shows the route table's vrf id in the table header.

route_vty_out_detail(): show nexthop's vrf and announce-nh-self flag if
appropriate.

Both functions are also augmented to add json elements nhVrfId, nhVrfName,
and announceNexthopSelf as appropriate.

The intent of these changes is to make it easier to understand/debug
the relationship between a route and its nexthops.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
6 years ago*: Move sharpd from developmental build to have to explicity enable it
Donald Sharp [Fri, 27 Apr 2018 19:18:41 +0000 (15:18 -0400)]
*: Move sharpd from developmental build to have to explicity enable it

sharpd has started to see some use from our field engineers as
well as people attempting to build/test their environments
as a way of easily injecting a large number of routes.

Modify configure.ac to move sharpd from a development build
option to having to explicity enable it via `--enable-sharpd=yes`
in order for it to be built.

This will allow those who want to build it, to build it without
having to use the development build option.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years ago*: Actually allow end users to not build pbrd
Donald Sharp [Fri, 27 Apr 2018 19:04:40 +0000 (15:04 -0400)]
*: Actually allow end users to not build pbrd

The building of pbrd from a configure compile option
was not properly setup.  This should do that.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agotools: Cleanup code to handle sharp and pbr a bit better
Donald Sharp [Fri, 27 Apr 2018 18:58:56 +0000 (14:58 -0400)]
tools: Cleanup code to handle sharp and pbr a bit better

The sharp and pbr protocols needed a bit more handling
to be 'right' from a start/stop perspective.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Add PBR and SHARP handling
Donald Sharp [Fri, 27 Apr 2018 18:53:46 +0000 (14:53 -0400)]
zebra: Add PBR and SHARP handling

We are missing some handling of PBR and SHARP protocols
for netlink operations w/ the linux kernel.

Additionally add a bread crumb for new developers( or existing )
to know to fixup the rt_netlink.c when we start handling new
route types to hand to the kernel.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoMerge pull request #2125 from qlyoung/fix-gcc-build-command-graph
Renato Westphal [Thu, 26 Apr 2018 19:47:15 +0000 (16:47 -0300)]
Merge pull request #2125 from qlyoung/fix-gcc-build-command-graph

lib: fix clippy build w/ gcc under certain configs

6 years agoMerge pull request #2120 from qlyoung/fix-stream-fifo-heap-corruption
Renato Westphal [Thu, 26 Apr 2018 16:37:25 +0000 (13:37 -0300)]
Merge pull request #2120 from qlyoung/fix-stream-fifo-heap-corruption

lib: fix heap corruption in stream_fifo_free

6 years agolib: fix clippy build w/ gcc under certain configs
Quentin Young [Thu, 26 Apr 2018 16:31:45 +0000 (12:31 -0400)]
lib: fix clippy build w/ gcc under certain configs

GCC's linker driver sometimes gets confused when building clippy.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2048 from donaldsharp/vrf_2_vrf
Lou Berger [Thu, 26 Apr 2018 15:43:18 +0000 (11:43 -0400)]
Merge pull request #2048 from donaldsharp/vrf_2_vrf

Vrf 2 vrf

6 years agolib: fix heap corruption in stream_fifo_free
Quentin Young [Wed, 25 Apr 2018 21:16:55 +0000 (17:16 -0400)]
lib: fix heap corruption in stream_fifo_free

When popping a stream from a stream_fifo, the stream->next pointer is
not NULL'd out. If this same stream is subsequently pushed onto a
stream_fifo (either the same one or a different one), because
stream_fifo's use tail insertion the ->next pointer is not updated and
thus will point to whatever the next stream in the first stream_fifo
was. stream_fifo_free does not check the count of the stream_fifo when
freeing its constituent elements, and instead walks the linked list.
Consequently it will continue walking into the first stream_fifo from
which the last stream was popped, freeing each stream contained there.
This leads to use-after-free errors.

This patch makes sure to set the ->next pointer to NULL when doing tail
insertion in stream_fifo_push and when popping a stream from a
stream_fifo.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agobgpd: Prevent vrf 2 vrf route leaking from going offbox.
Donald Sharp [Wed, 25 Apr 2018 14:23:22 +0000 (10:23 -0400)]
bgpd: Prevent vrf 2 vrf route leaking from going offbox.

The vrf 2 vrf route leaking auto-derives RD and RT and
installs the routes into the appropriate vpn table.
These routes when a operator configured ipv[4|6] vpn
neighbors were showing up off box.  The RD and RT
values choosen are localy significant but globaly
useless and may cause confusion.

Put a special bit of code in to notice that we
should not be advertising these routes off box.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: Fixup doc for vrf-2-vrf as per suggestions in Review
Donald Sharp [Tue, 24 Apr 2018 14:21:29 +0000 (10:21 -0400)]
doc: Fixup doc for vrf-2-vrf as per suggestions in Review

Fixup the documentation to suggested changes from the Review.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix CI breakage
Donald Sharp [Fri, 20 Apr 2018 20:07:30 +0000 (16:07 -0400)]
bgpd: Fix CI breakage

This commit reverts part of ceb800e0edb9f8979cebb1e6be9497d787bee39c
as it was found to be causing issues in upstream CI.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>