Commit Graph

21387 Commits

Author SHA1 Message Date
Pat Ruddy
26b6d034b0 vrrpd: Convert to using %pFX
Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-10-15 16:57:11 +01:00
Donald Sharp
f000b7c144
Merge pull request #6016 from sarav511/ppend
pimd: Handling prune received during join state and join received during prune pending
2020-10-14 20:27:17 -04:00
Donald Sharp
a5ca0ef54f
Merge pull request #5895 from patrasar/2404618
pimd: Clear (s,g,rpt) ifchannel on (*, G) prune received
2020-10-14 20:13:31 -04:00
Donald Sharp
2c6592c140
Merge pull request #7309 from mjstapp/fix_ospf_gr_reasons
ospfd: make GR reason string production safer
2020-10-14 19:19:39 -04:00
Donald Sharp
46ef2fb21f
Merge pull request #7308 from mjstapp/fix_ospf_gr_sa
ospfd: fix SA warnings in ospfd, ospfclient
2020-10-14 19:18:24 -04:00
Donald Sharp
974c396af3
Merge pull request #7310 from idryzhov/fix-no-bgp-as-path
bgpd: print error when as-path filter doesn't exist
2020-10-14 19:15:49 -04:00
Igor Ryzhov
17b4e8c439 bgpd: print error when as-path filter doesn't exist
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-14 23:10:48 +03:00
Mark Stapp
d81937481d ospfd: fix SA warnings in ospfd, ospfclient
Fix some SA warnings in ospf GR and ospfclient code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-14 13:41:00 -04:00
Mark Stapp
d05d5280e6 ospfd: make reason string production safer
Use to-string functions for GR message codes instead of raw
string array indexing; the values used can come in packets
and are not validated.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-14 12:51:52 -04:00
Donald Sharp
6431621e4e
Merge pull request #7180 from kuldeepkash/bgp-communities
tests: Add bgp_communities_topo1 test suite
2020-10-14 09:14:10 -04:00
Mark Stapp
027b3ca2e0
Merge pull request #7244 from donaldsharp/mlag_backout_and_fix
Mlag backout and fix
2020-10-14 08:30:54 -04:00
Donatas Abraitis
9ed5b22e13
Merge pull request #7283 from donaldsharp/thread_off_semantics
*: Use proper semantics for turning off thread
2020-10-14 14:50:08 +03:00
Donald Sharp
4fe30ff1eb
Merge pull request #7298 from mjstapp/quiet_opaque_debugs
zebra: quiet the zebra opaque message debugs
2020-10-14 07:27:27 -04:00
Donatas Abraitis
36601e2046
Merge pull request #7278 from donaldsharp/fix_blame_code
*: Consolidate on first git blame ignore revs
2020-10-14 09:21:50 +03:00
Donald Sharp
210993e832 *: Consolidate on first git blame ignore revs
The file .git-blame-ignore-revs was put first into
the system and is what was advertised in multiple
places.  Since .ignore-revs was just created and
no announcement was made about the creation, let's
consolidate onto the first one created.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-13 16:07:18 -04:00
Donald Sharp
ca3491262b zebra: Isolate mlag_rd_buf_offset to the actual using function
Isolate the mlag_rd_buf_offset variable to the actual used function,
instead of having it a global.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-13 16:02:05 -04:00
Donald Sharp
ded3e3e39c Revert "zebra: the mlag_rd_buf_offset variable was write only"
This reverts commit 00e0d113e5.
2020-10-13 15:57:54 -04:00
Donald Sharp
82b4a8bf2c
Merge pull request #7258 from mjstapp/zebra_remove_slsp
zebra: remove 'static' lsp objects
2020-10-13 15:51:18 -04:00
Jafar Al-Gharaibeh
5875867dba
Merge pull request #7295 from donaldsharp/ospf_crash
ospfd: Prevent crash if transferring config amongst instances
2020-10-13 13:27:55 -05:00
Jafar Al-Gharaibeh
db5e14186d
Merge pull request #7245 from donaldsharp/ospf_coverity
ospfclient: Provide some protection against blindly trusting input
2020-10-13 13:26:47 -05:00
Mark Stapp
674afc2b0a zebra: quiet the zebra opaque message debugs
Put most of the debugs about opaque ZAPI messages under 'detail'
to reduce the noise.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-10-13 14:07:17 -04:00
Jafar Al-Gharaibeh
30a276f3c1
Merge pull request #7282 from zpericic/nhrp-vici
nhrp: Configure vici socket path using configure --with-vici-socket=/…
2020-10-13 13:04:15 -05:00
Donald Sharp
c8c5009ec5
Merge pull request #7288 from rsmarples/BSD-link_state
BSD: ifi_link_state is the link state
2020-10-13 13:43:07 -04:00
Donald Sharp
aadbfa4918
Merge pull request #7294 from idryzhov/fix-no-ip-ospf-area
ospfd: fix "no ip ospf area"
2020-10-13 13:37:03 -04:00
Donald Sharp
4cf61725aa
Merge pull request #7179 from kuldeepkash/bgp_basic_functionality
tests: Enable evpn_type5_test_topo1 suite to run in CI
2020-10-13 13:33:58 -04:00
Kuldeep Kashyap
c66ca86168 tests: Enable evpn_type5_test_topo1 suite to run in CI
1. Suite: evpn_type5_test_topo1 was added to pytest.ini during triaging phase as
there was bug: https://github.com/FRRouting/frr/issues/6867, which is fixed. Enabling
suite to be run in CI.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-10-13 14:55:14 +00:00
Donald Sharp
27d84d8e00
Merge pull request #7293 from eololab/remove-remaining-keep-kernel-option
doc, zebra: remove keep_kernel option everywhere
2020-10-13 10:52:09 -04:00
Donald Sharp
2b0a32da60 ospfd: Prevent crash if transferring config amongst instances
If we enter:

int eth0
  ip ospf area 0
  ip ospf 10 area 0
!

This will crash ospf.  Prevent this from happening.

OSPF instances:

a) Cannot be mixed with non-instance
b) Are their own process.

Since in multi-instance world ospf instances are their own process,
when an ospf processes receives an instance command we must remove
our config( if present ) and allow the new config to be active
in the new process.  The problem here is that if you have not
done a `router ospf` above the lookup of the ospf pointer will
fail and we will just crash.  Put some code in to prevent a crash
in this case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-13 08:16:15 -04:00
Igor Ryzhov
e4129293c7 ospfd: fix "no ip ospf area"
This commit fixes the following behavior:
```
nfware(config)# interface enp2s0
nfware(config-if)# ip ospf area 0
nfware(config-if)# no ip ospf area 0
% [ospfd]: command ignored as it targets an instance that is not running
```

We should be able to use the command without configuring the instance.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-13 14:52:38 +03:00
Emanuele Bovisio
2a3a97be8c doc, zebra: remove keep_kernel option everywhere
remove all remaining parts related to keep_kernel option

Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
2020-10-13 12:59:50 +02:00
Patrick Ruddy
d2a516dc7a
Merge pull request #7279 from donaldsharp/17_coverity
17 coverity
2020-10-13 11:48:37 +01:00
Roy Marples
98f3df554b zebra: ifi_link_state is the link state
SIOCGIFMEDIA returns the media state.
SIOCGIFDATA returns interface data which includes the link state.

While the status of the former is usually indicitive of the latter,
this is not always the case.
Ifact some recent net80211 changes in at least NetBSD and OpenBSD
have MONITOR media set to active but the link status set to DOWN.

All interfaces will return link state with SIOCGIFDATA, unlike
SIOCGIFMEDIA. However not all BSD's support SIOCGIFDATA - it has
recently been accepted into FreeBSD-13.
However, all BSD's do report the same structure in ifa_data for
AF_LINK addresses from getifaddrs(3) so the information has always
been available.

Signed-off-by: Roy Marples <roy@marples.name>
2020-10-13 11:32:36 +01:00
Donatas Abraitis
451171c09d
Merge pull request #7277 from chiragshah6/yang_nb6
bgpd: fix crash in bgp instance creation
2020-10-13 11:12:28 +03:00
Donatas Abraitis
43bb4c9b8f
Merge pull request #7287 from taspelund/ipv4-lu-show-routes
bgpd: fix show bgp neighbor routes for labeled-unicast
2020-10-13 09:44:50 +03:00
Kuldeep Kashyap
1cba703357 tests: Add bgp_communities_topo1 test suite
1. Adding test to verify well known communities: no-export, local-AS, internet
2. Exection time is 90 sec

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2020-10-13 04:58:31 +00:00
Chirag Shah
bdaadb91e8 bgpd: use common api in bgp_get
Use consolidate api in bgp_get and bgp northbound
create callback.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-10-12 16:41:39 -07:00
Chirag Shah
a5ab756f24 bgpd: fix crash in bgp instance creation
In bgp global commands northbound local-as modify callback
check for backend db for checking existing bgp instance.

In an instance where no router bgp with old ASN cleaned up
followed by new bgp instance with new AS is created,
the nb_running_get_entry in validation phase returns stale
bgp reference, which leads to rejection of the router bgp command.

Uncovered via:
toptotest evpn_type5_test_topo1/test_evpn_type5_topo1.py
test_bgp_attributes_for_evpn_address_family_p1

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-10-12 16:13:59 -07:00
Chirag Shah
feded4118b bgpd: rename router bgp callbacks
Avoid similar name function as bgp_crate()

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-10-12 16:13:59 -07:00
Trey Aspelund
7daf25a3a8 bgpd: fix show bgp neighbor routes for labeled-unicast
bgp_show_neighbor_route() was rewriting safi from LU to uni
before checking if the peer was enabled for LU.  This resulted
in the peer's address-family check looking for unicast, which
would always fail for LU peers since unicast + LU are
mutually-exclusive AFIs.
This moves this safi reassignment after the peer AFI check,
ensuring that the peer's address-family check looks for LU
while the call to bgp_show() still uses uni.

-- highlights from manual testing

config:

router bgp 2
 neighbor 1.1.1.1 remote-as external
 neighbor 1.1.1.1 disable-connected-check
 neighbor 1.1.1.1 update-source 2.2.2.2
 !
 address-family ipv4 unicast
  no neighbor 1.1.1.1 activate
 exit-address-family
 !
 address-family ipv4 labeled-unicast
  neighbor 1.1.1.1 activate
 exit-address-family

before:

spine01# show bgp ipv4 unicast neighbors 1.1.1.1 routes
% No such neighbor or address family
spine01# show bgp ipv4 labeled-unicast neighbors 1.1.1.1 routes
% No such neighbor or address family

after:

spine01# show bgp ipv4 unicast neighbors 1.1.1.1 routes
% No such neighbor or address family
spine01# show bgp ipv4 label neighbors 1.1.1.1 routes
BGP table version is 1, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath,
              i internal, r RIB-failure, S Stale, R Removed
Origin codes: i - IGP, e - EGP, ? - incomplete
   Network          Next Hop            Metric LocPrf Weight Path
*> 11.11.11.11/32   1.1.1.1                  0             0 1 i
Displayed  1 routes and 1 total paths

Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
2020-10-12 16:19:44 -04:00
Donatas Abraitis
cefa7492f5
Merge pull request #7251 from wesleycoakley/fix-vtysh-node-build-warn-errors
vtysh: fix build-time errors for some --enable flags
2020-10-12 21:31:04 +03:00
Donatas Abraitis
600a00fe72
Merge pull request #7284 from donaldsharp/pmax
bgpd: Correctly calculate threshold being reached
2020-10-12 21:07:08 +03:00
Zoran Pericic
354196c027 nhrp: Make vici socket path configurable
nhrp: Configure vici socket path using

configure --with-vici-socket=/var/run/charon.vici

If not specified default to /var/run/charon.vici

Signed-off-by: Zoran Peričić <zpericic@netst.org>
2020-10-12 19:34:53 +02:00
Donald Sharp
b1823b69f6 bgpd: Correctly calculate threshold being reached
if (pcout > (pcount * peer->max_threshold[afi][safi] / 100 ))
is always true.  So the very first route received will always
trigger the warning.  We actually want the warning to happen
when we hit the threshold.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-12 10:36:37 -04:00
Russ White
7fabf208b0
Merge pull request #6811 from rgirada/test_helper
ospfd: ospfv2 graceful restart helper support.
2020-10-12 10:16:27 -04:00
Donald Sharp
28ef0ee121 *: Use proper semantics for turning off thread
We have this pattern in the code base:

if (thread)
	THREAD_OFF(thread);

If we look at THREAD_OFF we check to see if thread
is non-null too.  So we have a double check.
This is unnecessary.  Convert to just using THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-12 08:35:18 -04:00
Olivier Dugeon
17235eea31
Merge pull request #6927 from donaldsharp/16_coverity
Cleanup a bunch of new coverity issues
2020-10-12 09:22:46 +02:00
Donald Sharp
8ced966f39 ospfd: When failing to set socket options just note the failure
Instead of closing the socket, just note the failure and
continue on.  If we actually failed here so many other
things would not be working at all, that actually
closing the fd won't matter.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-11 12:56:02 -04:00
Donald Sharp
147bb9ed61 ripngd: Intentionally ignore return code for str2prefix_ipv6
We are calling str2prefix_ipv6 for a default route.  Since
we know this will always succeed we can safely tell the compiler
that we are ok ignoring the return code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-11 12:38:42 -04:00
Donald Sharp
2e37407f9d ospf6d, tests: Prevent use after free
The code pattern:

for (ALL_LSDB(lsdb, lsa)) {
	remove_lsa(lsa)
}

has a use after free in ALL_LSDB, since we ask for the next pointer,
after it has been freed.

Modify the code such that we grab the next pointer before we can
possibly free it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-11 11:16:44 -04:00
Donald Sharp
62270cc3ee ospf6d: Make ospf6_lsa_lock follow normal FRR pattern
The normal ospf6_lsa_lock call should return the pointer
to the lock data structure we are holding.  This is the
normal pattern for locking a data structure in FRR.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-11 11:14:45 -04:00