]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
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 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 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 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

5 years agoMerge pull request #3650 from donaldsharp/mpls_compile_issue
Mark Stapp [Wed, 23 Jan 2019 17:56:56 +0000 (12:56 -0500)]
Merge pull request #3650 from donaldsharp/mpls_compile_issue

zebra: Fix compile issues introduced by recent commit on newer compilers

5 years agoOnly check for .interp when we have objcopy
Ruben Kerkhof [Tue, 22 Jan 2019 17:39:47 +0000 (18:39 +0100)]
Only check for .interp when we have objcopy

On Mac OS, where we don't have objcopy, ./configure logs:

checking for objcopy... no
checking for .interp value to use... ./configure: line 22174: conftest.interp: No such file or directory

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
5 years agoRedirect output of ranlib to /dev/null
Ruben Kerkhof [Tue, 22 Jan 2019 17:32:08 +0000 (18:32 +0100)]
Redirect output of ranlib to /dev/null

./configure on Mac OS logs:
checking whether ranlib supports D option... error: /Library/Developer/CommandLineTools/usr/bin/ranlib: unknown option character `D' in: -D
Usage: /Library/Developer/CommandLineTools/usr/bin/ranlib [-sactfqLT] [-] archive [...]
no

This is quite noisy.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
5 years agoRedirect output of $AR check to /dev/null
Ruben Kerkhof [Tue, 22 Jan 2019 17:29:29 +0000 (18:29 +0100)]
Redirect output of $AR check to /dev/null

./configure logs this on Mac OS:

checking whether ar supports D option... /Library/Developer/CommandLineTools/usr/bin/ar: illegal option -- D
usage:  ar -d [-TLsv] archive file ...
ar -m [-TLsv] archive file ...
ar -m [-abiTLsv] position archive file ...
ar -p [-TLsv] archive [file ...]
ar -q [-cTLsv] archive file ...
ar -r [-cuTLsv] archive file ...
ar -r [-abciuTLsv] position archive file ...
ar -t [-TLsv] archive [file ...]
ar -x [-ouTLsv] archive [file ...]
no

This is quite noisy and we're only interested in the result of the
check, not the output.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
5 years agoMerge pull request #3648 from donaldsharp/master_version
Lou Berger [Wed, 23 Jan 2019 15:14:49 +0000 (10:14 -0500)]
Merge pull request #3648 from donaldsharp/master_version

*: Convert to new version number

5 years agoMerge pull request #3649 from donaldsharp/increase_timeout
Rafael Zalamena [Wed, 23 Jan 2019 13:34:10 +0000 (11:34 -0200)]
Merge pull request #3649 from donaldsharp/increase_timeout

topotests: Modify bgp convergence to be more than 120 seconds

5 years agoospf6d: keep track of the socket set thread
Rafael Zalamena [Wed, 23 Jan 2019 12:25:30 +0000 (10:25 -0200)]
ospf6d: keep track of the socket set thread

When using the timer to set the socket multicast options, keep track
of the thread pointer. If we lose the thread reference we might have
situations where multicast is enabled when it should be disabled and
vice versa.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobgpd: improve peer-group remote-as definitions
Don Slice [Thu, 27 Dec 2018 16:03:38 +0000 (11:03 -0500)]
bgpd: improve peer-group remote-as definitions

Problem reported that with certain sequences of defining the
remote-as on the peer-group and the members, the configuration would
become wrong, with configured remote-as settings not reflected in
the config but peers unable to come up.  This fix resolves these
inconsistencies.

Ticket: CM-19560
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoospf6d: don't queue interface events
Rafael Zalamena [Wed, 23 Jan 2019 12:06:49 +0000 (10:06 -0200)]
ospf6d: don't queue interface events

Apply interface event as soon as possible instead of queueing an event
for it.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agozebra: Fix compile issues introduced by recent commit on newer compilers
Donald Sharp [Wed, 23 Jan 2019 01:55:55 +0000 (20:55 -0500)]
zebra: Fix compile issues introduced by recent commit on newer compilers

We were using dplane_ctx_get_status(ctx) and assigning that
value to zebra_dplane_status, not zebra_dplane_result( yeah what? )

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3630 from opensourcerouting/fix-show-import-check
Donald Sharp [Wed, 23 Jan 2019 01:10:56 +0000 (20:10 -0500)]
Merge pull request #3630 from opensourcerouting/fix-show-import-check

zebra: fix the "show ip import-check" command

5 years agoMerge pull request #3644 from opensourcerouting/ldpd-pdu-length-fix
Donald Sharp [Wed, 23 Jan 2019 01:08:22 +0000 (20:08 -0500)]
Merge pull request #3644 from opensourcerouting/ldpd-pdu-length-fix

ldpd: fix corner case in which we wouldn't respect the max pdu length

5 years agotopotests: Modify bgp convergence to be more than 120 seconds
Donald Sharp [Wed, 23 Jan 2019 01:00:55 +0000 (20:00 -0500)]
topotests: Modify bgp convergence to be more than 120 seconds

Waiting 10 seconds for bgp convergence makes no sense, especially
if the test system is under load and a node is started up before
the node it is connecting to is up. We should wait for the full
default of 120 seconds, plus a little time to ensure nothing is
screwed up too much.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years ago*: Convert to new version number
Donald Sharp [Tue, 22 Jan 2019 23:31:33 +0000 (18:31 -0500)]
*: Convert to new version number

After much discussion we have decided to update the version of master
to 7.1 dev.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #3416 from mjstapp/dplane_mpls
Rafael Zalamena [Tue, 22 Jan 2019 21:38:24 +0000 (19:38 -0200)]
Merge pull request #3416 from mjstapp/dplane_mpls

Async dataplane: support mpls lsps

5 years agoldpd: fix corner case in which we wouldn't respect the max pdu length
Renato Westphal [Tue, 22 Jan 2019 19:50:33 +0000 (17:50 -0200)]
ldpd: fix corner case in which we wouldn't respect the max pdu length

The calculation to know when an LDP PDU went past the maximum
negotiated PDU length was wrong because it wasn't taking the
"Version" and "PDU Length" fields into account (total of four
bytes). Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agozebra: openbsd LSP update code
Mark Stapp [Mon, 26 Nov 2018 21:08:55 +0000 (16:08 -0500)]
zebra: openbsd LSP update code

Finish the LSP update code for the async dataplane for
the openbsd platform. Remove synch apis now that we've
converted to the async code path.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: remove use of sync LSP update apis
Mark Stapp [Mon, 26 Nov 2018 21:07:51 +0000 (16:07 -0500)]
zebra: remove use of sync LSP update apis

Remove the last use of the pre-dataplane LSP update apis;
remove the stubs from the 'null' implementation file.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: fix routing socket logic for labelled nexthops
Mark Stapp [Thu, 20 Dec 2018 18:20:49 +0000 (13:20 -0500)]
zebra: fix routing socket logic for labelled nexthops

Clarify and fix the logic used for labelled nexthops during
route updates on routing socket platforms.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: fix debug test in routing-socket update path
Mark Stapp [Thu, 20 Dec 2018 18:22:22 +0000 (13:22 -0500)]
zebra: fix debug test in routing-socket update path

Fix the test used to pre-populate a string used in debugs
in the routing-socket route-update code path.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: move LSP updates into dataplane subsystem
Mark Stapp [Thu, 15 Nov 2018 14:11:01 +0000 (09:11 -0500)]
zebra: move LSP updates into dataplane subsystem

Start performing LSP updates through the async dataplane
subsystem. This is plumbed through for linux/netlink.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #3559 from opensourcerouting/zapi-sanity-checks
Quentin Young [Tue, 22 Jan 2019 18:53:08 +0000 (13:53 -0500)]
Merge pull request #3559 from opensourcerouting/zapi-sanity-checks

add a few moar sanity checks when encoding/decoding zapi routes

5 years agozebra: infra for LSP updates using dplane
Mark Stapp [Tue, 23 Oct 2018 14:57:01 +0000 (10:57 -0400)]
zebra: infra for LSP updates using dplane

Adding infra to zebra dplane to support LSP updates. Add
kernel api for LSP updates that uses a dataplane context; add
stub apis for netlink, bsd, and 'null' kernel paths. Add
version of netlink mpls update code that takes a dplane
context struct instead of a zebra lsp struct.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: add apis to add and delete NHLFEs
Mark Stapp [Wed, 17 Oct 2018 19:54:53 +0000 (15:54 -0400)]
zebra: add apis to add and delete NHLFEs

Add public versions of zebra apis that add NHLFEs to an LSP,
and that free NHLFEs. The dataplane code needs to capture/copy
NHLFEs in order to do async LSP programming.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agozebra: reorg dataplane context to support lsp info
Mark Stapp [Wed, 10 Oct 2018 15:36:53 +0000 (11:36 -0400)]
zebra: reorg dataplane context to support lsp info

Move route info to a separate struct and use a union in the
dplane context to hold either route or lsp info. Add
accessors for LSP info.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoFix compile error on Mac OS
Ruben Kerkhof [Tue, 22 Jan 2019 16:55:31 +0000 (17:55 +0100)]
Fix compile error on Mac OS

  CC       lib/frr_pthread.lo
lib/frr_pthread.c:128:40: error: too many arguments to function call, expected 1, have 3
        ret = pthread_setname_np(fpt->thread, fpt->os_name, NULL);
              ~~~~~~~~~~~~~~~~~~              ^~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/pthread.h:512:1: note: 'pthread_setname_np' declared here
__API_AVAILABLE(macos(10.6), ios(3.2))

Mac OS does have pthread_setname_np, but we can't use it here since it
only accepts a single argument, the thread name, and thus only works for
the current thread.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
5 years agoFix 'make clean' os Mac OS
Ruben Kerkhof [Tue, 22 Jan 2019 16:50:02 +0000 (17:50 +0100)]
Fix 'make clean' os Mac OS

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

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

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
5 years agoMerge pull request #3633 from opensourcerouting/send-vrf-backend
Donald Sharp [Tue, 22 Jan 2019 14:11:58 +0000 (09:11 -0500)]
Merge pull request #3633 from opensourcerouting/send-vrf-backend

Send VRF backend to the client daemons

5 years agoMerge pull request #3627 from manuhalo/fix_ospf_vl_del_master
Donald Sharp [Tue, 22 Jan 2019 14:08:04 +0000 (09:08 -0500)]
Merge pull request #3627 from manuhalo/fix_ospf_vl_del_master

ospfd: fix no virtual-link cmd

5 years agoMerge pull request #3636 from opensourcerouting/defpy-text-tokens
Donald Sharp [Tue, 22 Jan 2019 14:06:58 +0000 (09:06 -0500)]
Merge pull request #3636 from opensourcerouting/defpy-text-tokens

python: make DEFPY provide the text token of fixed parameters

5 years agoMerge pull request #3641 from opensourcerouting/rsock-ipv6-fix
Donald Sharp [Tue, 22 Jan 2019 13:57:16 +0000 (08:57 -0500)]
Merge pull request #3641 from opensourcerouting/rsock-ipv6-fix

zebra: fix a few problems with routing socket

5 years agozebra: use rta_getattr for NETMASK
Rafael Zalamena [Fri, 18 Jan 2019 20:28:58 +0000 (18:28 -0200)]
zebra: use rta_getattr for NETMASK

IPv6 uses AF_LINK to represent netmasks, this commit unbreaks
`rtm_read_mesg` that was broke on the `rta_get*` refactory.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 7a163a7c59bd1a7e94da356ea033040ae17cef29)

5 years agozebra: fix routing socket AF_LINK handling on NETMASK
Rafael Zalamena [Thu, 17 Jan 2019 22:46:11 +0000 (20:46 -0200)]
zebra: fix routing socket AF_LINK handling on NETMASK

IPv6 netmasks use AF_LINK family type and puts the correct amount of
set bits in the data structure. If we only copy the SDL header we
won't get all IPv6 address length, we must copy the whole extension of
the `sockaddr_in6` struct (which is provided in `destlen` parameter).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 691e903879bcf88c872d74f6317784bd2187f3ca)

5 years agozebra: remove unused functions
Rafael Zalamena [Thu, 17 Jan 2019 15:19:30 +0000 (13:19 -0200)]
zebra: remove unused functions

Remove two unused functions in `zebra/rt_socket.c`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 914fea09d9e1a5379b7ed9fa43b0505a091395af)

5 years agozebra: use proper sockaddr size in kernel_rtm
Rafael Zalamena [Thu, 17 Jan 2019 13:09:09 +0000 (11:09 -0200)]
zebra: use proper sockaddr size in kernel_rtm

`sockaddr` `len` field is the address type size and not the mask length.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit a6c000318226b9c3e5c3010ea31c6941ac1dff43)

5 years agoMerge pull request #3631 from opensourcerouting/zapi_fixes
Russ White [Tue, 22 Jan 2019 01:25:08 +0000 (20:25 -0500)]
Merge pull request #3631 from opensourcerouting/zapi_fixes

Small zapi fixes

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

Fix CLI issue introduced by the northbound + simplifications

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

zebra: fix routing socket debug messages

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

bgpd: do not crash when removing ip vpn entries

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

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

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agozebra: merge four "show ip nht" commands into a single DEFPY
Renato Westphal [Mon, 21 Jan 2019 14:47:10 +0000 (12:47 -0200)]
zebra: merge four "show ip nht" commands into a single DEFPY

This is mostly to be consistent with the "show ip import-check"
command, which is very similar.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agozebra: remove dead macro
Renato Westphal [Mon, 21 Jan 2019 14:39:35 +0000 (12:39 -0200)]
zebra: remove dead macro

This macro is not used since commit 078430f609e.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agozebra: consolidate how we indentify address-families in the NHT code
Renato Westphal [Mon, 21 Jan 2019 14:30:36 +0000 (12:30 -0200)]
zebra: consolidate how we indentify address-families in the NHT code

Favor usage of the afi_t enumeration to identify address-families
over using the classic AF_INET[6] constants for that. The choice to
use either of the two seems to be mostly arbitrary throughout our
code base, which leads to confusion and bugs like the one fixed by
commit 6f95d11a1. To address this problem, favor usage of the afi_t
enumeration whenever possible, since 1) it's an enumeration (helps
the compilers to catch some bugs), 2) has a safi_t sibling and 3)
can be used to index static arrays. AF_INET[6] should then be used
only when interfacing with the kernel or external libraries like
libc. The family2afi() and afi2family() functions can be used to
convert between the two different representations back and forth.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agopython: make DEFPY provide the text token of fixed parameters
Renato Westphal [Sat, 19 Jan 2019 19:24:09 +0000 (17:24 -0200)]
python: make DEFPY provide the text token of fixed parameters

In the CLI code, each cmd_token has both a "text" field, containing
the full token text (e.g. "unicast"), and an "arg" field,
containing the original text entered by the user (which might be
an abbreviation, like "uni" instead of "unicast").

To avoid the need to handle abbreviations, the recommended pattern
for DEFUN commands is to use the "text" value of fixed parameters
and the "arg" value of everything else.

Using DEFPY, however, the CLI parameters are automagically turned
into C variables which are initialized under the hood (so that
they're conveniently ready for use). The problem is that this
initialization was always using the "arg" value of the parameters,
which was leading to problems like these:

  debian# show ipv6 route isi
  Unknown route type
  debian#
  debian# conf t
  debian(config)# router isis 1
  debian(config-router)# redistribute ipv4 st level-1
  % Configuration failed.

  Invalid value "st" in "protocol" element.
  YANG path: /frr-isisd:isis/instance[area-tag='1']/redistribute/ipv4[protocol='st']/protocol

To fix these problems (and probably others too), make DEFPY commands
auto-detect the type of the input parameters and use either the
"arg" or "text" value from the cmd_tokens accordingly.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agozebra: make routing socket debug user friendlier
Rafael Zalamena [Thu, 17 Jan 2019 22:24:31 +0000 (20:24 -0200)]
zebra: make routing socket debug user friendlier

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

Example:

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

Instead of:

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

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

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

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

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

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

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

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agolib: remove the vrf_is_mapped_on_netns() function
Renato Westphal [Sat, 19 Jan 2019 19:19:13 +0000 (17:19 -0200)]
lib: remove the vrf_is_mapped_on_netns() function

Now that all daemons receive the VRF backend from zebra, we can get
rid of vrf_is_mapped_on_netns() in favor of using the more convenient
vrf_is_backend_netns() function, which doesn't require any argument.

This commit also fixes the following problem:
  debian(config)# ip route 50.0.0.0/8 blackhole vrf FAKE table 2
  % table param only available when running on netns-based vrfs

Even when zebra was started with the --vrfwnetns, the error
above would be displayed since the VRF FAKE didn't exist, which
would make vrf_is_mapped_on_netns() return 0 incorrectly. Using
vrf_is_backend_netns() this problem doesn't happen anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agozebra, lib: send VRF backend to the client daemons
Renato Westphal [Sat, 19 Jan 2019 19:19:13 +0000 (17:19 -0200)]
zebra, lib: send VRF backend to the client daemons

Add a new field in the ZEBRA_CAPABILITIES zapi message specifying
the VRF backend in use.

For simplicity, make the zclient code call vrf_configure_backend()
to apply the received value automatically instead of requiring
the daemons to do that themselves in their zebra_capabilities()
callbacks.

Additionally, call zebra_vrf_update_all() only after sending the
capabilities message to the client, so that it will know which VRF
backend is in use when processing the VRF messages.

This commit fixes a couple of bugs in the "interface" CLI command and
associated northbound callbacks, which behave differently depending
on the VRF backend in use. Before this commit, the vrf_backend
variable would always be set to VRF_BACKEND_NETNS in the client
daemons, even when zebra was started without the --vrfwnetns option.
This could lead to inconsistent behavior and subtle bugs under
specific circumstances.

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

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

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

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

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

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

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

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

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

ospfd: remove default originate max aged lsa

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

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

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

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

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

Bug found during code inspection.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>