]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
4 years agozebra: handle macvlan down event
Chirag Shah [Fri, 11 Oct 2019 18:42:12 +0000 (11:42 -0700)]
zebra: handle macvlan down event

Macvlan down event have sentinel check of its parent
link presence.

Ticket:CM-26622
Reviewed By:CCR-9326
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: fix self type-2 routes rmac and nexhtop
Chirag Shah [Thu, 24 Oct 2019 21:32:49 +0000 (14:32 -0700)]
bgpd: fix self type-2 routes rmac and nexhtop

For self type-2 routes, do not assign system-rmac
as attribute RMAC value if advertise-pip is disable
or macvlan is not present.

Ticket:CM-26923
Reviewed By:CCR-9397
Testing Done:

pip is disabled under bgp vrf2 instance.
Trigger frr-restart.

Before fix:
*> [2]:[0]:[48]:[00:02:00:00:00:2e]:[32]:[45.0.4.4]
                    36.0.0.11                          32768 i
                    ET:8 RT:5546:1004 RT:5546:4002 Rmac:00:02:00:00:00:2e

After fix:
*> [2]:[0]:[48]:[00:02:00:00:00:2e]:[32]:[45.0.4.4]
                    36.0.0.11                          32768 i
                    ET:8 RT:5546:1004 RT:5546:4002 Rmac:44:38:39:ff:ff:01

TOR# ifquery vlan1004
auto vlan1004
iface vlan1004
        address 45.0.4.4/24
        vlan-id 1004
        vrf vrf2

VNI: 4002 (known to the kernel)
  Type: L3
  Tenant VRF: vrf2
  RD: 45.0.6.4:3
  Originator IP: 36.0.0.11
  Advertise-pip: Yes
  System-IP: 27.0.0.11
  System-MAC: 00:02:00:00:00:2e
  Router-MAC: 44:38:39:ff:ff:01

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: evpn pip convert ntoa to ntop
Chirag Shah [Mon, 11 Nov 2019 22:59:08 +0000 (14:59 -0800)]
bgpd: evpn pip convert ntoa to ntop

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: print rmac and sys mac values
Chirag Shah [Tue, 15 Oct 2019 00:46:10 +0000 (17:46 -0700)]
zebra: print rmac and sys mac values

"show vrf vni" and "show evpn vni <l3vni>" commands
need to display correct router mac value.

"show evpn vni <l3vni>" detail l3vni needs to display
system mac as in PIP scenario value can be different.
Syste MAC would be derived from SVI interface MAC wherelse
Router MAC would be derived from macvlan interface MAC value.

Ticket:CM-26710
Reviewed By:CCR-9334
Testing Done:

TORC11# show evpn vni 4001
VNI: 4001
  Type: L3
  Tenant VRF: vrf1
  Local Vtep Ip: 36.0.0.11
  Vxlan-Intf: vx-4001
  SVI-If: vlan4001
  State: Up
  VNI Filter: none
  System MAC: 00:02:00:00:00:2e
  Router MAC: 44:38:39:ff:ff:01
  L2 VNIs: 1000
TORC11# show vrf vni
VRF     VNI    VxLAN IF   L3-SVI    State Rmac
vrf1    4001   vx-4001    vlan4001  Up    44:38:39:ff:ff:01

TORC11# show evpn vni 4001 json
{
  "vni":4001,
  "type":"L3",
  "localVtepIp":"36.0.0.11",
  "vxlanIntf":"vx-4001",
  "sviIntf":"vlan4001",
  "state":"Up",
  "vrf":"vrf1",
  "sysMac":"00:02:00:00:00:2e",
  "routerMac":"44:38:39:ff:ff:01",
  "vniFilter":"none",
  "l2Vnis":[
    1000,
  ]
}

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agodoc: evpn pip add documentation
Chirag Shah [Mon, 23 Sep 2019 00:46:46 +0000 (17:46 -0700)]
doc: evpn pip add documentation

Ticket:CM-26190
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusntworks.com>
4 years agobgpd: evpn pip display pip values
Chirag Shah [Wed, 11 Sep 2019 01:36:05 +0000 (18:36 -0700)]
bgpd: evpn pip display pip values

Display pip system mac and ip values
in per vni detail output.

Ticket:CM-26190
Reviewed By:
Testing Done:

Following new values add to the below output
for L3vni:

  System-IP: 27.0.0.11
  System-MAC: 00:02:00:00:00:2e
  Router-MAC: 44:38:39:ff:ff:01

TORC11# show bgp l2vpn evpn vni 4002
VNI: 4002 (known to the kernel)
  Type: L3
  Tenant VRF: vrf2
  RD: 141.2.1.2:2
  Originator IP: 36.0.0.11
  Advertise-gw-macip : n/a
  Advertise-pip: Yes
  System-IP: 27.0.0.11
  System-MAC: 00:02:00:00:00:2e
  Router-MAC: 44:38:39:ff:ff:01
  Import Route Target:
    5546:4002
  Export Route Target:
    5546:4002

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: evpn pip mac vlan up-down event
Chirag Shah [Fri, 6 Sep 2019 20:55:35 +0000 (13:55 -0700)]
zebra: evpn pip mac vlan up-down event

macvlan interface up/down event triggers
bgp to send updates for evpn routes
with changed RMAC and nexthop IP values.

Ticket:CM-26190
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: evpn pip handle svi ip route
Chirag Shah [Fri, 9 Aug 2019 01:58:03 +0000 (18:58 -0700)]
bgpd: evpn pip handle svi ip route

By default announct Self Type-2 routes with
system IP as nexthop and system MAC as
nexthop.

An API to check type-2 is self route via
checking ipv4/ipv6 address from connected interfaces list.

An API to extract RMAC and nexthop for type-2
routes based on advertise-svi-ip knob is enabled.

When advertise-pip is enabled/disabled, trigger type-2
route update. For self type-2 routes to use
anycast or individual (rmac, nexthop) addresses.

Ticket:CM-26190
Reviewed By:
Testing Done:

Enable 'advertise-svi-ip' knob in bgp default instance.
the vrf instance svi ip is advertised with nexthop
as default instance router-id and RMAC as system MAC.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: evpn pip parse vrr mac
Chirag Shah [Sun, 4 Aug 2019 23:51:33 +0000 (16:51 -0700)]
bgpd: evpn pip parse vrr mac

In L3VNI add callback parse, vrr rmac value.

For non-zero vrr mac value, use it as anycast RMAC
and svi mac as individual rmac value.

If advertise-pip is disable or vrr rmac is not present
use svi mac as anycast rmac value for all routes.

Ticket:CM-26190
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agozebra: evpn pip extract vrr mac
Chirag Shah [Fri, 2 Aug 2019 06:33:24 +0000 (23:33 -0700)]
zebra: evpn pip extract vrr mac

Extract mac-vlan interface mac when a l3vni add is sent to bgp

Per L3VNI maintain vrr interface.
An api to extract vrr mac address from a vlan id, associated
master svi device.

When a l3vni operational up event is sent to bgpd,
extract vrr rmac along with svi rmac.

Ticket:CM-26190
Reviewed By:
Testing Done:

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agobgpd: evpn pip data struct and cli
Chirag Shah [Thu, 18 Apr 2019 07:17:57 +0000 (10:17 +0300)]
bgpd: evpn pip data struct and cli

Evpn Primary IP advertisement feature uses
individual system IP and system MAC for prefix (type-5)
and self type-2 routes.

The PIP knob is enabled by default for bgp vrf instance.

Configuration CLI for enable/disable PIP feature knob.
User can configure PIP system IP and MAC to retain as
permanent values.

For the PIP IP, the default behavior is to accept bgp default
instance's router-id. When the default instance router-id change,
reflect PIP IP assignment.

Reflect type-5 to use system-IP and system MAC as nexthop and RMAC
values.

Ticket:CM-26190

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
4 years agoMerge pull request #5406 from lkrishnamoor/advertise-routes-bug2
Donatas Abraitis [Fri, 22 Nov 2019 14:09:22 +0000 (16:09 +0200)]
Merge pull request #5406 from lkrishnamoor/advertise-routes-bug2

bgpd: Blank RD in "sh bgp l2vpn evpn all neighbors ip advertised-routes json"

4 years agoMerge pull request #5328 from satheeshkarra/pim_mlag
Mark Stapp [Fri, 22 Nov 2019 13:51:47 +0000 (08:51 -0500)]
Merge pull request #5328 from satheeshkarra/pim_mlag

pimd, lib, zebra : PIM MLAG Support

4 years agoMerge pull request #5405 from sworleys/NHG-Respect-MPATH-Num
Mark Stapp [Fri, 22 Nov 2019 12:22:29 +0000 (07:22 -0500)]
Merge pull request #5405 from sworleys/NHG-Respect-MPATH-Num

zebra: Actually respect the multipath number

4 years agoMerge pull request #5404 from donaldsharp/bsd_null_routes
Rafael Zalamena [Fri, 22 Nov 2019 11:41:30 +0000 (08:41 -0300)]
Merge pull request #5404 from donaldsharp/bsd_null_routes

zebra: BSD null routes were not being installed

4 years agozebra: Fixing Comments in MLAG Read scheduling Events
Satheesh Kumar K [Fri, 22 Nov 2019 04:33:42 +0000 (20:33 -0800)]
zebra: Fixing Comments in MLAG Read scheduling Events

Zebra MLAG is using "t_read" for multiple tasks, such as

1. For opening Communication channel with MLAG
2. In case conncetion fails, same event is used for retries
3. after the connection establishment, same event is used to
   read the data from MLAG

since all these taks will never schedule together, this will not
cause any issues.

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
4 years agobgpd: Blank RD in "sh bgp l2vpn evpn all neighbors <ip> advertised-routes json"
Lakshman Krishnamoorthy [Thu, 21 Nov 2019 23:30:00 +0000 (15:30 -0800)]
bgpd: Blank RD in "sh bgp l2vpn evpn all neighbors <ip> advertised-routes json"

Bug: While preparing the JSON output, 2 loops are traversed: the outer loop
loops through RD, and the inner loop loops through the prefixes of that RD.

We hit the bug (printing blank RD and stale or null prefix info) when the inner
loop exits with nothing to print, (without allocating json_routes) and the outer
loop still tries to attach it to the parent, json_adv. Thus, we have
key=<BLANK RD>, value=<junk or prev json_routes>

The fix: Avoid attaching json_routes to the parent json if there
is nothing to print.

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
4 years agozebra: Set resolved inactive when > multipath_num
Stephen Worley [Thu, 21 Nov 2019 20:53:59 +0000 (15:53 -0500)]
zebra: Set resolved inactive when > multipath_num

Apparently the multipath_num functionatlity has been broken
for a while because we were ignoring the recusive nexthops
when marking them inactive based on it.

This sets them as inactive as well if the parent breaks it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: Use curr_active to check multipath_num
Stephen Worley [Thu, 21 Nov 2019 20:27:12 +0000 (15:27 -0500)]
zebra: Use curr_active to check multipath_num

We were re-counting the entire group's active number on
every iteration of this nexthop_active_update() loop.

This is not great from a performance perspective but also
it was failing to properly mark things according to the
specified multipath_num.

Since a nexthop is set as active before this check, if its == to
the set ecmp, it gets marked inactive even though if its
under the max ecmp wanted!

ex)

set ecmp to 1.
`/usr/lib/frr/zebra -e 1`

All kernel routes will be marked inactive even with just one nexthop!

K   1.1.1.1/32 [0/0] is directly connected, dummy1 inactive, 00:00:10
K   1.1.1.2/32 [0/0] is directly connected, dummy2 inactive, 00:00:10
K   1.1.1.3/32 [0/0] is directly connected, dummy3 inactive, 00:00:10
K   1.1.1.4/32 [0/0] is directly connected, dummy4 inactive, 00:00:10
K   1.1.1.5/32 [0/0] is directly connected, dummy5 inactive, 00:00:10
K   1.1.1.6/32 [0/0] is directly connected, dummy6 inactive, 00:00:10
K   1.1.1.7/32 [0/0] is directly connected, dummy7 inactive, 00:00:10
K   1.1.1.8/32 [0/0] is directly connected, dummy8 inactive, 00:00:10
K   1.1.1.9/32 [0/0] is directly connected, dummy9 inactive, 00:00:10

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
4 years agozebra: BSD null routes were not being installed
Donald Sharp [Thu, 21 Nov 2019 14:37:36 +0000 (09:37 -0500)]
zebra: BSD null routes were not being installed

On BSD systems null routes were not being installed into the
kernel.  This is because commit 08ea27d1121ef5989cdc54fb178c05a7efc4cd3e
introduced a bug where we were attempting to use the wrong
prefix afi types and as such we were going down the v6 code path.

test27.lab.netdef.org# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued route, r - rejected route
K>* 0.0.0.0/0 [0/0] via 192.168.122.1, 00:00:23
S>* 4.5.6.8/32 [1/0] unreachable (blackhole), 00:00:11
C>* 192.168.122.0/24 [0/1] is directly connected, vtnet0, 00:00:23
test27.lab.netdef.org# exit
[ci@test27 ~/frr]$ netstat -rn
Routing tables
Internet:
Destination        Gateway            Flags     Netif Expire
default            192.168.122.1      UGS      vtnet0
4.5.6.8/32         127.0.0.1          UG1B        lo0
127.0.0.1          link#2             UH          lo0
192.168.122.0/24   link#1             U        vtnet0
192.168.122.108    link#1             UHS         lo0

Fixes: #4843
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5398 from taspelund/missed_newline
Donatas Abraitis [Thu, 21 Nov 2019 07:34:01 +0000 (09:34 +0200)]
Merge pull request #5398 from taspelund/missed_newline

staticd: remove unneeded newline from zlog call

4 years agostaticd: remove unneeded newline from zlog call
Trey Aspelund [Wed, 20 Nov 2019 21:23:02 +0000 (16:23 -0500)]
staticd: remove unneeded newline from zlog call

PR 5303 was merged before the newline was removed from the zlog call.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
4 years agoMerge pull request #5250 from bisdhdh/bgp_nexthop_hash
Donatas Abraitis [Wed, 20 Nov 2019 18:52:12 +0000 (20:52 +0200)]
Merge pull request #5250 from bisdhdh/bgp_nexthop_hash

bgpd: Implementing a hash table for connected address - ipv4/ipv6

4 years agoMerge pull request #5381 from donaldsharp/zebra_100_is_no_good
Mark Stapp [Wed, 20 Nov 2019 12:35:03 +0000 (07:35 -0500)]
Merge pull request #5381 from donaldsharp/zebra_100_is_no_good

zebra: Router Advertisement socket mess up

4 years agoMerge pull request #5383 from donaldsharp/pim_buffer_fun
Donatas Abraitis [Wed, 20 Nov 2019 11:54:36 +0000 (13:54 +0200)]
Merge pull request #5383 from donaldsharp/pim_buffer_fun

pimd: Various buffer overflow reads and crashes

4 years agoMerge pull request #5385 from donaldsharp/nhrp_doc_update
Donatas Abraitis [Wed, 20 Nov 2019 09:21:04 +0000 (11:21 +0200)]
Merge pull request #5385 from donaldsharp/nhrp_doc_update

doc: Fix nhrp doc issue

4 years agopimd: fix bsm buflen check to include pim hdr
Quentin Young [Wed, 20 Nov 2019 02:47:40 +0000 (21:47 -0500)]
pimd: fix bsm buflen check to include pim hdr

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agodoc: Fix nhrp doc issue
Donald Sharp [Wed, 20 Nov 2019 02:42:13 +0000 (21:42 -0500)]
doc: Fix nhrp doc issue

The link to the strong swan patches was mumble snumped.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Various buffer overflow reads and crashes
Donald Sharp [Wed, 20 Nov 2019 00:36:19 +0000 (19:36 -0500)]
pimd: Various buffer overflow reads and crashes

A variety of buffer overflow reads and crashes
that could occur if you fed bad info into pim.

1) When type is setup incorrectly we were printing the first 8 bytes
of the pim_parse_addr_source, but the min encoding length is
4 bytes.  As such we will read beyond end of buffer.

2) The RP(pim, grp) macro can return a NULL value
Do not automatically assume that we can deref
the data.

3) BSM parsing was not properly sanitizing data input from wire
and we could enter into situations where we would read beyond
the end of the buffer.  Prevent this from happening, we are
probably left in a bad way.

4) The received bit length cannot be greater than 32 bits,
refuse to allow it to happen.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5372 from opensourcerouting/snap-vrrpd
Donald Sharp [Tue, 19 Nov 2019 22:47:03 +0000 (17:47 -0500)]
Merge pull request #5372 from opensourcerouting/snap-vrrpd

snapcraft: Add vrrpd to the snapcraft package

4 years agoMerge pull request #5224 from manuhalo/fix_frr_reload_paths
Quentin Young [Tue, 19 Nov 2019 22:12:38 +0000 (17:12 -0500)]
Merge pull request #5224 from manuhalo/fix_frr_reload_paths

Fixes and extensions to frr_reload.py

4 years agozebra: Router Advertisement socket mess up
Donald Sharp [Tue, 19 Nov 2019 20:46:42 +0000 (15:46 -0500)]
zebra: Router Advertisement socket mess up

The code for when a new vrf is created to properly handle
router advertisement for it is messed up in several ways:

1) Generation of the zrouter data structure should set the rtadv
socket to -1 so that we don't accidently close someone elses
open file descriptor
2) When you created a new zvrf instance *after* bootup we are XCALLOC'ing
the data structure so the zvrf->fd was 0.  The shutdown code was looking
for the >= 0 to know if the fd existed (since fd 0 is valid!)

This sequence of events would cause zebra to consume 100% of the
cpu:

Run zebra by itself ( no other programs )
ip link add vrf1 type vrf table 1003
ip link del vrf vrf1
vtysh -c "configure" -c "no interface vrf1"

This commit fixes this issue.

Fixes: #5376
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agobgpd: Implementing a hash table for connected address - ipv4/ipv6
bisdhdh [Wed, 30 Oct 2019 09:42:25 +0000 (15:12 +0530)]
bgpd: Implementing a hash table for connected address - ipv4/ipv6

* IPv6 routes received via a ibgp session with one of its own interface as
nexthop are getting installed in the BGP table.
*A common table to be implemented should take cares of both
ipv4 and ipv6 connected addresses.

Signed-off-by: Biswajit Sadhu sadhub@vmware.com
4 years agoMerge pull request #5377 from dslicenc/tools-bfd-timer-fix
Sri Mohana Singamsetty [Tue, 19 Nov 2019 18:35:35 +0000 (10:35 -0800)]
Merge pull request #5377 from dslicenc/tools-bfd-timer-fix

tools: resolve issue with bfd timer change fix in frr-reload.py

4 years agoMerge pull request #5375 from donaldsharp/pim_packet_issues
Sri Mohana Singamsetty [Tue, 19 Nov 2019 18:31:47 +0000 (10:31 -0800)]
Merge pull request #5375 from donaldsharp/pim_packet_issues

pimd: Fix possible read beyond end of data received

4 years agoMerge pull request #5292 from donaldsharp/ospf_vrf_data
Rafael Zalamena [Tue, 19 Nov 2019 18:29:11 +0000 (15:29 -0300)]
Merge pull request #5292 from donaldsharp/ospf_vrf_data

Ospf vrf data

4 years agozebra,pim : Fixing Review comments in PIM_MLAG
Satheesh Kumar K [Mon, 18 Nov 2019 15:13:30 +0000 (07:13 -0800)]
zebra,pim : Fixing Review comments in PIM_MLAG

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
4 years agoMerge pull request #5241 from sworleys/SA-NHG
Russ White [Tue, 19 Nov 2019 16:44:15 +0000 (11:44 -0500)]
Merge pull request #5241 from sworleys/SA-NHG

One More Zebra NHG SA Fix and nhg_ctx API Adjustment

4 years agoMerge pull request #5274 from opensourcerouting/bfdd-vrf-socket
Russ White [Tue, 19 Nov 2019 16:41:06 +0000 (11:41 -0500)]
Merge pull request #5274 from opensourcerouting/bfdd-vrf-socket

bfdd: VRF security improvement

4 years agoMerge pull request #5285 from ton31337/fix/send_BGP_NOTIFY_CEASE_PEER_UNCONFIG_after_...
Russ White [Tue, 19 Nov 2019 16:39:13 +0000 (11:39 -0500)]
Merge pull request #5285 from ton31337/fix/send_BGP_NOTIFY_CEASE_PEER_UNCONFIG_after_no_neighbor

bgpd: Notify "Peer De-configured" after entering 'no neighbor <neighb…

4 years agoMerge pull request #5257 from ton31337/fix/update_rib_on_bgp_distance_changes
Sri Mohana Singamsetty [Tue, 19 Nov 2019 16:35:57 +0000 (08:35 -0800)]
Merge pull request #5257 from ton31337/fix/update_rib_on_bgp_distance_changes

bgpd: Reflect the distance in RIB when it is changed for an arbitrary afi/safi

4 years agoMerge pull request #5371 from pguibert6WIND/filter_no_form
Russ White [Tue, 19 Nov 2019 16:21:20 +0000 (11:21 -0500)]
Merge pull request #5371 from pguibert6WIND/filter_no_form

lib: no filter operations fix on appropriate access-list name

4 years agoMerge pull request #5361 from donaldsharp/fpm_crash
Russ White [Tue, 19 Nov 2019 15:30:43 +0000 (10:30 -0500)]
Merge pull request #5361 from donaldsharp/fpm_crash

zebra: FPM should have a way of shutting down

4 years agotools: resolve issue with bfd timer change fix in frr-reload.py
Don Slice [Tue, 19 Nov 2019 13:03:51 +0000 (05:03 -0800)]
tools: resolve issue with bfd timer change fix in frr-reload.py

Found that while the previous fix solved the traceback and created
the correct configuration, it was doing a delete/add process rather
than just an add.  This was due to an incorrectly created search
string. This commit fixes that search string and testing verifies
that the correct thing is now being done.

Ticket: CM-27233
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agopimd: Fix possible read beyond end of data received
Donald Sharp [Tue, 19 Nov 2019 13:22:50 +0000 (08:22 -0500)]
pimd: Fix possible read beyond end of data received

If a register packet is received that is less than the PIM_MSG_REGISTER_LEN
in size we can have a possible situation where the data being
checksummed is just random data from the buffer we read into.

2019/11/18 21:45:46 warnings: PIM: int pim_if_add_vif(struct interface *, _Bool, _Bool): could not get address for interface fuzziface ifindex=0
==27636== Invalid read of size 4
==27636==    at 0x4E6EB0D: in_cksum (checksum.c:28)
==27636==    by 0x4463CC: pim_pim_packet (pim_pim.c:194)
==27636==    by 0x40E2B4: main (pim_main.c:117)
==27636==  Address 0x771f818 is 0 bytes after a block of size 24 alloc'd
==27636==    at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27636==    by 0x40E261: main (pim_main.c:112)
==27636==

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospfd: Rework ospf_read_packet into 2 functions
Donald Sharp [Tue, 19 Nov 2019 13:09:56 +0000 (08:09 -0500)]
ospfd: Rework ospf_read_packet into 2 functions

The indentation level for ospf_read was starting to be pretty
extremene.  Rework into 2 functions for improved readability.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5364 from lkrishnamoor/prefix_route_bugfix
Donatas Abraitis [Tue, 19 Nov 2019 13:00:08 +0000 (15:00 +0200)]
Merge pull request #5364 from lkrishnamoor/prefix_route_bugfix

bgpd: Bug fix in "show bgp l2vpn evpn X:X::X:X/M"

4 years agoospfd: Allow packet reads based upon read/write packet counts
Donald Sharp [Thu, 7 Nov 2019 04:04:32 +0000 (23:04 -0500)]
ospfd: Allow packet reads based upon read/write packet counts

Read in up to 20(ospf write-multipler X) packets, for handling of data.

This improves performance because we allow ospf to have a bit more data
to work on in one go for spf calculations instead of 1 packet at a time.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospfd: The ip header dump is crazy long and useless
Donald Sharp [Thu, 7 Nov 2019 01:17:29 +0000 (20:17 -0500)]
ospfd: The ip header dump is crazy long and useless

Turning on packet debugs and seeing a header dump that is 11
lines long is useless

2019/11/07 01:07:05.941798 OSPF: ip_v 4
2019/11/07 01:07:05.941806 OSPF: ip_hl 5
2019/11/07 01:07:05.941813 OSPF: ip_tos 192
2019/11/07 01:07:05.941821 OSPF: ip_len 68
2019/11/07 01:07:05.941831 OSPF: ip_id 48576
2019/11/07 01:07:05.941838 OSPF: ip_off 0
2019/11/07 01:07:05.941845 OSPF: ip_ttl 1
2019/11/07 01:07:05.941857 OSPF: ip_p 89
2019/11/07 01:07:05.941865 OSPF: ip_sum 0xcf33
2019/11/07 01:07:05.941873 OSPF: ip_src 200.254.30.14
2019/11/07 01:07:05.941882 OSPF: ip_dst 224.0.0.5

We already have this debugged, it's not going to change and the
end developer can stick this back in if needed by hand to debug
something that is not working properly.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospfd: Add/fix some debugs to handle vrf
Donald Sharp [Thu, 7 Nov 2019 00:49:06 +0000 (19:49 -0500)]
ospfd: Add/fix some debugs to handle vrf

This commit has:
The received packet path in ospf, had absolutely no debugs associated with
it.  This makes it extremely hard to know when we receive packets for
consumption.  Add some breadcrumbs to this end.

Large chunks of commands have no ability to debug what is happening
in what vrf.  With ip overlap X vrf this becomes a bit of a problem
Add some breadcrumbs here.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospfd: Add a function to return the name of the vrf we are in.
Donald Sharp [Tue, 12 Nov 2019 19:17:14 +0000 (14:17 -0500)]
ospfd: Add a function to return the name of the vrf we are in.

Add a helper function to return the name of the vrf we are in
so it can be used as part of debug strings.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoospfd: Remove ORIGINAL_CODING check
Donald Sharp [Wed, 6 Nov 2019 22:12:51 +0000 (17:12 -0500)]
ospfd: Remove ORIGINAL_CODING check

We have a bunch of places that look for ORIGINAL_CODING.  There is
nothing in our configure system to define this value and a quick
git blame shows this code as being original to the import a very
very long time ago.  This is dead code, removing.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agolib: no filter operations fix on appropriate access-list name
Philippe Guibert [Mon, 18 Nov 2019 11:05:47 +0000 (12:05 +0100)]
lib: no filter operations fix on appropriate access-list name

some vty no operations were not removing the entry of the access-list,
since the access-list name was not retrieved correctly. the index was
not correct for 'no ipv6 access-list WORD' operations, but also for one 'no
access-list WORD [..] any' operation.

PR=66244
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Acked-by: Alain Ritoux <alain.ritoux@6wind.com>
4 years agosnapcraft: Add vrrpd to the snapcraft package
Martin Winter [Sat, 9 Nov 2019 15:27:04 +0000 (16:27 +0100)]
snapcraft: Add vrrpd to the snapcraft package

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
4 years agoMerge pull request #5354 from mitch-skiba/addpath-fix
Donatas Abraitis [Tue, 19 Nov 2019 06:38:59 +0000 (08:38 +0200)]
Merge pull request #5354 from mitch-skiba/addpath-fix

bgpd: Fix per afi/safi addpath peer counting

4 years agobgpd: Bug fix in "show bgp l2vpn evpn X:X::X:X/M"
Lakshman Krishnamoorthy [Tue, 19 Nov 2019 02:20:21 +0000 (18:20 -0800)]
bgpd: Bug fix in "show bgp l2vpn evpn X:X::X:X/M"

The CLI was not parsing prefix format of ipv6 address.
This fixes the bug: https://github.com/FRRouting/frr/issues/5322

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
4 years agoMerge pull request #5294 from chiragshah6/evpn_dev
Sri Mohana Singamsetty [Mon, 18 Nov 2019 21:32:46 +0000 (13:32 -0800)]
Merge pull request #5294 from chiragshah6/evpn_dev

zebra: evpn update remote rmac and nexhop

4 years agozebra: FPM should have a way of shutting down
Donald Sharp [Mon, 18 Nov 2019 19:38:39 +0000 (14:38 -0500)]
zebra: FPM should have a way of shutting down

When we shut down zebra, we were not doing anything to shut
down the FPM.  Perform the necessary occult rituals and
stop the threads from running during early shutdown.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5360 from donaldsharp/pim_crash_rp
Jafar Al-Gharaibeh [Mon, 18 Nov 2019 19:43:14 +0000 (13:43 -0600)]
Merge pull request #5360 from donaldsharp/pim_crash_rp

Pim crash rp

4 years agobgpd: Fix per afi/safi addpath peer counting
Mitch Skiba [Thu, 14 Nov 2019 19:28:23 +0000 (19:28 +0000)]
bgpd: Fix per afi/safi addpath peer counting

The total_peercount table was created as a short cut for queries about
if addpath was enabled at all on a particular afi/safi. However, the
values weren't updated, so BGP would act as if addpath wasn't enabled
when determining if updates should be sent out. The error in behavior
was much more noticeable in tx-all than best-per-as, since changes in
what is sent by best-per-as would often trigger updates even if addpath
wasn't enabled.

Signed-off-by: Mitchell Skiba <mskiba@amazon.com>
4 years agoMerge pull request #5359 from donaldsharp/pim_rp_static
Donatas Abraitis [Mon, 18 Nov 2019 17:31:43 +0000 (19:31 +0200)]
Merge pull request #5359 from donaldsharp/pim_rp_static

pimd: Tighten up `show ip pim rp-info`

4 years agopimd: Create pimreg interface when we start any interface config
Donald Sharp [Mon, 18 Nov 2019 16:43:52 +0000 (11:43 -0500)]
pimd: Create pimreg interface when we start any interface config

When you configure interface configuration without explicitly
configuring pim on that interface, we were not creating the pimreg
interface and as such we would crash in an attempted register
since the pimreg device is non-existent.

The crash is this:
==8823== Invalid read of size 8
==8823==    at 0x468614: pim_channel_add_oif (pim_oil.c:392)
==8823==    by 0x46D0F1: pim_register_join (pim_register.c:61)
==8823==    by 0x449AB3: pim_mroute_msg_nocache (pim_mroute.c:242)
==8823==    by 0x449AB3: pim_mroute_msg (pim_mroute.c:661)
==8823==    by 0x449AB3: mroute_read (pim_mroute.c:707)
==8823==    by 0x4FC0676: thread_call (thread.c:1549)
==8823==    by 0x4EF3A2F: frr_run (libfrr.c:1064)
==8823==    by 0x40DCB5: main (pim_main.c:162)
==8823==  Address 0xc8 is not stack'd, malloc'd or (recently) free'd

pim_register_join calls pim_channel_add_oif with:

pim_channel_add_oif(up->channel_oil, pim->regiface,
    PIM_OIF_FLAG_PROTO_PIM);

We just need to make srue pim->regiface exists once we start configuring
pim.

Fixes: #5358
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Dissallow obvious addresses from being the RP
Donald Sharp [Mon, 18 Nov 2019 15:48:49 +0000 (10:48 -0500)]
pimd: Dissallow obvious addresses from being the RP

When configuring a RP, dissallow the choice of 0.0.0.0 or
255.255.255.255 as the address as that they make no sense
what so ever.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agopimd: Tighten up `show ip pim rp-info`
Donald Sharp [Mon, 18 Nov 2019 14:05:55 +0000 (09:05 -0500)]
pimd: Tighten up `show ip pim rp-info`

We were adding a newline for the source in some cases
but not others and tighten up the display of data

eva# show ip pim rp-info
RP address       group/prefix-list   OIF               I am RP    Source
10.254.0.1       224.0.0.0/4         lo                yes        Static
4.4.4.4          225.1.2.3/32        abcdefghijklmno   yes        Static
10.0.20.45       226.200.100.100/32  r1-eth0           no         Static
eva#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
4 years agoMerge pull request #5334 from adharkar/frr-master-nexthop_check
Donatas Abraitis [Mon, 18 Nov 2019 07:57:01 +0000 (09:57 +0200)]
Merge pull request #5334 from adharkar/frr-master-nexthop_check

bgpd: Add nexthop of received EVPN RT-5 for nexthop tracking

4 years agoMerge pull request #5357 from qlyoung/doc-overview-cleanup
Donatas Abraitis [Sun, 17 Nov 2019 09:03:13 +0000 (11:03 +0200)]
Merge pull request #5357 from qlyoung/doc-overview-cleanup

doc: clean up overview.rst

4 years agodoc: add link to developer docs
Quentin Young [Sun, 17 Nov 2019 02:46:49 +0000 (21:46 -0500)]
doc: add link to developer docs

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agodoc: clean up overview.rst
Quentin Young [Sun, 17 Nov 2019 02:25:19 +0000 (21:25 -0500)]
doc: clean up overview.rst

Move the "how to get" blurb to a more obvious place and include a link
to the apt repo.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
4 years agoMerge pull request #5327 from lkrishnamoor/rm_rd_filter
Donatas Abraitis [Sat, 16 Nov 2019 06:55:24 +0000 (08:55 +0200)]
Merge pull request #5327 from lkrishnamoor/rm_rd_filter

bgpd: route-map support for evpn RD filter

4 years agoMerge pull request #5312 from chiragshah6/evpn_dev2
Sri Mohana Singamsetty [Fri, 15 Nov 2019 23:39:53 +0000 (15:39 -0800)]
Merge pull request #5312 from chiragshah6/evpn_dev2

bgpd: fix memory leak in vni-vrf route tables for evpn routes

4 years agoMerge pull request #5335 from opensourcerouting/ldpd-buffer-overflow
Sri Mohana Singamsetty [Fri, 15 Nov 2019 23:37:33 +0000 (15:37 -0800)]
Merge pull request #5335 from opensourcerouting/ldpd-buffer-overflow

ldpd: add missing sanity check in the parsing of label messages

4 years agobgpd: Add nexthop of received EVPN RT-5 for nexthop tracking
Ameya Dharkar [Thu, 14 Nov 2019 00:46:56 +0000 (16:46 -0800)]
bgpd: Add nexthop of received EVPN RT-5 for nexthop tracking

Problem statement:
When IPv4/IPv6 prefixes are received in BGP, bgp_update function registers the
nexthop of the route with nexthop tracking module. The BGP route is marked as
valid only if the nexthop is resolved.

Even for EVPN RT-5, route should be marked as valid only if the the nexthop is
resolvable.

Code changes:
1. Add nexthop of EVPN RT-5 for nexthop tracking. Route will be marked as valid
only if the nexthop is resolved.
2. Only the valid EVPN routes are imported to the vrf.
3. When nht update is received in BGP, make sure that the EVPN routes are
imported/unimported based on the route becomes valid/invalid.

Testcases:
1. At rtr-1, advertise EVPN RT-5 with a nexthop 10.100.0.2.
10.100.0.2 is resolved at rtr-2 in default vrf.
At rtr-2, remote EVPN RT-5 should be marked as valid and should be imported into
vrfs.

2. Make the nexthop 10.100.0.2 unreachable at rtr-2
Remote EVPN RT-5 should be marked as invalid and should be unimported from the
vrfs. As this code change deals with EVPN type-5 routes only, other EVPN routes
should be valid.

3. At rtr-2, add a static route to make nexthop 10.100.0.2 reachable.
EVPN RT-5 should again become valid and should be imported into the vrfs.

Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
4 years agoMerge pull request #5303 from taspelund/special_interface_error
Rafael Zalamena [Fri, 15 Nov 2019 16:35:13 +0000 (13:35 -0300)]
Merge pull request #5303 from taspelund/special_interface_error

staticd: Make blackhole keyword errors more straightforward

4 years agoMerge pull request #5330 from dslicenc/tools-bfd-timers
Donatas Abraitis [Fri, 15 Nov 2019 13:12:18 +0000 (15:12 +0200)]
Merge pull request #5330 from dslicenc/tools-bfd-timers

tools: stop repeating lines to delete for multiple bfd timer changes

4 years agoMerge pull request #5320 from donaldsharp/pim_igmp_ignore_from_ourself
Donatas Abraitis [Fri, 15 Nov 2019 12:41:52 +0000 (14:41 +0200)]
Merge pull request #5320 from donaldsharp/pim_igmp_ignore_from_ourself

Pim igmp ignore from ourself

4 years agoMerge pull request #5351 from ton31337/fix/add_missing_whitespace
Donald Sharp [Fri, 15 Nov 2019 12:38:07 +0000 (07:38 -0500)]
Merge pull request #5351 from ton31337/fix/add_missing_whitespace

bgpd: Add missing whitespace in update_subgroup_remove_peer_internal()

4 years agoMerge pull request #5324 from lkrishnamoor/advertise-routes-bug
Donatas Abraitis [Fri, 15 Nov 2019 12:08:43 +0000 (14:08 +0200)]
Merge pull request #5324 from lkrishnamoor/advertise-routes-bug

bgpd: Bug fix in "show bgp l2vpn evpn ... advertised-routes'

4 years agobgpd: Add missing whitespace in update_subgroup_remove_peer_internal()
Donatas Abraitis [Fri, 15 Nov 2019 09:09:17 +0000 (11:09 +0200)]
bgpd: Add missing whitespace in update_subgroup_remove_peer_internal()

Before the fix:

2019/11/14 19:52:21 BGP: peer 192.168.2.5 deleted from subgroup s4peer
cnt 0 - missing space after s4 before peer

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agostaticd: Make blackhole keyword errors more straightforward
Trey Aspelund [Fri, 8 Nov 2019 21:51:36 +0000 (16:51 -0500)]
staticd: Make blackhole keyword errors more straightforward

Previous error was misleading and made it seem like Null0,
reject, or blackhole nexthops on static routes are invalid.
This commit makes it more clear as to why the error is seen.

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
4 years agoMerge pull request #5342 from satheeshkarra/ospf_dbgs
Sri Mohana Singamsetty [Thu, 14 Nov 2019 22:17:36 +0000 (14:17 -0800)]
Merge pull request #5342 from satheeshkarra/ospf_dbgs

ospfd: Adding Debugs to Track OSPF DD Exchange

4 years agobgpd: route-map support for evpn RD filter
Lakshman Krishnamoorthy [Wed, 13 Nov 2019 00:51:24 +0000 (16:51 -0800)]
bgpd: route-map support for evpn RD filter

With this code change, we can now filter evpn routes based on RD using the
match statement: "match evpn rd XX"

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
4 years agoMerge pull request #5300 from ton31337/feature/add_a_test_case_for_sender-as-path...
Rafael Zalamena [Thu, 14 Nov 2019 19:14:11 +0000 (16:14 -0300)]
Merge pull request #5300 from ton31337/feature/add_a_test_case_for_sender-as-path-loop-detection

tests: Add a test case for `sender-as-path-loop-detection`

4 years agoMerge pull request #5345 from mjstapp/fix_bfd_packet_sa
Rafael Zalamena [Thu, 14 Nov 2019 19:10:38 +0000 (16:10 -0300)]
Merge pull request #5345 from mjstapp/fix_bfd_packet_sa

bfdd: remove unused initialization sa warning

4 years agoMerge pull request #5276 from donaldsharp/pim_double
Jafar Al-Gharaibeh [Thu, 14 Nov 2019 15:38:44 +0000 (09:38 -0600)]
Merge pull request #5276 from donaldsharp/pim_double

pimd: No need to add then remove the oif if not DR

4 years agobfdd: remove unused initialization sa warning
Mark Stapp [Thu, 14 Nov 2019 13:29:09 +0000 (08:29 -0500)]
bfdd: remove unused initialization sa warning

There's a variable initialization that's triggering an SA
warning - don't do that.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
4 years agoospfd: Adding Debugs to dump OSPF DD Seqnumber
Satheesh Kumar K [Fri, 8 Nov 2019 06:00:33 +0000 (22:00 -0800)]
ospfd: Adding Debugs to dump OSPF DD Seqnumber

Recently Lot of issues are seen in  OSPF adjacnecy establishements,
sessions was tear down because of DD Sequence Number mismatch.

adding Debugs to capture Master & slave generated sequence numbers.

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
4 years agotests: Test if `distance bgp (1-255) (1-255) (1-255)` works
Donatas Abraitis [Thu, 31 Oct 2019 09:17:45 +0000 (11:17 +0200)]
tests: Test if `distance bgp (1-255) (1-255) (1-255)` works

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agoZebra: ADD Protobuf Encoding & Decoding for MLAG Messages
Satheesh Kumar K [Tue, 12 Nov 2019 09:41:04 +0000 (01:41 -0800)]
Zebra: ADD Protobuf Encoding & Decoding for MLAG Messages

1. add the Mlag ProtoBuf Lib to Zebra Compilation
2. Encode the messages with protobuf before writing to MLAG
3. Decode the MLAG Messages using protobuf and write to clients
   based on their subscrption.

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
4 years agolib,mlag : Defining MLAG Proto file
Satheesh Kumar K [Tue, 12 Nov 2019 09:27:52 +0000 (01:27 -0800)]
lib,mlag : Defining MLAG Proto file

Defining the message structures between Zebra & MLAG

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
4 years agoZebra: adding support for Zebra MLAG Functionality
Satheesh Kumar K [Tue, 12 Nov 2019 08:40:35 +0000 (00:40 -0800)]
Zebra: adding support for Zebra MLAG Functionality

This includes:
1. Processing client Registrations for MLAG
2. storing client Interests for MLAG updates
3. Opening communication channel to MLAG  with First client reg
4. Closing Communication channel with last client De-reg
5. Spawning a new thread for handling MLAG updates peocessing
6. adding Test code
7. advertising MLAG Updates to clients based on their interests

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
4 years agopimd, lib: adding support for MLAG Message processing at PIM
Satheesh Kumar K [Tue, 12 Nov 2019 08:17:13 +0000 (00:17 -0800)]
pimd, lib: adding support for MLAG Message processing at PIM

This includes:
1. Defining message formats
2. Stream Decoding after receiving the message at PIM
3. Handling MLAG UP & Down Notifications

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
4 years agopimd : Add support for MLAG Register & Un-register
Satheesh Kumar K [Tue, 12 Nov 2019 06:36:17 +0000 (22:36 -0800)]
pimd : Add support for MLAG Register & Un-register

when ever a FRR Client wants to send any data to another node
using MLAG Channel, uses below mechanisam.

1. sends  a MLAG Registration to zebra with interested messages that
   it is intended to receive from peer.
2. In response to this request, Zebra opens communication channel with
   MLAG. and also in Rx. diretion zebra forwards only those messages which
   client shown interest during registration
3. when client is no-longer interested in communicating with MLAG, client
   posts De-register to Zebra
4. if this is the last client which is interested for MLAG Communication,
   zebra closes the channel.

why PIM Needs MLAG Communication
================================
1. In general on LAN Networks elecetd DR will send the Join towards
   Multicast RP in case of a LHR and Register in case of FHR.
2. But in case DR Goes down, traffic will be re-converged only after
   the New DR is elected, but this can take time based on Hold Timer to
   detect the DR down.
3. this can be optimised by using MLAG Mecganisam.
4. and also Traffic can be forwarded more efficiently by knowing the cost
   towards RP using MLAG

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
4 years agoMerge pull request #5309 from donaldsharp/install_nhg_kernel
Sri Mohana Singamsetty [Thu, 14 Nov 2019 01:00:51 +0000 (17:00 -0800)]
Merge pull request #5309 from donaldsharp/install_nhg_kernel

zebra: Allow zebra to install nexthop groups into linux kernel

4 years agoldpd: add missing sanity check in the parsing of label messages
Renato Westphal [Thu, 14 Nov 2019 00:51:06 +0000 (21:51 -0300)]
ldpd: add missing sanity check in the parsing of label messages

Validate that the FEC prefix length is within the allowed limit
(depending on the FEC address family) in order to prevent possible
buffer overflows.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
4 years agoMerge pull request #5321 from sworleys/Zebra-Dplane-Thread-Cancel-Async
Mark Stapp [Wed, 13 Nov 2019 21:46:36 +0000 (16:46 -0500)]
Merge pull request #5321 from sworleys/Zebra-Dplane-Thread-Cancel-Async

zebra: dplane cancel update thread from correct pthread

4 years agoMerge pull request #5315 from sworleys/SR-Zebra-NHG-Fixes
Mark Stapp [Wed, 13 Nov 2019 16:54:02 +0000 (11:54 -0500)]
Merge pull request #5315 from sworleys/SR-Zebra-NHG-Fixes

zebra: Some Zebra_NHG fixes found with the ISIS-SR topotests

4 years agotools: stop repeating lines to delete for multiple bfd timer changes
Don Slice [Mon, 11 Nov 2019 20:45:32 +0000 (15:45 -0500)]
tools: stop repeating lines to delete for multiple bfd timer changes

Problem reported with tracebacks seen when making multiple bfd timer
changes in frr.conf and applying via frr-reload.py.  Found that when
multiple bfd timer changes are made, the same line can be added for
deletion more than once, causing the traceback when the deletion is
performed.  This fix verifies the correct line is being appended for
deletion.

Ticket: CM-27233
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
4 years agotests: Add a test case for `sender-as-path-loop-detection`
Donatas Abraitis [Fri, 8 Nov 2019 14:18:12 +0000 (16:18 +0200)]
tests: Add a test case for `sender-as-path-loop-detection`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
4 years agobgpd: Bug fix in "show bgp l2vpn evpn ... advertised-routes'
Lakshman Krishnamoorthy [Tue, 12 Nov 2019 22:02:05 +0000 (14:02 -0800)]
bgpd: Bug fix in "show bgp l2vpn evpn ... advertised-routes'

The bug:
As part of displaying advertised routes to a peer, in the outer loop, we
iterate through all prefixes in the evpn table. In the inner loop,
we iterate through adj_out of each prefix.

If a prefix which is present in the evpn table is not advertised to a peer,
its corresponding attr == NULL. Checking for this condition is the fix.

Signed-off-by: Lakshman Krishnamoorthy <lkrishnamoor@vmware.com>
4 years agozebra: dplane cancel update thread from correct pthread
Stephen Worley [Tue, 12 Nov 2019 19:56:56 +0000 (14:56 -0500)]
zebra: dplane cancel update thread from correct pthread

This code is called from the zebra main pthread during shutdown
but the thread event is scheduled via the zebra dplane pthread.

Hence, we should be using the `thread_cancel_async()` API to
cancel the thread event on a different pthread.

This is only ever hit in the rare case that we still have work left
to do on the update queue during shutdown.

Found via zebra crash:

```
(gdb) bt
\#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
\#1  0x00007f4e4d3f7535 in __GI_abort () at abort.c:79
\#2  0x00007f4e4d3f740f in __assert_fail_base (fmt=0x7f4e4d559ee0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7f4e4d9071d0 "master->owner == pthread_self()",
    file=0x7f4e4d906cf8 "lib/thread.c", line=1185, function=<optimized out>) at assert.c:92
\#3  0x00007f4e4d405102 in __GI___assert_fail (assertion=assertion@entry=0x7f4e4d9071d0 "master->owner == pthread_self()", file=file@entry=0x7f4e4d906cf8 "lib/thread.c",
    line=line@entry=1185, function=function@entry=0x7f4e4d906b68 <__PRETTY_FUNCTION__.15817> "thread_cancel") at assert.c:101
\#4  0x00007f4e4d8d095a in thread_cancel (thread=0x55b40d01a640) at lib/thread.c:1185
\#5  0x000055b40c291845 in zebra_dplane_shutdown () at zebra/zebra_dplane.c:3274
\#6  0x000055b40c27ee13 in zebra_finalize (dummy=<optimized out>) at zebra/main.c:202
\#7  0x00007f4e4d8d1416 in thread_call (thread=thread@entry=0x7ffcbbc08870) at lib/thread.c:1599
\#8  0x00007f4e4d8a1ef8 in frr_run (master=0x55b40ce35510) at lib/libfrr.c:1024
\#9  0x000055b40c270916 in main (argc=8, argv=0x7ffcbbc08c78) at zebra/main.c:483
(gdb) down
\#4  0x00007f4e4d8d095a in thread_cancel (thread=0x55b40d01a640) at lib/thread.c:1185
1185 assert(master->owner == pthread_self());
(gdb)
```

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>