]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
6 years agobgpd: Implement new adjacent route show commands
Pascal Mathis [Wed, 16 May 2018 17:17:42 +0000 (19:17 +0200)]
bgpd: Implement new adjacent route show commands

This commit changes the behavior of `show bgp [afi] [safi] neighbor
<neighbor> received-routes [json]` to return all received prefixes
instead of filtering rejected/denied prefixes.

Compared to Cisco and Juniper products, this is the usual way how this
command is supposed to work, as `show bgp [afi] [safi] neighbor
<neighbor> routes` will already return all accepted prefixes.

Additionally, the new command `show bgp [afi] [safi] neighbor <neighbor>
filtered-routes` has been added, which returns a list of all prefixes
that got filtered away, so it can be roughly described as a subset of
"received prefixes - accepted prefixes".

As the already available `filtered_count` variable inside
`show_adj_route` has not been used before, the last output line
summarizing the amount of prefixes found was extended to also mention
the amount of filtered prefixes if present.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agoMerge pull request #2034 from vincentbernat/fix/rfc8365-auto-rt
Donald Sharp [Wed, 16 May 2018 16:13:04 +0000 (12:13 -0400)]
Merge pull request #2034 from vincentbernat/fix/rfc8365-auto-rt

bgpd: add an option for RT auto-derivation to use RFC 8635.

6 years agoMerge pull request #2240 from donaldsharp/ubuntu_bull
Martin Winter [Wed, 16 May 2018 15:36:21 +0000 (08:36 -0700)]
Merge pull request #2240 from donaldsharp/ubuntu_bull

Ubuntu 18.04 fixes

6 years agoMerge pull request #2226 from ppmathis/feature/bgp-lc-json
Russ White [Wed, 16 May 2018 01:05:21 +0000 (21:05 -0400)]
Merge pull request #2226 from ppmathis/feature/bgp-lc-json

bgpd: Improve JSON support for large communities

6 years agoMerge pull request #2241 from brotherdust/docdev-ubuntu-1804-build-guide
Quentin Young [Tue, 15 May 2018 21:57:08 +0000 (17:57 -0400)]
Merge pull request #2241 from brotherdust/docdev-ubuntu-1804-build-guide

docdev: Ubuntu 1804 build guide

6 years agoSuggested changes by @qlyoung
Jarad Olson [Tue, 15 May 2018 20:04:54 +0000 (14:04 -0600)]
Suggested changes by @qlyoung

- Changed hard-linked references to soft-link
- Changed configuration options from code block to ``.. option::`` blocks

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agoMerge pull request #2239 from ppmathis/enhancement/bgp-routemap-afi
Donald Sharp [Tue, 15 May 2018 18:46:12 +0000 (14:46 -0400)]
Merge pull request #2239 from ppmathis/enhancement/bgp-routemap-afi

bgpd: Improve route-map matching for INET(6) AF

6 years agoAdd more detail around confiugration files
Jarad Olson [Tue, 15 May 2018 18:25:07 +0000 (12:25 -0600)]
Add more detail around confiugration files

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agoRe-worded information on MPLS support in 18.04
Jarad Olson [Tue, 15 May 2018 18:04:48 +0000 (12:04 -0600)]
Re-worded information on MPLS support in 18.04

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agoFixup code block formatting errors
Jarad Olson [Tue, 15 May 2018 18:01:11 +0000 (12:01 -0600)]
Fixup code block formatting errors

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agobgpd: Prevent possible uninited variable.
Donald Sharp [Tue, 15 May 2018 17:57:40 +0000 (13:57 -0400)]
bgpd: Prevent possible uninited variable.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoChanged apt-get to sudo apt-get
Jarad Olson [Tue, 15 May 2018 17:52:32 +0000 (11:52 -0600)]
Changed apt-get to sudo apt-get

Context should be unpriviliged until explicity stated.

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agoSplit compile section into more granular steps
Jarad Olson [Tue, 15 May 2018 17:52:05 +0000 (11:52 -0600)]
Split compile section into more granular steps

- Added reference for additional configure options
- Added configure options for 0MQ and Protobuf

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agopbrd: Fix compilation warn -> error
Donald Sharp [Tue, 15 May 2018 17:34:52 +0000 (13:34 -0400)]
pbrd: Fix compilation warn -> error

The buffer size was insufficiently sized to hold the
entirety of the data being passed in.

Modify the nht code to use a bit bigger buffer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoAdded optional packages section
Jarad Olson [Tue, 15 May 2018 17:51:40 +0000 (11:51 -0600)]
Added optional packages section

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agoChange 'Install required packages' to 'Install dependencies'
Jarad Olson [Tue, 15 May 2018 17:51:14 +0000 (11:51 -0600)]
Change 'Install required packages' to 'Install dependencies'

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agoChange style of required packages list
Jarad Olson [Tue, 15 May 2018 17:50:34 +0000 (11:50 -0600)]
Change style of required packages list

The required packages list should be easier to parse. Updated the style so it's more similar to the ``./configure`` style later in the document.

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agoMPLS kernel module name change
Jarad Olson [Tue, 15 May 2018 17:50:00 +0000 (11:50 -0600)]
MPLS kernel module name change

Names of the MPLS kernel modules changed slightly in recent kernel. Uses underscore instead of dash.

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agoChange order of MPLS configuration
Jarad Olson [Tue, 15 May 2018 17:49:18 +0000 (11:49 -0600)]
Change order of MPLS configuration

MPLS kernel modules should be initialized *before* enabling forwarding. Otherwise, errors.

Signed-off-by: Jarad Olson <brotherdust+github@gmail.com>
6 years agobgpd: Improve route-map matching for INET(6) AF
Pascal Mathis [Tue, 15 May 2018 17:22:25 +0000 (19:22 +0200)]
bgpd: Improve route-map matching for INET(6) AF

While the current implementation does pay attention to the AF
(inet/inet6) when comparing the IPv4/v6 address against an address-list
/ prefix-list inside a route-map, the AF check is being done rather
late, which leads to CPU cycles being wasted due to unnecessary list
lookups / address matching.

This commit checks the address family of a prefix right inside the
`route_match_ip(v6)_` functions before looking up any address- and/or
prefix-list, which should improve performance.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agoMerge pull request #2101 from qlyoung/stream-fifo-safe
Rafael Zalamena [Tue, 15 May 2018 15:29:45 +0000 (12:29 -0300)]
Merge pull request #2101 from qlyoung/stream-fifo-safe

lib: add mt-safe variants for stream_fifo ops

6 years agoMerge pull request #2229 from qlyoung/fix-readme-typo
Renato Westphal [Tue, 15 May 2018 14:58:27 +0000 (11:58 -0300)]
Merge pull request #2229 from qlyoung/fix-readme-typo

frr: fix typo in README

6 years agoMerge pull request #2133 from Fredi-raspall/fix_label_manager
Renato Westphal [Tue, 15 May 2018 13:00:12 +0000 (10:00 -0300)]
Merge pull request #2133 from Fredi-raspall/fix_label_manager

Fix broken label manager (proxy-mode) and improve of proxy function

6 years agofrr: fix typo in README
Quentin Young [Mon, 14 May 2018 15:06:27 +0000 (11:06 -0400)]
frr: fix typo in README

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2223 from ppmathis/fix/no-password-warnings
Quentin Young [Mon, 14 May 2018 15:01:19 +0000 (11:01 -0400)]
Merge pull request #2223 from ppmathis/fix/no-password-warnings

lib: Improved warnings for 'no (enable) password'

6 years agobgpd: Improve JSON support for large communities
Pascal Mathis [Sun, 13 May 2018 00:29:40 +0000 (02:29 +0200)]
bgpd: Improve JSON support for large communities

The current implementation of building JSON output is greatly different
for large communities compared to standard communities. This is mainly
noticeable by the missing 'list' attribute, which usually offers an
array of all communities present on a BGP route.

This commit adds the missing functionality of properly returning a
'list' attribute in JSON output and also tries a similar approach like
the standard communities are using to implement this feature.

Additionally, the 'format' specifier has been completely removed from
large communities string/JSON rendering, as the official RFC8092 specifies that
there is only one canonical representation:

> The canonical representation of BGP Large Communities is three
> separate unsigned integers in decimal notation in the following
> order: Global Administrator, Local Data 1, Local Data 2. Numbers
> MUST NOT contain leading zeros; a zero value MUST be represented with
> a single zero. Each number is separated from the next by a single
> colon. For example: 64496:4294967295:2, 64496:0:0.

As the 'format' specifier has not been used/checked and only one
canonical representation exists per today, there was no reason to keep
the 'format' parameter in the function signature.

Last but not least, the struct attribute 'community_entry.config' is no
longer being used for large communities and instead 'lcommunity_str' is
being called to maintain a similar approach to standard communities.

As a side effect, this also fixed a memory leak inside 'community_entry_free'
which did not free the allocated memory for the 'config' attribute when
dealing with a large community.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agoMerge pull request #2225 from xdel/master
Donald Sharp [Sun, 13 May 2018 17:14:22 +0000 (13:14 -0400)]
Merge pull request #2225 from xdel/master

Fix compilation against rtrlib with ssh

6 years agolib: Moved no-password warnings into header file
Pascal Mathis [Sun, 13 May 2018 17:11:43 +0000 (19:11 +0200)]
lib: Moved no-password warnings into header file

The warning string which appears when the users executes 'no (enable)
password' was moved into command.h and declared as a constant named
'NO_PASSWD_CMD_WARNING'.

This avoids duplicate code and makes it easy to change the warning
message in all places at once.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agoFix compilation against rtrlib with ssh
Andrey Korolyov [Sun, 13 May 2018 10:36:50 +0000 (13:36 +0300)]
Fix compilation against rtrlib with ssh

Signed-off-by: Andrey Korolyov <andrey@xdel.ru>
6 years agolib: Improved warnings for 'no (enable) password'
Pascal Mathis [Sat, 12 May 2018 18:19:49 +0000 (20:19 +0200)]
lib: Improved warnings for 'no (enable) password'

When the user executes one of the commands 'no password' or 'no enable
password', a warning message gets shown to inform the user of the
security implications.

While the current implementation works, a warning message gets printed
once for each daemon, which can lead to seeing the same message many
times. This does not affect functionality, but looks like an error to
the user as it can be seen within issue #1432.

This commit only prints the warning message inside lib when vtysh
dispatch is not being used. Additionally, the warning message was copied
into the vtysh command handlers, so that they get printed exactly once.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agoMerge pull request #2217 from donaldsharp/pim_threads
Russ White [Sat, 12 May 2018 10:41:27 +0000 (06:41 -0400)]
Merge pull request #2217 from donaldsharp/pim_threads

Pim cleanup when networking restarts under itself

6 years agoMerge pull request #2216 from qlyoung/fix-doc-warnings
Russ White [Sat, 12 May 2018 10:40:14 +0000 (06:40 -0400)]
Merge pull request #2216 from qlyoung/fix-doc-warnings

doc: cleanup zebra vrf docs

6 years agoMerge pull request #2215 from qlyoung/docuser-building-openbsd6
Russ White [Sat, 12 May 2018 10:39:29 +0000 (06:39 -0400)]
Merge pull request #2215 from qlyoung/docuser-building-openbsd6

doc: update pkg version for automake on openbsd6

6 years agoMerge pull request #2214 from donaldsharp/pointer_counting
Russ White [Sat, 12 May 2018 10:38:57 +0000 (06:38 -0400)]
Merge pull request #2214 from donaldsharp/pointer_counting

More bgp fixes

6 years agoMerge pull request #2213 from donaldsharp/errno
Russ White [Sat, 12 May 2018 10:38:02 +0000 (06:38 -0400)]
Merge pull request #2213 from donaldsharp/errno

some small bgp issues

6 years agoMerge pull request #2211 from chiragshah6/ospf_vrf_dev
Russ White [Sat, 12 May 2018 10:37:00 +0000 (06:37 -0400)]
Merge pull request #2211 from chiragshah6/ospf_vrf_dev

ospfd: packet fifo init in interface create

6 years agoMerge pull request #2197 from qlyoung/docuser-debianpkg
Russ White [Sat, 12 May 2018 10:27:26 +0000 (06:27 -0400)]
Merge pull request #2197 from qlyoung/docuser-debianpkg

doc: move Debian packaging docs to dev docs

6 years agoMerge pull request #2196 from LabNConsulting/working/master/bgpd-shutdown-race
Russ White [Sat, 12 May 2018 10:27:00 +0000 (06:27 -0400)]
Merge pull request #2196 from LabNConsulting/working/master/bgpd-shutdown-race

BGP: Preclude race condition between listener thread and core during shutdown

6 years agoMerge pull request #2189 from qlyoung/move-bug-reports-to-docs
Russ White [Sat, 12 May 2018 10:25:48 +0000 (06:25 -0400)]
Merge pull request #2189 from qlyoung/move-bug-reports-to-docs

doc: move REPORTING-BUGS to user docs

6 years agoMerge pull request #2187 from qlyoung/remove-netbsd
Russ White [Sat, 12 May 2018 10:25:17 +0000 (06:25 -0400)]
Merge pull request #2187 from qlyoung/remove-netbsd

frr: remove README.NetBSD

6 years agoMerge pull request #2171 from pguibert6WIND/misc_crashes_moving_ifp_from_netns
Russ White [Sat, 12 May 2018 10:24:45 +0000 (06:24 -0400)]
Merge pull request #2171 from pguibert6WIND/misc_crashes_moving_ifp_from_netns

Misc crashes moving ifp from netns

6 years agoMerge pull request #2162 from qlyoung/fix-vpath-build
Russ White [Sat, 12 May 2018 10:23:03 +0000 (06:23 -0400)]
Merge pull request #2162 from qlyoung/fix-vpath-build

doc: support VPATH builds

6 years agoMerge pull request #2132 from donaldsharp/missed_stuff
Russ White [Sat, 12 May 2018 10:18:15 +0000 (06:18 -0400)]
Merge pull request #2132 from donaldsharp/missed_stuff

Missed stuff

6 years agoMerge pull request #2124 from donaldsharp/missed
Russ White [Sat, 12 May 2018 10:16:02 +0000 (06:16 -0400)]
Merge pull request #2124 from donaldsharp/missed

bgpd, zebra: Handle EVPN router MAC per next hop

6 years agopimd: Clean up rpf_hash *after* upstream cleanup
Donald Sharp [Fri, 11 May 2018 22:39:09 +0000 (18:39 -0400)]
pimd: Clean up rpf_hash *after* upstream cleanup

Cleanup the pim->rpf_hash after upstream cleanup is done
since upstream cleanup uses the rpf_hash to cleanup itself.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Allow interface to move in and out of vrfs
Donald Sharp [Fri, 11 May 2018 19:04:10 +0000 (15:04 -0400)]
pimd: Allow interface to move in and out of vrfs

When we get an interface move event track the correct
pim instance.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Cleanup all pim_ifp pointers on termination
Donald Sharp [Fri, 11 May 2018 18:34:20 +0000 (14:34 -0400)]
pimd: Cleanup all pim_ifp pointers on termination

Properly cleanup pim_ifp pointers on termination

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Cleanup ifchannel deletion
Donald Sharp [Fri, 11 May 2018 18:07:53 +0000 (14:07 -0400)]
pimd: Cleanup ifchannel deletion

When we are being told to go away, cleanup ifchannel deletion
a bit better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Cleanup msdp shutdown
Donald Sharp [Fri, 11 May 2018 17:57:13 +0000 (13:57 -0400)]
pimd: Cleanup msdp shutdown

Shutdown pim msdp code a bit better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agopimd: Cleanup the deletion event a tiny bit
Donald Sharp [Fri, 11 May 2018 17:46:59 +0000 (13:46 -0400)]
pimd: Cleanup the deletion event a tiny bit

The pim_upstream_free command was leaving slag by
not deleting data associated with the upstream
data structure.  Modify the code to explicitly free
all data associated with an upstream on a pim instance
deletion event.  Additionally the end result is that
the pim_upstream_free command is not needed anymore

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: cleanup zebra vrf docs
Quentin Young [Fri, 11 May 2018 19:53:07 +0000 (15:53 -0400)]
doc: cleanup zebra vrf docs

* Fix missing references
* Fix displaced reference target
* Fix miscellaneous typos
* Remove duplicate CLI documentation
* Rewrap lines to 80 characters

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: update pkg version for automake on openbsd6
Quentin Young [Fri, 11 May 2018 20:04:15 +0000 (16:04 -0400)]
doc: update pkg version for automake on openbsd6

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2172 from msablic/pim_igmp_stats
Donald Sharp [Fri, 11 May 2018 17:48:31 +0000 (13:48 -0400)]
Merge pull request #2172 from msablic/pim_igmp_stats

pimd: show ip igmp statistics command

6 years agoMerge pull request #2207 from ppmathis/fix/bgpd-snmp-peer-lookup
Donald Sharp [Fri, 11 May 2018 13:32:08 +0000 (09:32 -0400)]
Merge pull request #2207 from ppmathis/fix/bgpd-snmp-peer-lookup

bgpd: fix and improve snmp peer lookups

6 years agoMerge pull request #2202 from dslicenc/bgp-neigh-auto-complete
Lou Berger [Fri, 11 May 2018 12:49:17 +0000 (08:49 -0400)]
Merge pull request #2202 from dslicenc/bgp-neigh-auto-complete

bgpd: fix auto-completion for neighbors and peer-groups

6 years agoMerge pull request #2208 from ppmathis/fix/debianpkg-env-pager
Donald Sharp [Fri, 11 May 2018 12:08:47 +0000 (08:08 -0400)]
Merge pull request #2208 from ppmathis/fix/debianpkg-env-pager

debianpkg: improve VTYSH_PAGER environment check

6 years agoMerge pull request #2212 from ppmathis/feature/implement-no-password-cmd
Donald Sharp [Fri, 11 May 2018 12:07:18 +0000 (08:07 -0400)]
Merge pull request #2212 from ppmathis/feature/implement-no-password-cmd

lib: Ported 'no (enable) password' from stable/3.0

6 years agobgpd: Set NEXT_HOP attribute for EVPN imported routes
vivek [Mon, 7 May 2018 19:04:26 +0000 (12:04 -0700)]
bgpd: Set NEXT_HOP attribute for EVPN imported routes

Ensure that when EVPN routes are imported into a VRF as IPv4 routes,
the NEXT_HOP attribute is set. In the absence of this, this attribute
is currently not generated when advertising the route to peers in the
VRF. It is to be noted that the source route (the EVPN route) will only
have the MP_REACH_NLRI attribute that contains the next hop in it.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
6 years agobgpd: Update parent entry's refcount for imported routes
vivek [Wed, 9 May 2018 05:16:04 +0000 (22:16 -0700)]
bgpd: Update parent entry's refcount for imported routes

Imported routes in a VRF routing table have a reference to their parent
route entry which resides in the EVPN or IPVPN routing table. Ensure that
this reference uses appropriate locking so that the parent entry doesn't
get freed prematurely.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit 13cb6b22ba9d558b1b4a1e8752f63f13242462a7)

Conflicts:
bgpd/bgp_mplsvpn.c

Ticket: CM-20471
Testing Done:
a) Ran vrf_route_leak tests without fix and hit crash, ran twice with fix
and did not see the crash.
b) Ran evpn-smoke and ensured there were no new failures.

6 years agobgpd: fix and improve snmp peer lookups
Pascal Mathis [Thu, 10 May 2018 21:35:37 +0000 (23:35 +0200)]
bgpd: fix and improve snmp peer lookups

The previous implementation of bgp_peer_lookup_next did not consider the
internal ordering of peers when using peer groups, which led to all
standalone peers being skipped that had a lower IP address than the
highest IP address of a peer belonging to a group.

As the ordering of peers can not be arbitrary due to SNMP requiring
increasing OIDs when walking an OID tree, this commit fixes the bug by
properly looping through all peers and detecting the next highest IP
address.

Additionally, this commit improved both bgp_peer_lookup_next and
peer_lookup_addr_ipv4 by using the socketunion stored within the peer
struct (peer->su) instead of calling inet_pton for each peer during
comparison.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agobgpd: Respect ability to reach nexthop if available
Donald Sharp [Fri, 11 May 2018 11:40:55 +0000 (07:40 -0400)]
bgpd: Respect ability to reach nexthop if available

When bgp is thinking about opening a connection to a peer,
if we are connected to zebra, allow that to influence our
decision to start the connection.

Found Scenario:

Both bgp and zebra are started up at the same time.  Zebra is
being used to create the connected route through which bgp
will establish a peering relationship.  The machine is a
bit loaded due to other startup conditions and as such bgp
gets to the connection stage here before zebra has installed
the route.  If bgp does not respect zebra data when it does
have a connection then we will attempt to connect.  The
connect will fail because there is no route.  At that time
we will go into the connect timeout(2 minutes) and delay
connection.

What this does.  If we have established a zebra connection and
we do not have a clear path to the destination at this point
do not allow the connection to proceed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Cleanup messages from getsockopt
Donald Sharp [Fri, 11 May 2018 11:34:24 +0000 (07:34 -0400)]
bgpd: Cleanup messages from getsockopt

The handling of the return codes for getsockopt was slightly wrong.

getsockopt returns -1 on error and errno is set.
What to do with the return code at that point is dependent
on what sockopt you are asking about.  In this case
status holds the error returned for SO_ERROR.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agolib: Ported 'no (enable) password' from stable/3.0
Pascal Mathis [Fri, 11 May 2018 00:54:30 +0000 (02:54 +0200)]
lib: Ported 'no (enable) password' from stable/3.0

The pull request #1545 from @donaldsharp introduced the command 'no
password' to remove an existing terminal connection password.
Additionally, warnings have been added to both 'no password' and 'no
enable password' to make the user aware of any security implications.

It seems that this specific pull request was never merged against master
and got lost. This commit is a cherry-pick of d4961273cb with fixed
conflicts and updated documentation.

Thanks to @donaldsharp and @pogojotz for the original PR.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agoospfd: packet fifo init in interface create
Chirag Shah [Tue, 1 May 2018 14:36:53 +0000 (07:36 -0700)]
ospfd: packet fifo init in interface create

Currently, interface packet transmit queue is created/deleted
as part of Interface UP/Down event. This results in
a rare condition where port came up but queue
was not created. The creation of queue occupies only few bytes.

Moving fifo queue creation to interface create
would add few bytes of fifo creation but at least it guaranteed
to be available during Up/down -->Up event.

Initialize ospf packet fifo queue during ospf
interface creation.

Drain queue during interface down event.

Drained and free the queue as part of the interface
delete/cleanup.

Ticket:CM-20744
Testing Done:

Bring up ospfv2 topology with multiple neighbors.
1) Trigger multiple shut/no shut events and validate
all queues are freed.
2) configure/deconfigure router ospf and validate
all ospf instance and interface underneath are freed.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
6 years agodebianpkg: improve VTYSH_PAGER environment check
Pascal Mathis [Thu, 10 May 2018 22:03:23 +0000 (00:03 +0200)]
debianpkg: improve VTYSH_PAGER environment check

The current post-installation scripts for all Debian packages execute
grep 'VTYSH_PAGER=/bin/cat' to check if the VTYSH_PAGER variable is
present within /etc/environment.

While presence of that environment variable should be checked, the
current implementation does not handle this line being a comment (and
therefor not active) or the user picking a different VTYSH_PAGER than
/bin/cat.

This commit ensures that the environment variable can be freely changed
by the user, while still guaranteeing that it is present in the file
without being a comment.

Signed-off-by: Pascal Mathis <mail@pascalmathis.com>
6 years agobgpd: fix auto-completion for neighbors and peer-groups
Don Slice [Thu, 10 May 2018 13:10:18 +0000 (09:10 -0400)]
bgpd: fix auto-completion for neighbors and peer-groups

Before this fix, both real neighbors and peer-groups were lumped
together in auto-completion and it didn't work at all for
peer-groups.  This fix changes that behavior to do the right
thing.

Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
6 years agoMerge pull request #2195 from qlyoung/docuser
Jafar Al-Gharaibeh [Thu, 10 May 2018 15:24:06 +0000 (10:24 -0500)]
Merge pull request #2195 from qlyoung/docuser

doc: update doc titles

6 years agobgpd: block io thread reads once shutdown has started
Lou Berger [Thu, 10 May 2018 12:47:11 +0000 (08:47 -0400)]
bgpd: block io thread reads once shutdown has started

Signed-off-by: Lou Berger <lberger@labn.net>
6 years agoMerge pull request #2075 from pguibert6WIND/doc_vrf
Lou Berger [Thu, 10 May 2018 10:56:56 +0000 (06:56 -0400)]
Merge pull request #2075 from pguibert6WIND/doc_vrf

doc: add information about zebra VRF configuration

6 years agodoc: move Debian packaging docs to dev docs
Quentin Young [Wed, 9 May 2018 19:12:07 +0000 (15:12 -0400)]
doc: move Debian packaging docs to dev docs

Updated the doc to cross-reference build documentation as well and
reformatted to RST. Removed stub section on how to configure daemons and
whatnot, as that's the domain of the user docs.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agodoc: update doc titles
Quentin Young [Wed, 9 May 2018 14:44:08 +0000 (10:44 -0400)]
doc: update doc titles

Should be a bit easier to Google this way.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
6 years agoMerge pull request #2183 from Thomas-Gelf/fix/doc-snmp-file-formatting
Quentin Young [Wed, 9 May 2018 14:41:59 +0000 (10:41 -0400)]
Merge pull request #2183 from Thomas-Gelf/fix/doc-snmp-file-formatting

doc, snmp: fix file formatting

6 years agodoc: add information about zebra VRF configuration
Philippe Guibert [Fri, 13 Apr 2018 14:13:23 +0000 (16:13 +0200)]
doc: add information about zebra VRF configuration

As there are subtle differences between VRF-lite and VRF-netns,
some information is given to the operator on what can be/ can not be
done.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
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 agodoc, snmp: fix file formatting
Thomas Gelf [Mon, 7 May 2018 23:09:03 +0000 (01:09 +0200)]
doc, snmp: fix file formatting

Signed-off-by: Thomas Gelf <thomas@gelf.net>
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 agolib: Fix bad function
Donald Sharp [Tue, 8 May 2018 23:33:07 +0000 (19:33 -0400)]
lib: Fix bad function

Fix the decleration of a function to be better.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agodoc: Fix pbr documentation to be correct
Donald Sharp [Tue, 8 May 2018 23:31:40 +0000 (19:31 -0400)]
doc: Fix pbr documentation to be correct

The recent change of pbr necessitates this change in the doc

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd, lib, zebra: Cleanup formatting issues found
Donald Sharp [Sun, 29 Apr 2018 18:35:39 +0000 (14:35 -0400)]
bgpd, lib, zebra: Cleanup formatting issues found

Cleanup the formating issues found.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agoZebra: Fix ptm-enable config failure on internally created interfaces
radhika [Tue, 1 Aug 2017 17:10:35 +0000 (10:10 -0700)]
Zebra: Fix ptm-enable config failure on internally created interfaces

Ticket: CM-15658
Reviewed By: CCR-6534
Testing Done: Unit

Issue: frr ptm-enable command not working for interfaces that have been created by frr as a place holder.

Root Cause: The ptm-enable on interface configuration was not getting stored when the interface was internally created by frr.

Fix: Store the ptm-enable configuration even if the interface is internally created.

Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
6 years agobgpd: Fix VRF route leaking for multipath routes
vivek [Fri, 6 Apr 2018 16:31:11 +0000 (09:31 -0700)]
bgpd: Fix VRF route leaking for multipath routes

Ensure that the next hop of the leaked VRF is not overwritten when the
route is being imported into the target VRF from the VPN table. Also, in
the case of multipath routes, ensure that the nexthop's ifindex is not
inadvertently reset.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
6 years agozebra: Increase recvmsg buffer size for picking up netlink messages
vivek [Fri, 20 Apr 2018 15:40:42 +0000 (08:40 -0700)]
zebra: Increase recvmsg buffer size for picking up netlink messages

Netlink messages from the kernel need to be received in a buffer larger
than 8K in order to handle some types of info - for example, the VLAN
information. Define a separate size for receive and set it to 32K, which
is the value used by other netlink receivers like iproute2.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agozebra: Fixup crash with vlan interfaces attempted to be used
Donald Sharp [Fri, 7 Jul 2017 17:42:40 +0000 (13:42 -0400)]
zebra: Fixup crash with vlan interfaces attempted to be used

When zebra starts up it receives from the kernel a full dump of
interface information.  Unfortunately it is in no particular order.
As such we sometimes receive data from the kernel about interfaces
we do not know about yet.

In this bug, we are attempting to use the interface pointer(->link)
for a vlan interface that we have not properly resolved.

This fix ensures that we will not attempt to call zvni_map_svi
if we have a NULL pointer.  There are other places in the code
we are already checking for the fact that the ->link pointer
is valid before calling this function, so I believe that this
is correct.

We do need to come back and resolve all ->link pointers
after we have received the full table.  This can be
done in another commit.

Ticket: CM-17041
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Fix compiler warning->errors of might be used uninited
Donald Sharp [Wed, 24 Jan 2018 15:34:52 +0000 (10:34 -0500)]
bgpd: Fix compiler warning->errors of might be used uninited

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: Don't generate spurious warning on VNI deletion
vivek [Fri, 13 Oct 2017 22:46:23 +0000 (15:46 -0700)]
bgpd: Don't generate spurious warning on VNI deletion

There are situations in which zebra may issue more than one delete
notification, so BGP should not warn when it can't locate the VNI
at delete. This is comparable to the situation when a withdraw is
received but the route isn't present locally.

Signed-off-by: Vivek Venkatraman <vivek@cumulusmetworks.com>
Ticket: CM-17512
Reviewed By: Trivial
Testing Done: Manual

6 years agobgpd: set NEXTHOP_UNCHANGED for l2vpn evpn by default for all BGP peers
Mitesh Kanjariya [Wed, 4 Apr 2018 20:01:45 +0000 (13:01 -0700)]
bgpd: set NEXTHOP_UNCHANGED for l2vpn evpn by default for all BGP peers

This flag needs to be set by default for l2vpn evpn address-family.
We needed to find a place in the code which gets called by all peers
at somepoint in the statemachine and before the routes are advertised.
peer_new seems like the right place for this
as we are setting other default af_flags here as well.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agozebra: Use STREAM_GETXXX functions
Donald Sharp [Fri, 27 Apr 2018 13:21:28 +0000 (09:21 -0400)]
zebra: Use STREAM_GETXXX functions

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
6 years agobgpd: enable neighbor-nexthop-self for l2vpn evpn address family
Mitesh Kanjariya [Thu, 1 Mar 2018 09:47:28 +0000 (01:47 -0800)]
bgpd: enable neighbor-nexthop-self for l2vpn evpn address family

In the FRR implementation of EVPN,
eBGP leaf-spine peering for EVPN is fully supported by allowing
the next hop to be propagated and not rewritten at each hop.
There are other changes also related to route import to facilitate this.
However, propagating the next hop is not correct in some cases.
Specifically, if the DC is comprised of multiple PODs
with distinct intra-POD and inter-POD VxLAN tunnels,
EVPN routes received from an adjacent POD by a border/exit leaf
must be propagated into the local POD with the next hop rewritten (to self).

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: modify route install/withdraw logic for evpn type-5 routes in vrf
Mitesh Kanjariya [Wed, 11 Apr 2018 09:29:46 +0000 (02:29 -0700)]
bgpd: modify route install/withdraw logic for evpn type-5 routes in vrf

We install type-5 routes as ipv4/ipv6 unicast routes in the vrf table.
along with these routes, we also install the RMAC
and the nexthop Neigh entries.
There might be scenarios were the bestpath has changed and
we are now pointing to a new nexthop with a different RMAC.
As per BGP logic, we just send an update for the route and the nexthop
is replaced. However, this causes problem because the RMAC and neigh entry
corresponding to the previous nexthop are still lingering in the system.
We need to clear those entries for proper functoning.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: apply advertise ipv4 unicast route-map while advertising type-5 routes
Mitesh Kanjariya [Mon, 16 Apr 2018 08:09:03 +0000 (01:09 -0700)]
bgpd: apply advertise ipv4 unicast route-map while advertising type-5 routes

A newly added ipv4/ipv6 route in BGP RIB might be advertised as type-5 EVPN route.
The user might have configured a route-map for advertising type-5 routes.
We need to apply this route-map while advertising ipv4/ipv6 routes as type-5.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: write route-map to config for advertise type5 commands
Mitesh Kanjariya [Tue, 10 Apr 2018 10:02:24 +0000 (03:02 -0700)]
bgpd: write route-map to config for advertise type5 commands

We enable/disable type-5 routes by following commands:
advertise ipv4 unicast [route-map <route-map>]
advertise ipv6 commands [route-map <route-map>]
the route-map part was writtem to conf file.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: no advertise ipv6 unicast comand should unset the af_flags
Mitesh Kanjariya [Tue, 10 Apr 2018 10:31:05 +0000 (03:31 -0700)]
bgpd: no advertise ipv6 unicast comand should unset the af_flags

no advertise ipv6 unicast command should unset the corresponding
af_flag in bgp_vrf rather than the vrf_flags.

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agobgpd: Display table version for EVPN routes
vivek [Wed, 1 Nov 2017 23:57:55 +0000 (16:57 -0700)]
bgpd: Display table version for EVPN routes

Display the table version for EVPN routes like it is done for other
address families. Note that this is really relevant only for the
per-VNI routing table.

Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
Ticket: CM-12903

6 years agobgpd/zebra: use stream_putl/getl to send VNIs
Mitesh Kanjariya [Fri, 2 Mar 2018 01:18:34 +0000 (17:18 -0800)]
bgpd/zebra: use stream_putl/getl to send VNIs

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agozebra: vni [prefix-routes-only] should also be provided for the 'no' cmd
Mitesh Kanjariya [Tue, 10 Apr 2018 08:37:21 +0000 (01:37 -0700)]
zebra: vni [prefix-routes-only] should also be provided for the 'no' cmd

We have a command to enable symmetric routing only for type-5 routes.
This command is provided under vrf <> option in zebra as follows:
vrf <VRF>
  vni <VNI> [prefix-routes-only]
We need the corresponding no version of the command as well as follows:
vrf <VRF>
  no vni <VNI> [prefix-routes-only]

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agozebra: remote RMAC for EVPN ipv6 hosts should be programmed against the ipv4 nexthop
Mitesh Kanjariya [Mon, 9 Apr 2018 04:04:11 +0000 (21:04 -0700)]
zebra: remote RMAC for EVPN ipv6 hosts should be programmed against the ipv4 nexthop

For ipv6 host, the next hop is conevrted to ipv6 mapped address.
However, the remote rmac should still be programmed with the ipv4 address.
This is how the entries will look in the kernel for ipv6 hosts routing.

vrf routing table:
ipv6 -> ipv6_mapped remote vtep on l3vni SVI

neigh table:
ipv6_mapped remote vtep -> remote RMAC

bridge fdb:
remote rmac -> ipv4 vtep tunnel

Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
6 years agowatchfrr always writes 'log syslog informational' to the config
Daniel Walton [Fri, 4 Aug 2017 20:39:56 +0000 (00:39 +0400)]
watchfrr always writes 'log syslog informational' to the config

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dave Olson <olson@cumulusnetworks.com>
Ticket: CM-16501