Commit Graph

24361 Commits

Author SHA1 Message Date
Patrick Ruddy
f334254982
Merge pull request #8677 from idryzhov/isis-snmp-build-warning
isisd: fix build warning and simplify code
2021-05-19 14:39:47 +01:00
Igor Ryzhov
3558b8b8b4 pbrd: fix coverity warning
CID 1500586

There was an attempt to fix it in 920bb6f7 but the commit didn't
actually fix the warning.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-19 16:24:21 +03:00
Igor Ryzhov
f96c2b6dc2 lib: fix coverity warnings
CID 1504894

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-19 16:22:24 +03:00
Rafael Zalamena
c4aa00a776
Merge pull request #8693 from idryzhov/fix-bgp-bfd-reg
bgpd: fix zebra bfd registration
2021-05-19 09:23:28 -03:00
Olivier Dugeon
587a1dfa39
Merge pull request #8665 from volta-networks/fix_pathd_coverity
pathd: Clean coverity issues after merge pathd link state feature.
2021-05-19 14:16:00 +02:00
Donald Sharp
8a2b922c34 tests: Fixup some pylint warnings in test_multicast_pim_sm_topo2.py
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-19 08:04:50 -04:00
Igor Ryzhov
389faf93b7 zebra: fix possible uninitialized value
Found by Coverity.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-19 14:59:00 +03:00
Donald Sharp
942f6d35d3
Merge pull request #8682 from idryzhov/fix-default-originate
ospfd, ospf6d: fix "default-information originate" in non-existing vrf
2021-05-19 07:03:47 -04:00
Olivier Dugeon
ea217b376f
Merge pull request #8667 from volta-networks/fix_pathd_cli_affinity
pathd: Fix affinity command to exclude options to match implementation.
2021-05-19 12:28:28 +02:00
Olivier Dugeon
8db278b5e3 ospfd: Correct Coverity defects
When browsing or parsing OSPF LSA TLVs, we need to use the LSA length which is
part of the LSA header. This length, encoded in 16 bits, must be first
converted to host byte order with ntohs() function. However, Coverity Scan
considers that ntohs() function return TAINTED data. Thus, when the length is
used to control for() loop, Coverity Scan marks this part of the code as defect
with "Untrusted Loop Bound" due to the usage of Tainted variable. Similar
problems occur when browsing sub-TLV where length is extracted with ntohs().

To overcome this limitation, a size attribute has been added to the ospf_lsa
structure. The size is set when lsa->data buffer is allocated. In addition,
when an OSPF packet is received, the size of the payload is controlled before
contains is processed. For OSPF LSA, this allow a secure buffer allocation.
Thus, new size attribute contains the exact buffer allocation allowing a
strict control during TLV browsing.

This patch adds extra control to bound for() loop during TLV browsing to
avoid potential problem as suggested by Coverity Scan. Controls are based
on new size attribute of the ospf_lsa structure to avoid any ambiguity.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-05-19 09:48:54 +02:00
Donatas Abraitis
2794d40202
Merge pull request #8688 from idryzhov/bgp-vrf-bind-priv
bgpd: raise privs for SO_BINDTODEVICE
2021-05-19 10:02:20 +03:00
Igor Ryzhov
6bfcd0f14a bgpd: fix zebra bfd registration
If there's no default router configured at the moment when bgpd is
connected to zebra, bgpd is not registered as a BFD client.

We should do the registration regardless of the config existence.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 23:31:52 +03:00
Mark Stapp
b1ffa01dcd
Merge pull request #8686 from idryzhov/fix-doc-index
doc: remove redundant index directives
2021-05-18 15:33:48 -04:00
Donald Sharp
11d557869c build: Update configure.ac to reflect new master version
That we are building towards.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-18 14:41:39 -04:00
Igor Ryzhov
bc298f5d49 ospfd: fix SID/Label Sub TLV size
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 21:00:41 +03:00
Javier Garcia
ac57e2c9b9 pathd: Clean coverity issues after merge pathd link state feature.
Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
2021-05-18 19:50:41 +02:00
Javier Garcia
839e6ce560 pathd: Fix affinity command to exclude options to match implementation.
Including documentation update.

Signed-off-by: Javier Garcia <javier.garcia@voltanet.io>
2021-05-18 18:39:41 +02:00
Renato Westphal
0376f8a48c
Merge pull request #8608 from Fredi-raspall/pr_isis_sr_anycast
isisd: clear the N-flag in ext. reachability TLVs
2021-05-18 11:35:58 -03:00
Olivier Dugeon
365215dd4b
Merge pull request #8133 from gpnaveen/ospf_basic_testcases
tests: adding ospf basic 2 testcases.
2021-05-18 16:26:12 +02:00
Donald Sharp
cd43ad3ea9
Merge pull request #8673 from LabNConsulting/chopps/ly2-again
lib: libyang2 add missed conversion
2021-05-18 10:21:51 -04:00
Igor Ryzhov
0def0c9fa3 bgpd: raise privs for SO_BINDTODEVICE
The priv raise was incorrectly dropped in 97896a9.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 17:07:06 +03:00
Igor Ryzhov
dc47f2e726 doc: remove redundant index directives
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 15:29:59 +03:00
Patrick Ruddy
4006e41baf
Merge pull request #8646 from chiragshah6/mdev
zebra: evpn check vni oper state in svi up/down event
2021-05-18 11:45:56 +01:00
Fredi Raspall
249c445783 isisd: simplify node Sid handling
Centralize the n-flag-clear processing to a single point.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-05-18 10:54:54 +02:00
Fredi Raspall
8f6a0d6402 isisd: clear the N-flag in ext. reachability TLVs
If the n-flag-clear option is set in the configuration of a prefix
segment, clear the flag in the extended ip reachability TLVs.

RFCs 7794 and 8667 are not too strict on the setting / clearing the
N-flag in prefix SIDs. However, if there exists a cmd line option
to clear it, it should be cleared in the TLVs announced, as other
vendors do.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-05-18 10:54:11 +02:00
Donatas Abraitis
82689214b5
Merge pull request #8535 from opensourcerouting/zlog-rnode
zebra: replace _rnode_zlog with %pZN ext
2021-05-18 09:50:42 +03:00
nguggarigoud
8694dd78db tests: adding ospf basic 2 testcases.
Test cases included are 1 ospf cost, 1 ospf mtu.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2021-05-17 19:23:15 -07:00
Christian Hopps
af1b88e990 lib: libyang2 add missed conversion
Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-17 22:13:59 -04:00
Kuldeep Kashyap
f0cbb887f1 tests: Fix for multicast_pim_sm failure
Test case test_verify_mroute_when_5_different_receiver_joining_same_sources_p0
is failing intermittently in master. Fixed the issue.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-05-17 18:52:55 -07:00
Renato Westphal
5e6f6c964d
Merge pull request #8680 from idryzhov/rip-ripng-fix-crash
ripd, ripngd: fix interface wakeup after shutdown
2021-05-17 22:47:27 -03:00
Kuldeep Kashyap
ba00df52eb tests: Add bgp_gshut_topo1 suite
1. Automated test cases to verify BGP Graceful Shutdown community functionality,
   with 2 different topologies.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2021-05-17 17:49:10 -07:00
Igor Ryzhov
23929ec918 ospf6d: free "default-information originate" config when removing router
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 01:27:16 +03:00
Igor Ryzhov
c84bbb2ad0 ospf6d: fix crash when removing router from vrf that doesn't exist
`listgetdata(listhead(list))` crashes for an empty list.

Reproducible with:
```
router ospf6 vrf doesntexist
 default-information originate always
 exit
no router ospf6 vrf doesntexist
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 01:27:16 +03:00
Igor Ryzhov
8696e8be34 ospf6d: always free redistribute config
When the ospf6 instance in unknown VRF is deleted, the redistribution
config is not freed, because it is not registered in zebra. We should
always free the config regardless of zebra registration status.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 01:27:16 +03:00
Igor Ryzhov
82bc4b8a96 ospf6d: fix "default-information originate" in non-existing vrf
If the default route redistribution is configured in OSPF6 router before
the VRF is created, then this is not currently registered in zebra after
the VRF creation.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 01:24:22 +03:00
Igor Ryzhov
b46538c4a3 ospfd: fix "default-information originate" in non-existing vrf
If the default route redistribution is configured in OSPF router before
the VRF is created, then this is not currently registered in zebra after
the VRF creation.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-18 01:23:35 +03:00
Sri Mohana Singamsetty
ea9aa70547
Merge pull request #8643 from icosahedral/master
bgpd: modify path selection for EVPN type-5 routes
2021-05-17 11:43:35 -07:00
Mark Stapp
c78b7bc4a3
Merge pull request #8676 from idryzhov/test-gitignore
tests: fix missing gitignore entry
2021-05-17 12:44:13 -04:00
Igor Ryzhov
29ceb84855 ripngd: fix interface wakeup after shutdown
RIPNG schedules a call to `ripng_interface_wakeup` in 1 second after
receiving the interface UP event from zebra. The function is called even
if the interface was shut down during this interval.

This is incorrect and also leads to a crash in the following scenario:
```
vtysh -c "conf" -c "router ripng vrf red" -c "network enp2s0"
ip link add red type vrf table 1
ip link set enp2s0 vrf red
ip link set enp2s0 down
ip link set enp2s0 up && sleep 2 && ip link del red
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-17 19:35:57 +03:00
Igor Ryzhov
8f0c2688d7 ripd: fix interface wakeup after shutdown
RIP schedules a call to `rip_interface_wakeup` in 1 second after
receiving the interface UP event from zebra. The function is called even
if the interface was shut down during this interval.

This is incorrect and also leads to a crash in the following scenario:
```
vtysh -c "conf" -c "router rip vrf red" -c "network enp2s0"
ip link add red type vrf table 1
ip link set enp2s0 vrf red
ip link set enp2s0 down
ip link set enp2s0 up && ip link del red
```

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-17 19:34:11 +03:00
Alexander Chernavin
b50a061064 bgpd: recalc peer's sort after changing confed peers
Currently, when AS number of an existing BGP neighbor is added in a BGP
confederation, AS_CONFED_SEQUENCE segment attribute will be missing in
prefixes advertised to the neighbor. Also, receiving prefixes from the
neighbor will be withdrawn because of "Malformed AS path from A.B.C.D".

    neighbor 10.100.200.3 remote-as 123
    bgp confederation identifier 65001
    bgp confederation peers 123

With this change, update peer's sort after adding or removing its AS
number in a BGP confederation.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
2021-05-17 06:33:27 -04:00
Igor Ryzhov
5ff4ad8ee3 isisd: fix build warning and simplify code
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-17 13:07:24 +03:00
Igor Ryzhov
d769bde5be tests: fix missing gitignore entry
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-17 13:01:55 +03:00
Wesley Coakley
64f37745da
pbrd: nhg "add" edge case for last in table range
When handling the addition of a nhg which would saturate the range of
tables PBR is configured to install into, handle this *before* a
possible call to pbr_nhgc_alloc during hash query

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-05-16 17:33:27 -04:00
Wesley Coakley
389571aaf4
pbrd: use sparse table for allocated NHG table IDs
Represent installed ("allocated") NHG tables with a hash keyed by table
ID. Replaces a pre-allocated array of booleans that implemented this
functionality before.

+ PBR table range > 65535 is fixed (was OOB access before :))
+ Pre-compute next available ID to save time when only checking
  if all tables are allocated

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
2021-05-16 17:33:03 -04:00
Igor Ryzhov
4d1bf2b129
Merge pull request #8672 from qlyoung/fix-bgp-timer-display 2021-05-15 14:18:50 +03:00
Donatas Abraitis
1ebc214ea6 tests: Check if opaque data from BGP is accessable in Zebra
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-14 22:12:33 +03:00
Donatas Abraitis
94effaf032 zebra: Send more OPAQUE data from BGP
This includes community and large-community data.

```
exit1-debian-9# show ip route 172.16.16.1/32
Routing entry for 172.16.16.1/32
  Known via "bgp", distance 20, metric 0, best
  Last update 00:00:23 ago
  * 192.168.0.2, via eth1, weight 1
    AS-Path          : 65030
    Communities      : 65001:1 65001:2 65001:3 65001:4 65001:5 65001:6
    Large-Communities: 65001:123:1 65001:123:2
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-14 22:12:33 +03:00
Donatas Abraitis
638fc64c64 zebra: Format changes for evpn_mh_neigh_holdtime_cmd
Just to avoid fixing all the time manually this stuff after not relevant
changes.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-05-14 22:12:33 +03:00
Quentin Young
9800cfff2b bgpd: fix display of timers when only 1 is changed
When only one of the keepalive or hold timers is changed from the
default, bgp won't print the timers command in the config.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2021-05-14 14:59:16 -04:00