Commit Graph

24238 Commits

Author SHA1 Message Date
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
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
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
Igor Ryzhov
5cfffcdd8d isisd: fix dangling instances
We only need an instance when we have at least one area configured in a
VRF. Currently we have the following issues:
- instance for the default VRF is always created
- instance is not removed after the last area config is removed

This commit fixes both issues.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:12:38 +03:00
Igor Ryzhov
46c9042fbc isisd: fix memleak when deleting area and instance
Release memory for all redistributed route info.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:12:36 +03:00
Igor Ryzhov
8c6482db8c isisd: fix redistribution in vrf
When the redistribution is configured in non-default VRF, isisd should
redistribute routes from this VRF instead of default.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:12:35 +03:00
Igor Ryzhov
a601d66274 isisd: fix "default-information originate always"
We don't need to register for default routes from zebra, when the
origination type is set to "always".

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:12:34 +03:00
Igor Ryzhov
164ab8965e isisd: deregister vrf from zebra when vrf is disabled
Currently the VRF is deregistered only when it is re-enabled again.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:12:33 +03:00
Igor Ryzhov
ba51dd2605 bgpd, yang: fix replace-as yang leaf
The leaf is called "no-replace-as" in the model but is used reversed in
all the code. Let's rename it to comply with the actual behavior.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-14 17:00:11 +03:00
Russ White
a63273a5b4
Merge pull request #8556 from donaldsharp/bgp_pbr_weird
Bgp flowspec cleanups
2021-05-13 23:14:34 -04:00
Martin Winter
d8baf3db2d
Merge pull request #8144 from LabNConsulting/chopps/ly2
libyang2
2021-05-14 01:12:06 +02:00
Christian Hopps
3bb513c399 lib: adapt to version 2 of libyang
Compile with v2.0.0 tag of `libyang2` branch of:
https://github.com/CESNET/libyang

staticd init load time of 10k routes now 6s vs ly1 time of 150s

Signed-off-by: Christian Hopps <chopps@labn.net>
2021-05-13 16:24:48 -04:00
Martin Winter
d390582e64
Merge pull request #8658 from gromit1811/bugfix_8567
Fix #8567 OSPFv3-26.13 ANVL failure
2021-05-13 20:12:43 +02:00
Donald Sharp
16a8eb4d00
Merge pull request #8649 from ton31337/fix/unify-naming-for-topotests-directory
tests: Rename tests/topotests directories to be consistent
2021-05-13 07:26:15 -04:00