]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
5 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>
5 years agoMerge pull request #5374 from opensourcerouting/snap-vrrpd-7.2
Donald Sharp [Tue, 19 Nov 2019 22:47:24 +0000 (17:47 -0500)]
Merge pull request #5374 from opensourcerouting/snap-vrrpd-7.2

snapcraft: Add vrrpd to the snapcraft package [7.2]

5 years agosnapcraft: Add vrrpd to the snapcraft package 5374/head
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>
5 years agoMerge pull request #5365 from ton31337/fix/addpath_total_peer_update_7.2
Donald Sharp [Tue, 19 Nov 2019 12:41:17 +0000 (07:41 -0500)]
Merge pull request #5365 from ton31337/fix/addpath_total_peer_update_7.2

bgpd: [7.2] Fix per afi/safi addpath peer counting

5 years agobgpd: Fix per afi/safi addpath peer counting 5365/head
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>
5 years agoMerge pull request #5362 from donaldsharp/72_pim_crash_rp
Jafar Al-Gharaibeh [Tue, 19 Nov 2019 04:04:30 +0000 (22:04 -0600)]
Merge pull request #5362 from donaldsharp/72_pim_crash_rp

[7.2] pim crash rp

5 years agopimd: Create pimreg interface when we start any interface config 5362/head
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>
5 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>
5 years agoMerge pull request #5336 from opensourcerouting/ldpd-buffer-overflow-7.2
Sri Mohana Singamsetty [Fri, 15 Nov 2019 23:39:14 +0000 (15:39 -0800)]
Merge pull request #5336 from opensourcerouting/ldpd-buffer-overflow-7.2

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

5 years agoMerge pull request #5347 from ton31337/fix/bgp_dampening_per_afi_safi_7.2
Donald Sharp [Fri, 15 Nov 2019 12:34:58 +0000 (07:34 -0500)]
Merge pull request #5347 from ton31337/fix/bgp_dampening_per_afi_safi_7.2

bgpd: [7.2] Rework BGP dampening to be per AFI/SAFI

5 years agodoc: Append documentation for `bgp dampening` command 5347/head
Donatas Abraitis [Tue, 12 Nov 2019 11:23:24 +0000 (13:23 +0200)]
doc: Append documentation for `bgp dampening` command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: Rework BGP dampening to be per AFI/SAFI
Donatas Abraitis [Sun, 10 Nov 2019 18:13:20 +0000 (20:13 +0200)]
bgpd: Rework BGP dampening to be per AFI/SAFI

Before we had:

!
router bgp 65031
 bgp dampening 1 2 3 4
!

exit2-debian-9(config)# router bgp 65031
exit2-debian-9(config-router)# address-family ipv4 multicast
exit2-debian-9(config-router-af)# bgp dampening 5 6 7 8
exit2-debian-9(config-router-af)# end
exit2-debian-9# show running-config

!
router bgp 65031
 bgp dampening 1 2 3 4
!

After fix:

!
router bgp 65031
 neighbor 192.168.1.2 remote-as 100
 !
 address-family ipv4 unicast
  bgp dampening 1 2 3 4
 exit-address-family
 !
 address-family ipv4 multicast
  bgp dampening 5 6 7 8
 exit-address-family
!

exit2-debian-9# show ip bgp ipv4 unicast dampening parameters
Half-life time: 1 min
Reuse penalty: 2
Suppress penalty: 3
Max suppress time: 4 min
Max suppress penalty: 32

exit2-debian-9# show ip bgp ipv4 multicast dampening parameters
Half-life time: 5 min
Reuse penalty: 6
Suppress penalty: 7
Max suppress time: 8 min
Max suppress penalty: 18

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoldpd: add missing sanity check in the parsing of label messages 5336/head
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>
5 years agoMerge pull request #5316 from k0ste/stable_7.2_backports
Donald Sharp [Tue, 12 Nov 2019 15:20:02 +0000 (10:20 -0500)]
Merge pull request #5316 from k0ste/stable_7.2_backports

[7.2] lib: Remove include of deprecated sysctl.h

5 years agolib: Remove include of deprecated sysctl.h 5316/head
Mark Stapp [Wed, 23 Oct 2019 13:08:21 +0000 (09:08 -0400)]
lib: Remove include of deprecated sysctl.h

Stop including deprecated header file; appears to be unused and
it has been deprecated in recent linux.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
(cherry picked from commit 15e84e5abbf32ab6ad470ee3dbdcfa27c87e455f)

5 years agoMerge pull request #5173 from opensourcerouting/72-bfdd-vrf-socket
Donatas Abraitis [Fri, 8 Nov 2019 09:12:15 +0000 (11:12 +0200)]
Merge pull request #5173 from opensourcerouting/72-bfdd-vrf-socket

[7.2] bfdd: VRF security improvement

5 years agoMerge pull request #5264 from dslicenc/ospf-bfd-72
Rafael Zalamena [Fri, 1 Nov 2019 16:06:29 +0000 (13:06 -0300)]
Merge pull request #5264 from dslicenc/ospf-bfd-72

ospf: 7.2 BFD down not tearing down OSPF adjacency for point-to-point net…

5 years agoospf: BFD down not tearing down OSPF adjacency for point-to-point network 5264/head
Radhika Mahankali [Mon, 9 Apr 2018 22:30:32 +0000 (15:30 -0700)]
ospf: BFD down not tearing down OSPF adjacency for point-to-point network

Root Cause:
Lookup for the point-to-point neighbor was failing because the neighbor
lookup was based on neighbor interface IP address. But, for point-to-point
neighbor the key is router-id for lookup. Lookup failure was causing the
BFD updates from PTM to get dropped.

Fix:
Added walk of the neighbor list if the network type is point-to-point to
find the appropriate neighbor. The match is based on source IP address of
the neighbor since that’s the address registered with BFD for monitoring.

Ticket: CM-20411
Signed-off-by: Radhika Mahankali <radhika@cumulusnetworks.com>
5 years agoMerge pull request #5254 from ton31337/fix/doc_bgp_redistribute_vpn_7.2
Donald Sharp [Thu, 31 Oct 2019 14:25:17 +0000 (10:25 -0400)]
Merge pull request #5254 from ton31337/fix/doc_bgp_redistribute_vpn_7.2

doc: [7.2] Add redistribute vnc-direct command and fix typo in redistribute vnc

5 years agodoc: Add redistribute vnc-direct command 5254/head
Donatas Abraitis [Mon, 28 Oct 2019 14:53:40 +0000 (16:53 +0200)]
doc: Add redistribute vnc-direct command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agodoc: redistribute vpn --> redistribute vnc
Donatas Abraitis [Mon, 28 Oct 2019 14:53:11 +0000 (16:53 +0200)]
doc: redistribute vpn --> redistribute vnc

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5243 from ton31337/fix/do_not_include_nexthop_dash_dash_7.2
Donald Sharp [Tue, 29 Oct 2019 17:02:45 +0000 (13:02 -0400)]
Merge pull request #5243 from ton31337/fix/do_not_include_nexthop_dash_dash_7.2

bgpd: [7.2] Do not send next-hop as :: in MP_REACH_NLRI if no link-local ex…

5 years agobgpd: Do not send next-hop as :: in MP_REACH_NLRI if no link-local exists 5243/head
Donatas Abraitis [Fri, 6 Sep 2019 09:12:23 +0000 (12:12 +0300)]
bgpd: Do not send next-hop as :: in MP_REACH_NLRI if no link-local exists

This is the unusual case when you have global IPv6 address and no link-local
on interface attached. Like here:

eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
 link/ether 08:00:27:65:c6:82 brd ff:ff:ff:ff:ff:ff
 inet6 2a02:4780:face::1/64 scope global
    valid_lft forever preferred_lft forever

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5230 from ton31337/fix/noip_nhrp_map_7.2
Donald Sharp [Sat, 26 Oct 2019 02:25:34 +0000 (22:25 -0400)]
Merge pull request #5230 from ton31337/fix/noip_nhrp_map_7.2

nhrp: [7.2] Make sure `no ip nhrp map <something>` works as expected

5 years agoMerge pull request #5227 from ton31337/fix/override_peers_ttl_if_peer_group_configure...
Donald Sharp [Sat, 26 Oct 2019 02:24:48 +0000 (22:24 -0400)]
Merge pull request #5227 from ton31337/fix/override_peers_ttl_if_peer_group_configured_7.2

bgpd: [7.2] Override peer's TTL only if peer-group is configured with TTL

5 years agoMerge pull request #5233 from ton31337/feature/doc_access_list_sequence_numbers_7.2
Donald Sharp [Sat, 26 Oct 2019 02:23:59 +0000 (22:23 -0400)]
Merge pull request #5233 from ton31337/feature/doc_access_list_sequence_numbers_7.2

doc: [7.2] Update documentation for access-list with sequence numbers

5 years agodoc: Update documentation for access-list with sequence numbers 5233/head
Donatas Abraitis [Mon, 21 Oct 2019 15:04:39 +0000 (18:04 +0300)]
doc: Update documentation for access-list with sequence numbers

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agonhrp: Make sure `no ip nhrp map <something>` works as expected 5230/head
Donatas Abraitis [Fri, 25 Oct 2019 10:01:02 +0000 (13:01 +0300)]
nhrp: Make sure `no ip nhrp map <something>` works as expected

We passed peer as NULL and nothing happened.

exit2-debian-9# conf
exit2-debian-9(config)# int gre1
exit2-debian-9(config-if)# ip nhrp map 1.1.1.1 local
exit2-debian-9(config-if)# ip nhrp map 2.2.2.2 3.3.3.3
exit2-debian-9(config-if)# do sh run
...
!
interface gre1
 ip nhrp map 1.1.1.1 local
 ip nhrp map 2.2.2.2 3.3.3.3
!
...
exit2-debian-9(config-if)# no ip nhrp map 1.1.1.1
exit2-debian-9(config-if)# do sh run
...
!
interface gre1
 ip nhrp map 2.2.2.2 3.3.3.3
!

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: Override peer's TTL only if peer-group is configured with TTL 5227/head
Donatas Abraitis [Wed, 23 Oct 2019 14:56:23 +0000 (17:56 +0300)]
bgpd: Override peer's TTL only if peer-group is configured with TTL

When a peer-group is configured for an already configured eBGP neighbor,
ebgp-multihop command is removed for that peer.

This fix remains configured peer's ebgp-multihop value if peer-group does
not have ebgp-multihop configured.

!
router bgp 100
 neighbor A8 peer-group
 neighbor A9 peer-group
 neighbor A9 ebgp-multihop 12
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 ebgp-multihop 255
 neighbor 4.4.4.4 remote-as 123
 !

spine1-debian-9#
spine1-debian-9# conf
spine1-debian-9(config)# router bgp 100
spine1-debian-9(config-router)# neighbor 3.3.3.3 peer-group A8
spine1-debian-9(config-router)# do sh run

!
router bgp 100
 neighbor A8 peer-group
 neighbor A9 peer-group
 neighbor A9 ebgp-multihop 12
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 peer-group A8
 neighbor 3.3.3.3 ebgp-multihop 255
 neighbor 4.4.4.4 remote-as 123
!

spine1-debian-9(config-router)# neighbor 4.4.4.4 peer-group A9
spine1-debian-9(config-router)# do sh run

!
router bgp 100
 neighbor A8 peer-group
 neighbor A9 peer-group
 neighbor A9 ebgp-multihop 12
 neighbor 3.3.3.3 remote-as 123
 neighbor 3.3.3.3 peer-group A8
 neighbor 3.3.3.3 ebgp-multihop 255
 neighbor 4.4.4.4 remote-as 123
 neighbor 4.4.4.4 peer-group A9
!

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5221 from dslicenc/remove-afi-saf-msg-72
Donatas Abraitis [Fri, 25 Oct 2019 05:37:18 +0000 (08:37 +0300)]
Merge pull request #5221 from dslicenc/remove-afi-saf-msg-72

bgpd: 7.2 - remove error message for unkown afi/safi combination

5 years agobgpd: remove error message for unkown afi/safi combination 5221/head
Don Slice [Wed, 23 Oct 2019 16:30:28 +0000 (16:30 +0000)]
bgpd: remove error message for unkown afi/safi combination

Problem reported with error messages appearing in the log
complaining about invalid afi/safi combinations.  Determined
that the error messages were recently added in the function
that turns afi and safi values to strings.  Unfortunately,
the function is called from places using FOREACH_AFI_SAFI,
which spins thru every afi and safi number including some
that are not legal together (ipv4 evpn and l2vpn multicast
for example.)   This fix removes these error messages since
it is not necessarily an error to call it with invalid
combinations.

Ticket: CM-26883
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoMerge pull request #5198 from manuhalo/fix_bgp_oot_7.2
Donatas Abraitis [Mon, 21 Oct 2019 10:07:38 +0000 (13:07 +0300)]
Merge pull request #5198 from manuhalo/fix_bgp_oot_7.2

[7.2]bgpd: fix include path for bgp_bmp_clippy.c

5 years agobgpd: fix include path for bgp_bmp_clippy.c 5198/head
Emanuele Di Pascale [Wed, 18 Sep 2019 09:49:24 +0000 (11:49 +0200)]
bgpd: fix include path for bgp_bmp_clippy.c

not using a relative path was breaking out-of-tree compilation

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
5 years agoMerge pull request #5157 from sworleys/Fix-IF-Infinite-Loop-7.2
Donatas Abraitis [Wed, 16 Oct 2019 12:06:41 +0000 (15:06 +0300)]
Merge pull request #5157 from sworleys/Fix-IF-Infinite-Loop-7.2

[7.2] Fix Interface Infinite Loop Walk

5 years agoMerge pull request #5162 from ton31337/fix/do_not_reconnect_if_prefix_overflow_7.2
Donald Sharp [Wed, 16 Oct 2019 11:03:59 +0000 (07:03 -0400)]
Merge pull request #5162 from ton31337/fix/do_not_reconnect_if_prefix_overflow_7.2

bgpd: [7.2] Keep the session down if maximum-prefix is reached

5 years agotests: Remove sleep from test_bgp_maximum_prefix_invalid_update 5162/head
Donatas Abraitis [Thu, 3 Oct 2019 11:08:51 +0000 (14:08 +0300)]
tests: Remove sleep from test_bgp_maximum_prefix_invalid_update

Sleep is not needed here while we fail instantly if maximum is reached.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: Keep the session down if maximum-prefix is reached
Donatas Abraitis [Wed, 2 Oct 2019 15:06:37 +0000 (18:06 +0300)]
bgpd: Keep the session down if maximum-prefix is reached

Under high load instances with hundreds of thousands of prefixes this
could result in very unstable systems.

When maximum-prefix is set, but restart timer is not set then the session
flaps between Idle(Pfx) -> Established -> Idle(Pfx) states.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agolib: Don't add/del from name tree if name isnt set 5157/head
Stephen Worley [Wed, 9 Oct 2019 23:35:46 +0000 (19:35 -0400)]
lib: Don't add/del from name tree if name isnt set

If the name has not been set yet (we were only passed the
ifindex in some cases like with master/slave timings) then
do not add/del it from the ifname rb tree on the vrf struct.

Doing so causes duplicate entries on the tree and infinte loops
can happen when iterating over it.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agolib: Use correct if compare function in tree proto
Stephen Worley [Wed, 9 Oct 2019 20:43:27 +0000 (16:43 -0400)]
lib: Use correct if compare function in tree proto

We were using the incorrect comparison function for the
ifindex-based rb tree. Luckily, we were using the correct one
in RB_GENERATE so I guess that overwrote what was declared in the
prototype?

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agoMerge pull request #5160 from donaldsharp/7.2_bgp_backports
Mark Stapp [Tue, 15 Oct 2019 19:38:23 +0000 (15:38 -0400)]
Merge pull request #5160 from donaldsharp/7.2_bgp_backports

7.2 bgp backports

5 years agobfdd: bind VRF sockets to devices 5173/head
Rafael Zalamena [Tue, 15 Oct 2019 17:56:27 +0000 (14:56 -0300)]
bfdd: bind VRF sockets to devices

Always bind the created sockets to their respective VRF devices. With
this it should be possible to run BFD on VRFs without needing to weaken
the security setting `net.ipv4.udp_l3mdev_accept=1`.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agoMerge pull request #5158 from opensourcerouting/72-bfdd-bug-fixes
Donald Sharp [Tue, 15 Oct 2019 17:33:39 +0000 (13:33 -0400)]
Merge pull request #5158 from opensourcerouting/72-bfdd-bug-fixes

[7.2] bfdd: pack of bug fixes

5 years agolib: Fix read beyond end of data structure 5160/head
Donald Sharp [Thu, 10 Oct 2019 12:52:54 +0000 (08:52 -0400)]
lib: Fix read beyond end of data structure

Our Address Sanitizer CI is finding this issue:
error 09-Oct-2019 19:28:33 r4: bgpd triggered an exception by AddressSanitizer
error 09-Oct-2019 19:28:33 ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffdd425b060 at pc 0x00000068575f bp 0x7ffdd4258550 sp 0x7ffdd4258540
error 09-Oct-2019 19:28:33 READ of size 1 at 0x7ffdd425b060 thread T0
error 09-Oct-2019 19:28:33     #0 0x68575e in prefix_cmp lib/prefix.c:776
error 09-Oct-2019 19:28:33     #1 0x5889f5 in rfapiItBiIndexSearch bgpd/rfapi/rfapi_import.c:2230
error 09-Oct-2019 19:28:33     #2 0x5889f5 in rfapiBgpInfoFilteredImportVPN bgpd/rfapi/rfapi_import.c:3520
error 09-Oct-2019 19:28:33     #3 0x58b909 in rfapiProcessWithdraw bgpd/rfapi/rfapi_import.c:4071
error 09-Oct-2019 19:28:33     #4 0x4c459b in bgp_withdraw bgpd/bgp_route.c:3736
error 09-Oct-2019 19:28:33     #5 0x484122 in bgp_nlri_parse_vpn bgpd/bgp_mplsvpn.c:237
error 09-Oct-2019 19:28:33     #6 0x497f52 in bgp_nlri_parse bgpd/bgp_packet.c:315
error 09-Oct-2019 19:28:33     #7 0x49d06d in bgp_update_receive bgpd/bgp_packet.c:1598
error 09-Oct-2019 19:28:33     #8 0x49d06d in bgp_process_packet bgpd/bgp_packet.c:2274
error 09-Oct-2019 19:28:33     #9 0x6b9f54 in thread_call lib/thread.c:1531
error 09-Oct-2019 19:28:33     #10 0x657037 in frr_run lib/libfrr.c:1052
error 09-Oct-2019 19:28:33     #11 0x42d268 in main bgpd/bgp_main.c:486
error 09-Oct-2019 19:28:33     #12 0x7f806032482f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
error 09-Oct-2019 19:28:33     #13 0x42bcc8 in _start (/usr/lib/frr/bgpd+0x42bcc8)
error 09-Oct-2019 19:28:33
error 09-Oct-2019 19:28:33 Address 0x7ffdd425b060 is located in stack of thread T0 at offset 240 in frame
error 09-Oct-2019 19:28:33     #0 0x483945 in bgp_nlri_parse_vpn bgpd/bgp_mplsvpn.c:103
error 09-Oct-2019 19:28:33
error 09-Oct-2019 19:28:33   This frame has 5 object(s):
error 09-Oct-2019 19:28:33     [32, 36) 'label'
error 09-Oct-2019 19:28:33     [96, 108) 'rd_as'
error 09-Oct-2019 19:28:33     [160, 172) 'rd_ip'
error 09-Oct-2019 19:28:33     [224, 240) 'prd' <== Memory access at offset 240 overflows this variable
error 09-Oct-2019 19:28:33     [288, 336) 'p'
error 09-Oct-2019 19:28:33 HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
error 09-Oct-2019 19:28:33       (longjmp and C++ exceptions *are* supported)
error 09-Oct-2019 19:28:33 SUMMARY: AddressSanitizer: stack-buffer-overflow lib/prefix.c:776 prefix_cmp
error 09-Oct-2019 19:28:33 Shadow bytes around the buggy address:
error 09-Oct-2019 19:28:33   0x10003a8435b0: 00 00 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00
error 09-Oct-2019 19:28:33   0x10003a8435c0: 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3 f3 f3
error 09-Oct-2019 19:28:33   0x10003a8435d0: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
error 09-Oct-2019 19:28:33   0x10003a8435e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
error 09-Oct-2019 19:28:33   0x10003a8435f0: f1 f1 04 f4 f4 f4 f2 f2 f2 f2 00 04 f4 f4 f2 f2
error 09-Oct-2019 19:28:33 =>0x10003a843600: f2 f2 00 04 f4 f4 f2 f2 f2 f2 00 00[f4]f4 f2 f2
error 09-Oct-2019 19:28:33   0x10003a843610: f2 f2 00 00 00 00 00 00 f4 f4 f3 f3 f3 f3 00 00
error 09-Oct-2019 19:28:33   0x10003a843620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
error 09-Oct-2019 19:28:33   0x10003a843630: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 02 f4
error 09-Oct-2019 19:28:33   0x10003a843640: f4 f4 f2 f2 f2 f2 04 f4 f4 f4 f2 f2 f2 f2 00 00
error 09-Oct-2019 19:28:33   0x10003a843650: f4 f4 f2 f2 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00
error 09-Oct-2019 19:28:33 Shadow byte legend (one shadow byte represents 8 application bytes):
error 09-Oct-2019 19:28:33   Addressable:           00
error 09-Oct-2019 19:28:33   Partially addressable: 01 02 03 04 05 06 07
error 09-Oct-2019 19:28:33   Heap left redzone:       fa
error 09-Oct-2019 19:28:33   Heap right redzone:      fb
error 09-Oct-2019 19:28:33   Freed heap region:       fd
error 09-Oct-2019 19:28:33   Stack left redzone:      f1
error 09-Oct-2019 19:28:33   Stack mid redzone:       f2
error 09-Oct-2019 19:28:33   Stack right redzone:     f3
error 09-Oct-2019 19:28:33   Stack partial redzone:   f4
error 09-Oct-2019 19:28:33   Stack after return:      f5
error 09-Oct-2019 19:28:33   Stack use after scope:   f8
error 09-Oct-2019 19:28:33   Global redzone:          f9
error 09-Oct-2019 19:28:33   Global init order:       f6
error 09-Oct-2019 19:28:33   Poisoned by user:        f7
error 09-Oct-2019 19:28:33   Container overflow:      fc
error 09-Oct-2019 19:28:33   Array cookie:            ac
error 09-Oct-2019 19:28:33   Intra object redzone:    bb
error 09-Oct-2019 19:28:33   ASan internal:           fe
error 09-Oct-2019 19:28:36 r3: Daemon bgpd not running

This is the result of this code pattern in rfapi/rfapi_import.c:

prefix_cmp((struct prefix *)&bpi_result->extra->vnc.import.rd,
   (struct prefix *)prd))

Effectively prd or vnc.import.rd are `struct prefix_rd` which
are being typecast to a `struct prefix`.  Not a big deal except commit
1315d74de97be2944d7b005b2f9a50e9ae5eff4d modified the prefix_cmp
function to allow for a sorted prefix_cmp.  In prefix_cmp
we were looking at the offset and shift.  In the case
of vnc we were passing a prefix length of 64 which is the exact length of
the remaining data structure for struct prefix_rd.  So we calculated
a offset of 8 and a shift of 0.  The data structures for the prefix
portion happened to be equal to 64 bits of data. So we checked that
with the memcmp got a 0 and promptly read off the end of the data
structure for the numcmp.  The fix is if shift is 0 that means thei
the memcmp has checked everything and there is nothing to do.

Please note: We will still crash if we set the prefixlen > then
~312 bits currently( ie if the prefixlen specifies a bit length
longer than the prefix length ).  I do not think there is
anything to do here( nor am I sure how to correct this either )
as that we are going to have some severe problems when we muck
up the prefixlen.

Fixes: #5025
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: When creating extra from stack ensure it is zero'ed out
Donald Sharp [Thu, 10 Oct 2019 00:19:56 +0000 (20:19 -0400)]
bgpd: When creating extra from stack ensure it is zero'ed out

BGP code assumes that the extra data is zero'ed out.  Ensure that we
are not leaving any situation that the data on the stack is actually all
0's when we pass it around as a pointer later.

Please note in issue #5025, Lou reported a different valgrind
issue, which is not the same issue:

==7313== Conditional jump or move depends on uninitialised value(s)
==7313== at 0x181F9F: subgroup_announce_check (bgp_route.c:1555)
==7313== by 0x1A112B: subgroup_announce_table (bgp_updgrp_adv.c:641)
==7313== by 0x1A1340: subgroup_announce_route (bgp_updgrp_adv.c:704)
==7313== by 0x1A13E3: subgroup_coalesce_timer (bgp_updgrp_adv.c:331)
==7313== by 0x4EBA615: thread_call (thread.c:1531)
==7313== by 0x4E8AC37: frr_run (libfrr.c:1052)
==7313== by 0x1429E0: main (bgp_main.c:486)
==7313==
==7313== Conditional jump or move depends on uninitialised value(s)
==7313== at 0x201C0E: rfapi_vty_out_vncinfo (rfapi_vty.c:429)
==7313== by 0x18D0D6: route_vty_out (bgp_route.c:7481)
==7313== by 0x18DD76: bgp_show_table (bgp_route.c:9365)
==7313== by 0x1930C4: bgp_show_table_rd (bgp_route.c:9471)
==7313== by 0x1932A3: bgp_show (bgp_route.c:9510)
==7313== by 0x193E68: show_ip_bgp_json (bgp_route.c:10284)
==7313== by 0x4E6D024: cmd_execute_command_real.isra.2 (command.c:1072)
==7313== by 0x4E6F51E: cmd_execute_command (command.c:1131)
==7313== by 0x4E6F686: cmd_execute (command.c:1285)
==7313== by 0x4EBF9C4: vty_command (vty.c:516)
==7313== by 0x4EBFB9F: vty_execute (vty.c:1285)
==7313== by 0x4EC250F: vtysh_read (vty.c:2119)
==7313==

that is causing the actual crash.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Ensure that struct prefix_rd rd is zero'ed out
Donald Sharp [Thu, 10 Oct 2019 12:52:13 +0000 (08:52 -0400)]
bgpd: Ensure that struct prefix_rd rd is zero'ed out

We are passing around the created rd, Just make sure that
the data is zero'ed out.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: AS paths are uint32_t instead of integers
Donald Sharp [Wed, 9 Oct 2019 20:10:44 +0000 (16:10 -0400)]
bgpd: AS paths are uint32_t instead of integers

We have some JSON output that was displaying high order
AS path data as negative numbers:

{
 "paths":[
    {
      "aspath":{
        "string":"4200010118 4200010000 20473 1299",
        "segments":[
          {
            "type":"as-sequence",
            "list":[
              -94957178,
              -94957296,
              20473,
              1299
            ]
          }
        ],

Notice "String" output -vs- the list.

With fixed code:

  "paths":[
    {
      "aspath":{
        "string":"64539 4294967000 15096 6939 7922 7332 4249",
        "segments":[
          {
            "type":"as-sequence",
            "list":[
              64539,
              4294967000,
              15096,
              6939,
              7922,
              7332,
              4249
            ]
          }
        ],

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agobgpd: Soft reconfig-in should find the right bgp_path_info
Donald Sharp [Tue, 15 Oct 2019 12:27:22 +0000 (08:27 -0400)]
bgpd: Soft reconfig-in should find the right bgp_path_info

When using soft reconfiguration inbound we are storing packet
data on the side for replaying when necessary.  The problem here
is that we are just grabbing the first bgp_path_info and using
that as the base.  What happens when we have soft-reconfig turned
on with multiple bgp_path_info's for a path?  This was introduced
in commit 8692c506520f6b268525b80890702432c95f13c4, yes back
in 2012!  I would argue, though, that it was just broken
in a different way before this.

Choose the correct bgp_path_info that corresponds to the peer
we received the data from for rethinking.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoFRRouting Release 7.2 frr-7.2
Martin Winter [Tue, 15 Oct 2019 14:44:47 +0000 (16:44 +0200)]
FRRouting Release 7.2

ALL Daemons
    -N <namespace> to allow for config file locating when running FRR
      inside of a namespace
    Impoved Testing across all daemons
BFD
    VRF Support
    Conversion to Northbound interface
BGP
    Aggregate-address add route-map support
    BMP Support
    Improved JSON output for many commands
    `show bgp afi safi summary failed` command
    `clear bop *` clears all peers
    Show FQDN for `show bgp ipv4 uni` commands
    Display BestPath selection reason as part of show commands
EIGRP
    Infrastructure changes to allow VRF's
    SIGHUP signals the config reload
    Conversion to Northbound interface
ISIS
    BFD Support
    Support for circuits with MTU > 8192
PBRD
    fwmark support as part of match criteria
    autocompletion of PBRMAPS
    Improved Nexthop Support
PIMD
    PIM-BSM receive support
     Improved debugging support
    Store ECMP paths that are not currently legal for use
    Disallow igmp query from a non-connected source
    Many new cli improvements and changes
VRRPD
    Add Support for RFC 3768 and RFC 5798
Route-Maps
    Add sequence numbers to access-lists
    Add `match ip next-hop type blackhole`
    Improved ability to notice dependency changes
SHARPD
    `sharp watch [import|nexthop]` you can now specify a prefix instead
     of assuming a /32
STATICD
    Significantly Improved NHT
ZEBRA
    Many dataplane improvements for routes, neighbor table and EVPN
    NHT cli can now be specified per VRF and improved ability to control
     NHT data being shown
    Removed duplicate processing of routes
    Improved debugablility
    RMAC and VxLan support for the FPM
LIB
    RCU support
    Nexthop Group Improvements
    `log-filter WORD` added
Building
    openssl support
    libcap should be used as part of build or significant slowdowns will
     be experienced
    Lua builds have been fixed
    Improved Cross building
Snapcraft
    Add Fabricd
    Add Libyan
    Update rtrlib and rpki

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 years agobfdd: don't allow link-local without interface 5149/head 5158/head
Rafael Zalamena [Fri, 11 Oct 2019 19:54:51 +0000 (16:54 -0300)]
bfdd: don't allow link-local without interface

When using link-local addresses we must provide scope-id to the
operating system so it knows where to send packets.

Spotted by Pavel Ivashchenko (@zays26).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobfdd: simplify session observers code
Rafael Zalamena [Fri, 11 Oct 2019 19:13:24 +0000 (16:13 -0300)]
bfdd: simplify session observers code

Don't be selective about what to observe, always observe all possible
aspects of the session that may change on run-time (i.e. bind address,
interface and VRF existence).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobfdd: set session down after disabling it
Rafael Zalamena [Fri, 11 Oct 2019 16:12:26 +0000 (13:12 -0300)]
bfdd: set session down after disabling it

If a session is no longer able to send/receive packets, it is very
likely it will be down in a few milliseconds so lets speed up the
process and correctly mark it as down.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobfdd: disable sockets polling before closing it
Rafael Zalamena [Fri, 11 Oct 2019 14:15:56 +0000 (11:15 -0300)]
bfdd: disable sockets polling before closing it

Otherwise the `thread_read` will keep waking us up to handle closing
sockets which are never unregistered.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
5 years agobfdd: upon vrf disable, unlink bfd session with vrf
Philippe Guibert [Thu, 10 Oct 2019 07:07:21 +0000 (09:07 +0200)]
bfdd: upon vrf disable, unlink bfd session with vrf

bfd session has a vrf pointer that needs to be reset, when vrf is
disabled.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
5 years agobfdd: Fixing coredump in log
SumitAgarwal123 [Thu, 19 Sep 2019 10:04:48 +0000 (03:04 -0700)]
bfdd: Fixing coredump in log

Param missing in debug log, leading to coredump

Signed-off-by: Sayed Mohd Saquib <sayed.saquib@broadcom.com>
5 years agoMerge pull request #5115 from ton31337/feature/maximum-prefix_uint64_to_uint32_7.2
Quentin Young [Wed, 9 Oct 2019 19:33:22 +0000 (15:33 -0400)]
Merge pull request #5115 from ton31337/feature/maximum-prefix_uint64_to_uint32_7.2

bgpd: [7.2] Use uint32_t for maximum-prefix

5 years agobgpd: Use uint32_t for maximum-prefix 5115/head
Donatas Abraitis [Thu, 3 Oct 2019 21:30:28 +0000 (00:30 +0300)]
bgpd: Use uint32_t for maximum-prefix

Currently we have unsigned long which is not what we defined
in CLI (1-4294967295).

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5096 from donaldsharp/72_static_fix_for_ROUTE_ALL
Renato Westphal [Wed, 2 Oct 2019 19:22:07 +0000 (16:22 -0300)]
Merge pull request #5096 from donaldsharp/72_static_fix_for_ROUTE_ALL

[7.2]zebra: Fix redistribution deletion for ZEBRA_ROUTE_ALL

5 years agoMerge pull request #5076 from ak503/libfrr_crash_7_2
Donald Sharp [Wed, 2 Oct 2019 14:13:24 +0000 (10:13 -0400)]
Merge pull request #5076 from ak503/libfrr_crash_7_2

7.2: zebra: if_is_loopback_or_vrf crash if if_lookup_by_index return …

5 years agoMerge pull request #5073 from ton31337/fix/no_aggregate-address_command_for_route...
Donald Sharp [Wed, 2 Oct 2019 14:12:21 +0000 (10:12 -0400)]
Merge pull request #5073 from ton31337/fix/no_aggregate-address_command_for_route-map_7.2

bgpd: [7.2] Accept no aggregate-address <IP> route-map <RMAP> commands

5 years agoMerge pull request #5091 from sworleys/Fix-Vrf_ID-Decode_7.2
Donatas Abraitis [Wed, 2 Oct 2019 14:11:46 +0000 (17:11 +0300)]
Merge pull request #5091 from sworleys/Fix-Vrf_ID-Decode_7.2

[7.2] lib: Decode vrf_id update appropriately from zapi

5 years agozebra: Fix redistribution deletion for ZEBRA_ROUTE_ALL 5096/head
Donald Sharp [Wed, 2 Oct 2019 13:29:19 +0000 (09:29 -0400)]
zebra: Fix redistribution deletion for ZEBRA_ROUTE_ALL

commit ee8a72f315013aecd45bc9c3aaf7ea81b2ca747a

broke the usage of ZEBRA_ROUTE_ALL as a valid redistribution
command.  This commit puts it back in.  LDP uses ZEBRA_ROUTE_ALL
as an option to say it is interested in all REDISTRIBUTION events.

Fixes: #5072
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agolib: Decode vrf_id update appropriately from zapi 5091/head
Stephen Worley [Tue, 1 Oct 2019 23:02:33 +0000 (19:02 -0400)]
lib: Decode vrf_id update appropriately from zapi

The vrf_id in `zsend_interface_vrf_update()` is encoded as
a long via `stream_putl()`, we should decode it as such
as well.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
5 years agoMerge pull request #5089 from cfra/fix/7.2/isis-threeway
Donald Sharp [Tue, 1 Oct 2019 23:13:47 +0000 (19:13 -0400)]
Merge pull request #5089 from cfra/fix/7.2/isis-threeway

isisd: Fix handling of neighbor circuit id in three way handshake

5 years agoisisd: Fix handling of neighbor circuit id in three way handshake 5089/head
Christian Franke [Mon, 30 Sep 2019 23:53:44 +0000 (01:53 +0200)]
isisd: Fix handling of neighbor circuit id in three way handshake

RFC 5303 states:

      If the system ID and Extended Local Circuit ID of the neighboring
      system are known (in adjacency three-way state Initializing or
      Up), the neighbor's system ID SHALL be reported in the Neighbor
      System ID field, and the neighbor's Extended Local Circuit ID
      SHALL be reported in the Neighbor Extended Local Circuit ID field.

There is nothing written about only setting the Extended circuit ID of the
adjacency only when we bring the three-way adjacency up.

In fact, we should always update it, to avoid the problem described in #4783.

Fixes: #4783
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
5 years ago7.2: zebra: if_is_loopback_or_vrf crash if if_lookup_by_index return NULL 5076/head
dturlupov [Fri, 27 Sep 2019 08:23:27 +0000 (11:23 +0300)]
7.2: zebra: if_is_loopback_or_vrf crash if if_lookup_by_index return NULL

Function if_lookup_by_index() can return NULL, but in if_is_loopback_or_vrf() we don't chech NULL and get next:

Sep 2 07:44:34 XXX zebra[4616]: /usr/lib64/libfrr.so.0(zlog_backtrace_sigsafe+0x48) [0x7fb5f704cf18]
Sep 2 07:44:34 XXX zebra[4616]: /usr/lib64/libfrr.so.0(zlog_signal+0x378) [0x7fb5f704d728]
Sep 2 07:44:34 XXX zebra[4616]: /usr/lib64/libfrr.so.0(+0x6b495) [0x7fb5f706b495]
Sep 2 07:44:34 XXX zebra[4616]: /lib64/libpthread.so.0(+0x123b0) [0x7fb5f6d573b0]
Sep 2 07:44:34 XXX zebra[4616]: /usr/lib64/libfrr.so.0(if_is_loopback+0) [0x7fb5f7045160]
Sep 2 07:44:34 XXX zebra[4616]: /usr/lib64/libfrr.so.0(if_is_loopback_or_vrf+0x11) [0x7fb5f7045191]
Sep 2 07:44:34 XXX zebra[4616]: /usr/sbin/zebra() [0x43b26d]
Sep 2 07:44:34 XXX zebra[4616]: /usr/sbin/zebra() [0x43db6f]
Sep 2 07:44:34 XXX zebra[4616]: /usr/lib64/libfrr.so.0(work_queue_run+0xc8) [0x7fb5f7080de8]
Sep 2 07:44:34 XXX zebra[4616]: /usr/lib64/libfrr.so.0(thread_call+0x47) [0x7fb5f7077d27]
Sep 2 07:44:34 XXX zebra[4616]: /usr/lib64/libfrr.so.0(frr_run+0xd8) [0x7fb5f704b448]

Signed-off-by: Dmitrii Turlupov dturlupov@factor-ts.ru
5 years agobgpd: Accept no aggregate-address <IP> route-map <RMAP> commands 5073/head
Donatas Abraitis [Thu, 26 Sep 2019 14:35:25 +0000 (17:35 +0300)]
bgpd: Accept no aggregate-address <IP> route-map <RMAP> commands

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agoMerge pull request #5071 from ton31337/fix/aggregate-address_for_ipv6_summary-only_mi...
Donald Sharp [Thu, 26 Sep 2019 21:10:38 +0000 (17:10 -0400)]
Merge pull request #5071 from ton31337/fix/aggregate-address_for_ipv6_summary-only_missreading_7.2

bgpd: [7.2] aggregate-address X:X::X:X/M summary-only was missreading config

5 years agoMerge pull request #5069 from donaldsharp/7.2_aggregate_address
Donatas Abraitis [Thu, 26 Sep 2019 18:54:10 +0000 (21:54 +0300)]
Merge pull request #5069 from donaldsharp/7.2_aggregate_address

7.2: bgpd: aggregate-address A.B.C.D A.B.C.D summary-only was missreading …

5 years agobgpd: aggregate-address X:X::X:X/M summary-only was missreading config 5071/head
Donatas Abraitis [Thu, 26 Sep 2019 18:47:55 +0000 (21:47 +0300)]
bgpd: aggregate-address X:X::X:X/M summary-only was missreading config

Entering:
aggregate-address 2a02:4780::/48 summary-only

Will transform this to:
aggregate-address 2a02:4780::/48 summary-only route-map summary-only

This patch fixes that.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: aggregate-address A.B.C.D A.B.C.D summary-only was missreading config 5069/head
Donald Sharp [Thu, 26 Sep 2019 16:37:28 +0000 (12:37 -0400)]
bgpd: aggregate-address A.B.C.D A.B.C.D summary-only was missreading config

The `aggregate-address 30.0.5.0 255.255.255.0 summary-only` command
was missreading the inputed data and translating it into:

`aggregate-address 30.0.5.0/24 summary-only route-map summary-only`

This is not quite correct.  Fix this behavior:

donna.cumulusnetworks.com# conf
donna.cumulusnetworks.com(config)# router bgp
donna.cumulusnetworks.com(config-router)# aggregate-address 30.0.5.0 255.255.255.0 summary-only
donna.cumulusnetworks.com(config-router)# do show run
Building configuration...

Current configuration:
!
frr version 7.3-dev
frr defaults datacenter
hostname donna.cumulusnetworks.com
log file /var/log/frr/frr.log
no ipv6 forwarding
frr version 7.2-dev
!
router bgp 500
 neighbor 192.168.209.1 remote-as external
 neighbor 192.168.209.1 ebgp-multihop 255
 neighbor 192.168.210.1 remote-as external
 !
 address-family ipv4 unicast
  network 192.168.9.0/24
  network 192.168.10.0/24
  aggregate-address 30.0.5.0/24 summary-only
 exit-address-family
!

Issue: #5054
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5057 from dslicenc/bgp-next-hop-routemap-72
Donatas Abraitis [Thu, 26 Sep 2019 13:03:46 +0000 (16:03 +0300)]
Merge pull request #5057 from dslicenc/bgp-next-hop-routemap-72

7.2: bgpd: stop sending nexthop set by "route-map in" to eBGP peers

5 years agoMerge pull request #5064 from idryzhov/7.2-fix-vrf-autocompletions
Donald Sharp [Thu, 26 Sep 2019 11:31:40 +0000 (07:31 -0400)]
Merge pull request #5064 from idryzhov/7.2-fix-vrf-autocompletions

[7.2] *: fix missing VRF autocompletions

5 years ago*: fix missing VRF autocompletions 5064/head
Igor Ryzhov [Tue, 24 Sep 2019 16:51:46 +0000 (19:51 +0300)]
*: fix missing VRF autocompletions

Current autocompletion works only for simple "vrf NAME" case.

This commit expands it also for the following cases:
- "nexthop-vrf NAME" in staticd
- usage of $varname in many daemons

All daemons are updated to use single varname "$vrf_name".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
5 years agobgpd: stop sending nexthop set by "route-map in" to eBGP peers 5057/head
Don Slice [Tue, 24 Sep 2019 12:02:02 +0000 (05:02 -0700)]
bgpd: stop sending nexthop set by "route-map in" to eBGP peers

Problem reported that when a "neighbor x.x.x.x route-map FOO in"
set a next-hop value, that modified next-hop value was also sent
to eBGP peers.  This is incorrect since bgp is expected to set
next-hop to self when sending to eBGP peers unless third party
next-hop on a shared segment is true.  This fix modifies the
behavior to stop sending the modified next-hop to eBGP peers
if the route-map was applied inbound on another peer.

Ticket: CM-26025
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
5 years agoMerge pull request #5059 from mjstapp/fix_dplane_config_handler_7_2
Donald Sharp [Wed, 25 Sep 2019 20:48:02 +0000 (16:48 -0400)]
Merge pull request #5059 from mjstapp/fix_dplane_config_handler_7_2

[7.2] zebra: add dataplane variables to show run

5 years agozebra: handle config write for dataplane values 5059/head
Mark Stapp [Wed, 25 Sep 2019 18:27:12 +0000 (14:27 -0400)]
zebra: handle config write for dataplane values

[7.2 version] Add the (single) dataplane config value
to the output of config write, 'show run'.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #5048 from donaldsharp/7.2_sa_issues
Sri Mohana Singamsetty [Tue, 24 Sep 2019 15:57:57 +0000 (08:57 -0700)]
Merge pull request #5048 from donaldsharp/7.2_sa_issues

7.2 bgpd: rmap_type is 8 bit but we have 9 bits of flags

5 years agobgpd: rmap_type is 8 bit but we have 9 bits of flags 5048/head
Donald Sharp [Tue, 24 Sep 2019 12:24:10 +0000 (08:24 -0400)]
bgpd: rmap_type is 8 bit but we have 9 bits of flags

The newly added PEER_RMAP_TYPE_AGGREGATE flag is setup to
be the 9th bit:

But the flag we are putting it into:
uint8_t rmap_type;

is 8 bits.  Adjust the size.

Found by Coverity SA Scan
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5041 from opensourcerouting/isisd-fix-validation-crash-7.2
Donald Sharp [Tue, 24 Sep 2019 12:18:50 +0000 (08:18 -0400)]
Merge pull request #5041 from opensourcerouting/isisd-fix-validation-crash-7.2

[7.2] isisd: fix crash during candidate validation

5 years agoMerge pull request #5038 from idryzhov/7.2-fix-vtysh-no-log-facility
Donatas Abraitis [Mon, 23 Sep 2019 19:38:17 +0000 (22:38 +0300)]
Merge pull request #5038 from idryzhov/7.2-fix-vtysh-no-log-facility

[7.2] vtysh: fix "no log facility" command

5 years agovtysh: fix "no log facility" command 5038/head
Igor Ryzhov [Mon, 23 Sep 2019 16:01:58 +0000 (19:01 +0300)]
vtysh: fix "no log facility" command

Actual command from the library accepts only supported facilities, not
any random word.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
5 years agoisisd: fix crash during candidate validation 5041/head
Renato Westphal [Mon, 23 Sep 2019 12:37:49 +0000 (09:37 -0300)]
isisd: fix crash during candidate validation

The "abort_if_not_found" parameter of nb_running_get_entry()
should be set to true only when this function is called during the
NB_EV_APPLY phase of a northbound callback. Failure to respect this
can lead to crashes when multiple configuration changes are being
committed at the same time.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
5 years agoconfigure: Update versioning
Donald Sharp [Fri, 20 Sep 2019 18:37:32 +0000 (14:37 -0400)]
configure: Update versioning

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5027 from donaldsharp/7.2_send_that_error_bgp
Donatas Abraitis [Fri, 20 Sep 2019 18:41:49 +0000 (21:41 +0300)]
Merge pull request #5027 from donaldsharp/7.2_send_that_error_bgp

7.2: bgpd: Invalid NH's should send an apropriate reason code

5 years agobgpd: Invalid NH's should send an apropriate reason code 5027/head
Donald Sharp [Fri, 20 Sep 2019 10:41:02 +0000 (06:41 -0400)]
bgpd: Invalid NH's should send an apropriate reason code

RFC 4271 sec 6.3 p33, In the case of a BGP_NEXTHOP attribute with an
incorrect value, FRR is supposed to send a notification
and include 'Corresponding type, length and value of the NEXT_HOP
attribute in the notification data.

Fixes: #4997
Signed-off-by: Nikos <ntriantafillis@gmail.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
5 years agoMerge pull request #5014 from idryzhov/7.2-fix-vtysh-prefix-list
Donald Sharp [Thu, 19 Sep 2019 10:41:23 +0000 (06:41 -0400)]
Merge pull request #5014 from idryzhov/7.2-fix-vtysh-prefix-list

[7.2] vtysh: fix multiple "no ip/ipv6 prefix-list sequence-number" lines in running-config

5 years agovtysh: fix multiple "no ip/ipv6 prefix-list sequence-number" lines in running-config 5014/head
Igor Ryzhov [Wed, 18 Sep 2019 11:19:55 +0000 (14:19 +0300)]
vtysh: fix multiple "no ip/ipv6 prefix-list sequence-number" lines in running-config

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
5 years agoMerge pull request #4999 from mjstapp/fix_notif_installed_7_2
Donald Sharp [Wed, 18 Sep 2019 21:39:08 +0000 (17:39 -0400)]
Merge pull request #4999 from mjstapp/fix_notif_installed_7_2

[7.2] zebra: dplane route updates need to check all nexthops

5 years agozebra: check all dplane nexthops when processing 4999/head
Mark Stapp [Tue, 17 Sep 2019 15:33:46 +0000 (11:33 -0400)]
zebra: check all dplane nexthops when processing

[7.2 version]
When processing route updates from the dataplane, we were
terminating the checking of nexthops prematurely, and we could
miss meaningful changes.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
5 years agoMerge pull request #4986 from qlyoung/fix-bgp-zero-keepalive-timer-7.2
Sri Mohana Singamsetty [Mon, 16 Sep 2019 18:19:50 +0000 (11:19 -0700)]
Merge pull request #4986 from qlyoung/fix-bgp-zero-keepalive-timer-7.2

[7.2] bgpd: do not send keepalives when KA timer is 0

5 years agobgpd: do not send keepalives when KA timer is 0 4986/head
Quentin Young [Mon, 16 Sep 2019 15:33:49 +0000 (15:33 +0000)]
bgpd: do not send keepalives when KA timer is 0

RFC4271 specifies behavior when the hold timer is sent to zero - we
should not send keepalives or run a hold timer. But FRR, and other
vendors, allow the keepalive timer to be set to zero with a nonzero hold
timer. In this case we were sending keepalives constantly and maxing out
a pthread to do so. Instead behave similarly to other vendors and do not
send keepalives.

Unsure what the utility of this is, but blasting keepalives is
definitely the wrong thing to do.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
5 years agoMerge pull request #4976 from opensourcerouting/disable-ecmp2-test-7.2
Donatas Abraitis [Sat, 14 Sep 2019 14:26:42 +0000 (17:26 +0300)]
Merge pull request #4976 from opensourcerouting/disable-ecmp2-test-7.2

[7.2] Disable bgp-ecmp-topo2 topotest until proper fix is developed

5 years agoMerge pull request #4979 from ton31337/feature/route-map_aggregate_command_7.2
Donald Sharp [Sat, 14 Sep 2019 11:42:33 +0000 (07:42 -0400)]
Merge pull request #4979 from ton31337/feature/route-map_aggregate_command_7.2

bgpd: [7.2] Apply route-map for aggregate-address

5 years agotests: Improve bgp_aggregate-address_route-map test 4979/head
Donatas Abraitis [Thu, 12 Sep 2019 07:04:56 +0000 (10:04 +0300)]
tests: Improve bgp_aggregate-address_route-map test

Rewrite some parts to add more visibility what's going on if test fails.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agodoc: Add documentation for aggregate-address with route-map support
Donatas Abraitis [Thu, 22 Aug 2019 06:39:33 +0000 (09:39 +0300)]
doc: Add documentation for aggregate-address with route-map support

Additionally remove trailling/unnecesarry whitespaces and align code
snippets correctly.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agotopotests: Add test for checking if route-map is applied for aggregate-address
Donatas Abraitis [Wed, 21 Aug 2019 15:16:17 +0000 (18:16 +0300)]
topotests: Add test for checking if route-map is applied for aggregate-address

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agobgpd: Apply route-map for aggregate-address command
Donatas Abraitis [Wed, 21 Aug 2019 15:16:05 +0000 (18:16 +0300)]
bgpd: Apply route-map for aggregate-address command

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
5 years agotests: Disable bgp-ecmp-topo2 topotest until proper fix is developed 4976/head
Martin Winter [Thu, 12 Sep 2019 23:58:58 +0000 (01:58 +0200)]
tests: Disable bgp-ecmp-topo2 topotest until proper fix is developed

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
5 years agoMerge pull request #4971 from mjstapp/fix_redist_update_7_2
Donald Sharp [Thu, 12 Sep 2019 21:41:06 +0000 (17:41 -0400)]
Merge pull request #4971 from mjstapp/fix_redist_update_7_2

[7.2] zebra: revise redistribution delete to improve update case

5 years agozebra: revise redistribution delete to improve update case 4971/head
Mark Stapp [Thu, 12 Sep 2019 15:30:42 +0000 (11:30 -0400)]
zebra: revise redistribution delete to improve update case

When selecting a new best route, zebra sends a redist update
when the route is installed. There are cases where redist
clients may not see that redist add - clients who are not
subscribed to the new route type, e.g. In that case, attempt
to send a redist delete for the old/previous route type.

Revised the redist delete api to accomodate both cases;
also tightened up the const-ness of a few internal redist apis.

[7.2 version]

Signed-off-by: Mark Stapp <mjs@voltanet.io>