Commit Graph

35921 Commits

Author SHA1 Message Date
Bing Shui
913567c0e0 ospfd: fix 'no write-multiplier' command
Signed-off-by: Bing Shui <652023330037@smail.nju.edu.cn>
2024-04-17 10:41:11 +00:00
Bing Shui
d249a7c9f5 ospfd: fix 'no maximum-paths' command
Signed-off-by: Bing Shui <652023330037@smail.nju.edu.cn>
2024-04-17 10:39:02 +00:00
Louis Scalbert
bc529cf92b bgpd: cleanup references to debug bgp allow-martians
The debug command was removed in 17e9298e47 ("bgpd: Remove 'debug bgp
allow-martian'")

Cleanup all references to the debug command.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-17 09:55:54 +02:00
Igor Ryzhov
5f018a36d5 lib: fix keychain NB crash
Operational data should not be used on validation stage. Move the usage
to apply stage only.

Fixes #15707.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-16 23:34:20 +03:00
Russ White
5ef6a2bb54
Merge pull request #15715 from zhou-run/202404092057
isisd: The hold time of hello packets on a P2P link does not match the sending interval.
2024-04-16 15:51:12 -04:00
Igor Ryzhov
57811a53ba lib, zebra: fix exit commands
If a command is not marked as `YANG`-converted, the current command
batching buffer is flushed before executing the command. We shouldn't
flush the buffer when executing an `exit` command. It should only be
flushed if the next command is not `YANG`-converted, which is checked by
the command itself, not the previous `exit`.

Fixes #15706.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-16 22:18:01 +03:00
Rajasekar Raja
33dccbe31c zebra: Actually display I/O buffer sizes (part-2)
An extension of commit-8d8f12ba8e5cd11c189b8475b05539fa8415ccb9

Removing ifdef DEV_BUILD in stream_fifo_push as well to make the 'sh
zebra client' display the current I/O fifo along with max fifo items.

TICKET :#3390099

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-04-16 11:33:08 -07:00
Mark Stapp
84d1fb19e2
Merge pull request #15709 from chiragshah6/fdev2
tools: frr-reload strip interface vrf ctx line
2024-04-16 11:32:18 -04:00
Philippe Guibert
2a384f14c1 bgpd: add redistribute table-direct command for ipv6-unicast
The 'table-direct' redistribute command is available for ipv4 unicast but
not for ipv6 unicast.

Add the command to ipv6 unicast as well.

Fixes: b6367f8460 ("bgpd: add redistribute table-direct support")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2024-04-16 15:12:58 +00:00
Russ White
314e9f9803
Merge pull request #15755 from opensourcerouting/fix/check_for_bgpd_rpki
vtysh: Check if bgpd is enabled before installing vtysh commands for RPKI
2024-04-16 10:19:26 -04:00
Russ White
0719f6f513
Merge pull request #15733 from opensourcerouting/fix/json_output_for_show_bgp_ipv4_unicast_json_detail
bgpd: Drop newline in JSON output for `show bgp afi safi json detail`
2024-04-16 10:15:20 -04:00
Russ White
ee77989ffa
Merge pull request #15732 from opensourcerouting/fix/drop_bgp_network_import_check_exact_cmd
bgpd: Drop `bgp_network_import_check_exact_cmd` command
2024-04-16 10:14:41 -04:00
Russ White
057d56ee29
Merge pull request #15726 from donaldsharp/med_value
bgpd: Fix display when using `missing-as-worst`
2024-04-16 10:14:12 -04:00
Russ White
13d598712a
Merge pull request #15616 from pguibert6WIND/srv6_seg_list_sid_order
zebra: fix static srv6 segment-list sid order
2024-04-16 07:55:05 -04:00
Russ White
1c043440ea
Merge pull request #15572 from donaldsharp/best_path_stuff_sigh
bgp_process work
2024-04-16 07:52:09 -04:00
Martin Winter
81d63e476a
debian, redhat, snapcraft: Libyang min version is 2.1.128
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2024-04-16 13:45:12 +02:00
Donatas Abraitis
d9d6db4582 vtysh: Check if bgpd is enabled before installing vtysh commands for RPKI
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-16 11:56:39 +03:00
Donatas Abraitis
f26a44f8dc
Merge pull request #15749 from idryzhov/fix-dnssl
zebra: fix encoded DNSSL length
2024-04-16 07:19:06 +03:00
Igor Ryzhov
8d6f7a4397 zebra: fix encoded DNSSL length
The encoded DNSSL length is not set so the value is missing from RA
packet.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-15 23:31:26 +03:00
Donald Sharp
bc9885b22e bgpd: Fix display when using missing-as-worst
The usage of the `bgp bestpath med missing-as-worst` command
was being accepted and applied during bestpath, but during output
of the routes affected by this it would not give any indication
that this was happening or what med value was being used.

Fixes: #15718
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-15 12:33:53 -04:00
Donald Sharp
572b6f3145
Merge pull request #15724 from opensourcerouting/fix/ospfd_cleanup_deprecation
ospfd, ospf6d: Remove deprecated JSON fields
2024-04-15 11:29:04 -04:00
Mark Stapp
2b813abb63
Merge pull request #15728 from raja-rajasekar/rajasekarr/backpressure_fix_coverity
zebra: backpressure - Fix Null ptr access (Coverity Issue)
2024-04-15 11:26:54 -04:00
Donald Sharp
54cfb13e4d
Merge pull request #15735 from opensourcerouting/feature/maximum-prefix_evpn
bgpd: Allow using maximum-prefix for EVPN
2024-04-15 11:24:05 -04:00
Donald Sharp
971455c9f3
Merge pull request #15734 from opensourcerouting/fix/compile_truncation
Fix compile warning with -Wformat-truncation
2024-04-15 11:23:15 -04:00
Donald Sharp
8085d2fb71
Merge pull request #15741 from opensourcerouting/fix/flowspec_redirect_ipv6_community
bgpd: Flow Spec redirect IPv6 Extended Community should be 0x0d
2024-04-15 11:22:37 -04:00
Donatas Abraitis
348ad00b19
Merge pull request #15686 from pguibert6WIND/tcp_non_established_get_port_and_ip
BGP TCP non established : get port and ip
2024-04-15 16:40:15 +03:00
Donatas Abraitis
e53918e499
Merge pull request #15743 from anlancs/compile-bgp-vnc
bgpd: fix compile error
2024-04-15 16:33:04 +03:00
anlan_cs
399de5c15c bgpd: fix compile error
This is happening when configuring with `--disable-bgp-vnc`:
```
./bgpd/bgp_route.c:3342:23: error: unused variable ‘p’ [-Werror=unused-variable]

 3342 |  const struct prefix *p = bgp_dest_get_prefix(dest);
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-15 16:15:33 +08:00
Philippe Guibert
78ce63952a bgpd: fix addressing information of non established outgoing sessions
When trying to connect to a BGP peer that does not respons, the 'show
bgp neighbors' command does not give any indication on the local and
remote addresses used:

> # show bgp neighbors
>  BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
>   Local Role: undefined
>   Remote Role: undefined
>   BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
>   BGP state = Connect
> [..]
>   Connections established 0; dropped 0
>   Last reset 00:00:04,   Waiting for peer OPEN (n/a)
>   Internal BGP neighbor may be up to 255 hops away.
> BGP Connect Retry Timer in Seconds: 120
> Next connect timer due in 117 seconds
> Read thread: off  Write thread: off  FD used: 27

The addressing information (address and port) are only available
when TCP session is established, whereas this information is present
at the system level:

> root@ubuntu2204:~# netstat -pan | grep 192.0.2.1
> tcp        0      0 192.0.2.1:179           192.0.2.150:38060       SYN_RECV    -
> tcp        0      1 192.0.2.1:46526         192.0.2.150:179         SYN_SENT    488310/bgpd

Add the display for outgoing BGP session, as the information in
the getsockname() API provides information for connected streams.
When getpeername() API does not give any information, use the peer
configuration (destination port is encoded in peer->port).

> # show bgp neighbors
> BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
>   Local Role: undefined
>   Remote Role: undefined
>   BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
>   BGP state = Connect
> [..]
>   Connections established 0; dropped 0
>   Last reset 00:00:16,   Waiting for peer OPEN (n/a)
> Local host: 192.0.2.1, Local port: 46084
> Foreign host: 192.0.2.150, Foreign port: 179

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-15 09:16:54 +02:00
Philippe Guibert
ba71303099 bgpd: remove useless control checks about TCP connection
When attempting to get the src and destination addresses of a given
connection, the API may return the NULL pointer, but further code
in bgp_zebra_nexthop_set() already does a check about the given
pointer.

Relaxing the error code for all the returned adressing.

Fixes: 1ff9a34058 ("bgpd: bgpd-fsm-fix.patch")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-15 09:04:36 +02:00
Donatas Abraitis
36405f97e2 bgpd: Flow Spec redirect IPv6 Extended Community should be 0x0d
RFC 8956 defines this already clearly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-15 09:27:07 +03:00
Igor Ryzhov
d315382d47 bfdd: fix BFD_GETCBIT
The macro should check C bit, not F bit.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-15 01:57:16 +03:00
Donatas Abraitis
cc04847730
Merge pull request #15592 from pguibert6WIND/fix_srte_color
bgpd: fix register NHT with appropriate colored ext. community
2024-04-14 21:09:47 +03:00
Donatas Abraitis
deef11a22b
Merge pull request #15612 from sri-mohan1/srib-24-zebra-b
zebra: changes for code maintainability
2024-04-14 21:06:28 +03:00
Donatas Abraitis
33331ab302
Merge pull request #15731 from anlancs/bgpd-add-gr-fsm
bgpd: adjust checking return value for commands
2024-04-13 23:19:49 +03:00
Donatas Abraitis
6b90e6140f tests: Check if maximum-prefix works for EVPN stuff also
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-13 23:10:27 +03:00
Donatas Abraitis
0c54dfde69 bgpd: Allow using maximum-prefix for EVPN
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-13 23:10:21 +03:00
Donatas Abraitis
f003ccf16b ospfd: Fix compile warning with -Wformat-truncation
ospfd/ospf_sr.c: In function ‘show_sr_node.part.5’:
ospfd/ospf_sr.c:2745:32: warning: ‘%u’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
    snprintf(tmp, sizeof(tmp), "%u", i);
                                ^~
ospfd/ospf_sr.c:2745:31: note: directive argument in the range [0, 2147483646]
    snprintf(tmp, sizeof(tmp), "%u", i);

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-13 22:41:43 +03:00
Donatas Abraitis
50e85abc25 isisd: Fix compile warning with -Wformat-truncation
isisd/isis_spf.c: In function ‘show_isis_route_common’:
isisd/isis_spf.c:3034:39: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
     snprintf(key, sizeof(key), "level-%d", level);
                                       ^~
isisd/isis_spf.c:3034:32: note: directive argument in the range [1, 2147483646]
     snprintf(key, sizeof(key), "level-%d", level);
                                ^~~~~~~~~~

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-13 22:40:46 +03:00
Donatas Abraitis
88c55b8e6f
Merge pull request #15727 from donaldsharp/evpn_zebra_interactions
Evpn zebra interactions
2024-04-13 22:19:10 +03:00
Donatas Abraitis
1dc28e1d73 bgpd: Drop newline in JSON output for show bgp afi safi json detail
Before:

```
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 2,
 "routerId": "1.1.1.1",
 "defaultLocPrf": 100,
 "localAS": 65001,
 "routes": { "192.168.1.0/24": {
"prefix": "192.168.1.0/24",
"version": "1",

"paths": [{"aspath":{"string":"Local","segments":[],"length":0},"origin":"IGP","metric":0,"weight":32768,"valid":true,"version":1,"sourced":true,"local":true,"bestpath":{"overall":true,"selectionReason":"First path received"},"lastUpdate":{"epoch":1713035588,"string":"Sat Apr 13 22:13:08 2024\n"},"nexthops":[{"ip":"0.0.0.0","hostname":"donatas.net","afi":"ipv4","metric":0,"accessible":true,"used":true}],"peer":{"peerId":"0.0.0.0","routerId":"1.1.1.1"}}]
} ,"192.168.11.0/24": {
"prefix": "192.168.11.0/24",
"version": "2",

"paths": [{"aspath":{"string":"Local","segments":[],"length":0},"origin":"IGP","metric":0,"weight":32768,"valid":true,"version":2,"sourced":true,"local":true,"bestpath":{"overall":true,"selectionReason":"First path received"},"lastUpdate":{"epoch":1713035588,"string":"Sat Apr 13 22:13:08 2024\n"},"nexthops":[{"ip":"0.0.0.0","hostname":"donatas.net","afi":"ipv4","metric":0,"accessible":true,"used":true}],"peer":{"peerId":"0.0.0.0","routerId":"1.1.1.1"}}]
}  }  }
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-13 22:17:01 +03:00
Donatas Abraitis
a4737997ad bgpd: Drop bgp_network_import_check_exact_cmd command
Not documented, and it's just an alias.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-13 22:10:14 +03:00
anlan_cs
70c4dea8a9 bgpd: prompt should be given only for the real change
Prompt nothing for an empty (and failed) operation.  Take
`bgp graceful-restart` as an example:

Before:
```
anlan(config-router)# bgp graceful-restart
Graceful restart configuration changed, reset all peers to take effect
anlan(config-router)# bgp graceful-restart
Graceful restart configuration changed, reset all peers to take effect
anlan(config-router)#
```

After:
```
anlan(config-router)# bgp graceful-restart
Graceful restart configuration changed, reset all peers to take effect
anlan(config-router)# bgp graceful-restart
anlan(config-router)#
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-13 09:35:37 +08:00
anlan_cs
1a8725b11f bpgd: adjust return value for the same command
The same command should be accepted, it is an empty operation.  Take
`neighbor <X> graceful-restart-helper` as an example:

Before:
```
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
% The Graceful Restart command used is not valid at this moment.
anlan(config-router)#
```

After:
```
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
anlan(config-router)#
```

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-13 09:28:55 +08:00
Rajasekar Raja
ed7005d0ed zebra: backpressure - Fix Null ptr access (Coverity Issue)
Fix dereferencing NULL ptr making coverity happy.

Ticket :#3390099

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-04-12 09:48:00 -07:00
Igor Ryzhov
b6e6656a2e
Merge pull request #15697 from zmw12306/bfd_check_Mflag
bfdd: Add check for flag Multipoint (M)
2024-04-12 16:09:43 +03:00
Donald Sharp
c8e0ece39d bgpd: Convert int's to bool in a couple of spots
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-12 07:35:38 -04:00
Donald Sharp
9edf45b889 bgpd: Increase install/uninstall speed of evpn vpn vni's
BGP receives notification from zebra about an vpn that
needs to be installed into the evpn tables.  Unfortunately
this function was walking the entirety of evpn tables
3 times.  Modify the code to walk the tree 1 time and
to just look for the needed route types as you go.

This reduces, in a scaled environment, processing
time of the zclient_read function from 130 seconds
to 95 seconds.  For a up / down / up interface
scenario.

Signed-off-by: Rajasekar Raja <rajasekarr@vndia.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-12 07:35:38 -04:00
Jafar Al-Gharaibeh
692f916b88
Merge pull request #15688 from mjstapp/dplane_api_version
lib, zebra: Add a version scheme for the dataplane API
2024-04-11 23:54:02 -05:00
zmw12306
665ec41339 bfdd: add check for flag M
Signed-off-by: zmw12306 <zmw12306@gmail.com>
2024-04-11 20:30:56 -04:00