summaryrefslogtreecommitdiff
path: root/vtysh
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2024-12-03 18:49:59 -0500
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-12-04 12:47:35 +0000
commit16bb1dd5b0343f03ae2fd455eeaebdaf89ec9ebc (patch)
tree75d14a22657e5e4d72d232cf99b61b81c069b4e4 /vtysh
parent7aa65cfefcebc512e95e30f68e4aac7e9b36d46c (diff)
lib,vtysh: Use backoff setsockopt option for freebsd
Commit: 9112fb367b1ae0168b4e7a81f41c2ca621979199 Introduced the idea of setting the socket buffer send/receive sizes. BSD's in general have the fun issue of not allowing nearly as large as a size as linux. Since the above commit was developed on linux and not run on bsd it was never tested. Modify the codebase to use the backoff setsockopt that we have in the code base and use the returned values to allow us to notice what was set and respond appropriately. Signed-off-by: Donald Sharp <sharpd@nvidia.com> (cherry picked from commit 959dbe27cde21ab212f6566b30865b2da418b4d2)
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/vtysh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 2d80feef6c..92f37f193a 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -39,6 +39,7 @@
#include "frrstr.h"
#include "json.h"
#include "ferr.h"
+#include "sockopt.h"
DEFINE_MTYPE_STATIC(MVTYSH, VTYSH_CMD, "Vtysh cmd copy");
@@ -4694,9 +4695,8 @@ static int vtysh_connect(struct vtysh_client *vclient)
* Increasing the RECEIVE socket buffer size so that the socket can hold
* after receving from other process.
*/
- ret = setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&rcvbufsize,
- sizeof(rcvbufsize));
- if (ret < 0) {
+ ret = setsockopt_so_recvbuf(sock, rcvbufsize);
+ if (ret <= 0) {
#ifdef DEBUG
fprintf(stderr, "Cannot set socket %d rcv buffer size, %s\n",
sock, safe_strerror(errno));