Commit Graph

29152 Commits

Author SHA1 Message Date
ckishimo
e9b0752f11 ospfd: remove extra space
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-02-01 08:51:34 +01:00
ckishimo
0b17753880 ospfd: print maximum paths in show ip ospf json
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-02-01 08:51:34 +01:00
ckishimo
f61b005a0b ospfd: print administrative distance in show ip ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-02-01 08:51:34 +01:00
ckishimo
9fdb4735ad ospfd: restart spf when distance is updated
if r1 has a route received from a neighbor with the default administrative
distance configured

    r1# sh 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, F - PBR,
           f - OpenFabric,
           > - selected route, * - FIB route, q - queued, r - rejected, b - backup
           t - trapped, o - offload failure

    O>* 1.1.1.1/32 [110/20] via 10.0.12.2, r1-r2-eth0, weight 1, 00:00:41

if we change the administrative distance

    r1(config)# router ospf
    r1(config-router)# distance 50

this is not applied as there are no changes in the routing table

    r1# sh 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, F - PBR,
           f - OpenFabric,
           > - selected route, * - FIB route, q - queued, r - rejected, b - backup
           t - trapped, o - offload failure

    O>* 1.1.1.1/32 [110/20] via 10.0.12.2, r1-r2-eth0, weight 1, 00:00:13

This commit will force the update of the routing table with the new configured distance

    r1# sh 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, F - PBR,
           f - OpenFabric,
           > - selected route, * - FIB route, q - queued, r - rejected, b - backup
           t - trapped, o - offload failure

    O>* 1.1.1.1/32 [50/20] via 10.0.12.2, r1-r2-eth0, weight 1, 00:00:14

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-02-01 08:51:17 +01:00
Iqra Siddiqui
3756b9aceb bgpd: Fixing dead code
Description:
-Removing break statements which will never be executed.
-Adding missing 'cmd' variable.

Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2022-01-31 21:50:50 -08:00
Iqra Siddiqui
761cc919fa bgpd: Fixing memcmp to avoid coverity issue
Description:
Replacing memcmp at certain places,
to avoid the coverity issues caused by it.

Co-authored-by: Kantesh Mundargi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2022-01-31 21:50:50 -08:00
Igor Ryzhov
ff8b960c1c
Merge pull request #10451 from donaldsharp/route_tag_ntohl
ospfd: Convert output to host order from network order for route_tag
2022-01-31 22:50:48 +03:00
Donatas Abraitis
3757f96485 bgpd,pimd,isisd,nhrpd: Convert to vty_json()
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-31 21:20:41 +02:00
Donald Sharp
778b4d6452
Merge pull request #10448 from ton31337/fix/zebra_ospf6d_json_leak
ospf6d: Fix memory leak for `show ipv6 ospf6 zebra json`
2022-01-31 12:58:19 -05:00
Donald Sharp
0939509df9 ospfd: Convert output to host order from network order for route_tag
FRR stores the route_tag in network byte order.  Bug filed indicates
that the `show ip ospf route` command shows the correct value.
Every place route_tag is dumped in ospf_vty.c the ntohl function
is used first.

Fixes: #10450
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-31 12:51:18 -05:00
Donatas Abraitis
8b3f1d41fe ospf6d: Fix memory leak for show ipv6 ospf6 zebra json
$ for x in $(seq 1 10000); do vtysh -c 'show ipv6 ospf6 zebra json' >/dev/null; done

Before:
```
$ vtysh -c 'show memory ospf6d' | grep 'Total heap allocated'
  Total heap allocated:  26 MiB
```

After:
```
$ vtysh -c 'show memory ospf6d' | grep 'Total heap allocated'
  Total heap allocated:  2256 KiB
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-31 16:53:23 +02:00
Mark Stapp
b86c1f4fcc zebra: name the route_entry opaque struct more specifically
The name 'opaque' is a little general - call the route_entry
struct 're_opaque' to make it more specific.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2022-01-31 08:50:50 -05:00
Donatas Abraitis
1c862c2d9e tools: Handle new lines for json_object_to_json_string_ext()
Just to handle %s and %s\n.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-31 15:34:24 +02:00
anlan_cs
32c0a2dd2c staticd: small cleanup
Two small cleanups, just remove duplication.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-31 18:44:17 +08:00
Martin Buck
5a104c8634 tests: Topotest for checking ECMP inter-area nexthop handling
Used to reproduce #9720 and may also serve as a regression test in the
future.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2022-01-31 08:31:00 +01:00
Donatas Abraitis
dc3bae68a2 tools: Stop disabled daemons when doing reload
After:
```
root@exit1-debian-11:~# grep ripngd= /etc/frr/daemons
ripngd=no
root@exit1-debian-11:~# pgrep -f ripngd -c
0
root@exit1-debian-11:~# sed -i 's/ripngd=no/ripngd=yes/' /etc/frr/daemons
root@exit1-debian-11:~# /usr/lib/frr/frrinit.sh reload
Stopped watchfrr.
Started watchfrr.
root@exit1-debian-11:~# pgrep -f ripngd -c
2
root@exit1-debian-11:~# grep ripngd= /etc/frr/daemons
ripngd=yes
root@exit1-debian-11:~# sed -i 's/ripngd=yes/ripngd=no/' /etc/frr/daemons
root@exit1-debian-11:~# /usr/lib/frr/frrinit.sh reload
Stopped watchfrr.
Started watchfrr.
Stopped ripngd.
root@exit1-debian-11:~# pgrep -f ripngd -c
0
```

Before:
```
root@exit1-debian-11:~# grep ripngd= /etc/frr/daemons
ripngd=no
root@exit1-debian-11:~# pgrep -f ripngd -c
0
root@exit1-debian-11:~# sed -i 's/ripngd=no/ripngd=yes/' /etc/frr/daemons
root@exit1-debian-11:~# /usr/lib/frr/frrinit.sh reload
Stopped watchfrr.
Started watchfrr.
root@exit1-debian-11:~# pgrep -f ripngd -c
2
root@exit1-debian-11:~# grep ripngd= /etc/frr/daemons
ripngd=yes
root@exit1-debian-11:~# sed -i 's/ripngd=yes/ripngd=no/' /etc/frr/daemons
root@exit1-debian-11:~# /usr/lib/frr/frrinit.sh reload
Stopped watchfrr.
Started watchfrr.
Stopped ripngd.
root@exit1-debian-11:~# pgrep -f ripngd -c
1 <<<<<< ripngd is running, while watchfrr skips it
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-31 08:48:44 +02:00
anlan_cs
4b939ad230 ospfd: adjust type of "aggr_delay_interval"
Adjust type of "aggr_delay_interval":
Just replace `unsigned int` with `uint16_t` for range is (50..1800).

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-28 20:11:40 -05:00
anlan_cs
74e8311eb3 ospf6d: adjust type of "aggr_delay_interval"
Adjust type of "aggr_delay_interval":
Just replace `unsigned int` with `uint16_t` for range is (50..1800).

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-28 20:11:30 -05:00
anlan_cs
d1b1eae14b ospfd: fix missing "aggregation timer" in running configuration
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-28 20:04:31 -05:00
anlan_cs
78cf887718 ospfd: a few minor fixes on ospfd cli
Two minor fixes:
    - remove redundant "(a.b.c.d/m)" in "prefix" description
    - remove some annoying space in "summary-address" and "tag"

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-28 20:04:31 -05:00
Donatas Abraitis
53d3a0a80d bgpd: Reuse bgp_path_info_extra_get() for allocating new bgp path info
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-28 21:11:12 +02:00
Mark Stapp
a9155261f7
Merge pull request #9869 from leonshaw/fix/evpn-queue
zebra: Fix EVPN route nexthop config order
2022-01-28 11:58:43 -05:00
Russ White
80dae7afbe
Merge pull request #10357 from ton31337/fix/peer_address_self_check_relax
bgpd: Relax peer to be on the same host
2022-01-28 11:12:45 -05:00
Donald Sharp
637f95bf2d zebra: Make Router Advertisement warnings show up once every 6 hours
RA packets are pretty chatty and when there is a warning from
a missconfiguration on the network, the log file gets filed
up with warnings.  Modify the code in rtadv.c to only spit
out the warning in these cases at most every 6 hours.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-28 11:07:01 -05:00
ckishimo
94c78d3b6d ospf6d: print administrative distance in show ipv6 ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-28 14:20:14 +01:00
ckishimo
fcd45026a2 ospf6d: restart spf when distance is updated
if r1 has a route received from a neighbor and the same route
configured as static, the administrative distance will determine
which route to use

r1(config)# ipv6 route 1:1::1/128 Null0 70

r1# sh ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

S>* 1:1::1/128 [70/0] unreachable (blackhole), weight 1, 00:00:12
O   1:1::1/128 [110/20] via fe80::1833:c9ff:fe7b:3e43, r1-r2-eth0, weight 1, 00:00:49

The static route is selected. If we now change the administrative distance
in ospf6, the OSPF route should be selected

r1(config)# router ospf6
r1(config-ospf6)# distance 50

r1# sh ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

S>* 1:1::1/128 [70/0] unreachable (blackhole), weight 1, 00:00:39
O   1:1::1/128 [110/20] via fe80::1833:c9ff:fe7b:3e43, r1-r2-eth0, weight 1, 00:01:16

However the distance is not applied as there are no changes in the routing table

This commit will force the update of the routing table with the new configured distance

r1# sh ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

O>* 1:1::1/128 [50/20] via fe80::8cb7:e6ff:fef5:2344, r1-r2-eth0, weight 1, 00:00:03
S   1:1::1/128 [70/0] unreachable (blackhole), weight 1, 00:00:19

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-28 14:18:54 +01:00
Xiao Liang
8244ba34aa zebra: Fix EVPN route nexthop config order
EVPN route add should be queued to preserve the config order.
In particular, against deletion in rib_delete().

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2022-01-28 20:51:10 +08:00
Donatas Abraitis
7a90d91586
Merge pull request #10408 from idryzhov/no-opaque-by-default
*: do not send opaque data to zebra by default
2022-01-28 12:54:16 +02:00
Donatas Abraitis
9d56cc8750
Merge pull request #10159 from taspelund/retain-peer-asn
bgpd: retain peer asn even with remove-private-AS
2022-01-28 09:22:06 +02:00
Donatas Abraitis
636da186ae
Merge pull request #10389 from gromit1811/bugfix_9720_ecmp_inter_area
ospf6d: Fix ECMP inter-area route nexthop update
2022-01-28 09:09:51 +02:00
Donatas Abraitis
869f980af4
Merge pull request #10420 from donaldsharp/zebra_multicast_vrf_cleanup
zebra: Actually delete the table we are looking for
2022-01-28 08:55:12 +02:00
anlan_cs
dea8953208 doc: add "cost" to ospfd "range" command
Add "cost" for "area A.B.C.D range A.B.C.D/M".

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-27 16:52:35 -05:00
Quentin Young
4871e5d5bf
Merge pull request #10433 from idryzhov/vrrp-ip-addr-is-zero 2022-01-27 16:08:15 -05:00
Mark Stapp
13b87d339f
Merge pull request #10434 from idryzhov/isis-attached-bit
isisd: remove deprecated command
2022-01-27 15:54:59 -05:00
Igor Ryzhov
b040d06f1f isisd: remove deprecated command
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-27 21:12:22 +03:00
Igor Ryzhov
3448a75c9d vrrpd: use ipaddr_is_zero when needed
Replace custom implementation or call to ipaddr_isset with a call to
ipaddr_is_zero.

ipaddr_isset is not fully correct, because it's fine to have some
non-zero bytes at the end of the struct in case of IPv4 and the function
doesn't allow that.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-27 21:05:40 +03:00
Stephen Worley
9a7ea213c0 pbrd: pbr route maps get addr family of nhgs
When adding a nhg to a route map, make sure to specify the `family`
of the rm by looking at the contents of the nhg. Installation in the
kernel (for DSCP rules in particular) relies on this being specified in
the netlink message.

Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-01-27 12:47:00 -05:00
Donatas Abraitis
38775a3c5f bgpd: Handle TCP connection errors with connection callbacks for RPKI
Before this patch, if the first server crashed or was terminated, RPKI
connection keeps _active_ forever.

With this patch, if we catch connection problem (FATAL), we reset RPKI, to
switch to another available RTR-Server by using configured preference.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-27 17:34:15 +02:00
Donatas Abraitis
6766acddbf
Merge pull request #9880 from louis-oui/maximum-prefix-out
bgpd: fixes maximum prefix out
2022-01-27 08:49:31 +02:00
anlan_cs
ec88a72a37 ospfd: fix loss of mixed form in "range" command
Currently "range" command can only accept `cost` or `substitute`
individually, and `show running` will mix them.

So need make it accept mixed form with both of them, otherwise
configuration file in mixed form will fail to start.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-26 16:44:46 -05:00
Donatas Abraitis
2703b7db19 bgpd: Move out ipv6_ecommunity struct from attr to attr_extra
This is the initial work to move all non IPv4/IPv6 AFI related
attributes/structs to attr->extra to avoid unnecesarry allocations.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-26 21:52:40 +02:00
Louis Scalbert
49656aeb43 topotests: set bgp peer-group with maximum-prefix-out
Set different combinations of bgp peer-group with a maximum-prefix-out
value.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-26 16:50:11 +01:00
Louis Scalbert
80444d30ce bgpd: fix peer-group with maximum-prefix-out
When setting maximum-prefix-out on peer-group, the applied value on
member is 0.

Fix usage of maximum-prefix-out on peer-group.

The peer_maximum_prefix_out_(un)set functions are derived from
peer_maximum_prefix_(un)set.

Fixes: fde246e835 ("bgpd: Add an option to limit outgoing prefixes")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-26 16:49:31 +01:00
Louis Scalbert
c7ec458862 topotests: bgp no neighbor X.X.X.X maximum-prefix-out Y
Test the ability to use the following configure command with a Y value:

no neighbor X.X.X.X maximum-prefix-out Y

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-26 16:38:14 +01:00
Louis Scalbert
bc03c622e1 bgpd: allow no neighbor X.X.X.X maximum-prefix-out [(1-4294967295)]
Specifying a number is not possible with command no neighbor X.X.X.X
maximum-prefix-out

> frr(config-router-af)# no neighbor 192.168.1.2 maximum-prefix-out 1
> % Unknown command: no neighbor 192.168.1.2 maximum-prefix-out 1

This patch allows it.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-26 16:38:14 +01:00
Donald Sharp
6b390b3c7b zebra: Better handle replacing our route by a system route
When a operator has a FRR based route installed into the
FIB and a better route comes in from the system.  There
is code in the data plane to schedule the batching
and continue processing.  But in this case we are done
so we can just return

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-26 10:26:46 -05:00
Donald Sharp
457fb2c846
Merge pull request #10425 from ckishimo/ospf6d_nssa
ospf6d: show if area is NSSA
2022-01-26 09:56:34 -05:00
Donald Sharp
0955f8757b zebra: Don't double delete the table we are cleaning up
vrf_disable is always called first before
vrf_delete.  The rnh_table and rnh_table_multicast tables
are already deleted as part of vrf_disable.  No need
to do it again.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-01-26 08:21:03 -05:00
ckishimo
cfc5d4746d ospf6d: show if area is NSSA
This PR will include if the area is NSSA in the output of "show ipv6 ospf"

    r2# show ipv6 ospf
     ...
     Area 0.0.0.0
         Number of Area scoped LSAs is 8
         Interface attached to this area: r2-eth1
         SPF last executed 20.46717s ago
     Area 0.0.0.1[Stub]
         Number of Area scoped LSAs is 9
         Interface attached to this area: r2-eth0
         SPF last executed 20.46911s ago
     Area 0.0.0.2[NSSA]
         Number of Area scoped LSAs is 14
         Interface attached to this area: r2-eth2
         SPF last executed 20.46801s ago

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-25 18:49:29 +01:00
ckishimo
fb5a450fe7 ospf6d: fix indentation in show ipv6 ospf area
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2022-01-25 18:47:47 +01:00