Skip to content

[FreeBSD] failed to set socket option 4098 #2306

@thierry-FreeBSD

Description

@thierry-FreeBSD

On FreeBSD, trying to increase the size of the send and receive UDP buffers fails, with the message "failed to set socket option 4098" (lines https://github.com/TokTok/c-toxcore/blob/master/toxcore/network.c#L1067 and https://github.com/TokTok/c-toxcore/blob/master/toxcore/network.c#L1071).

Waiting for a better fix, I have just disabled these lines for the moment:

--- toxcore/network.c.orig	2022-04-18 18:12:07 UTC
+++ toxcore/network.c
@@ -1063,6 +1063,7 @@ Networking_Core *new_networking_ex(
      */
     int n = 1024 * 1024 * 2;
 
+#if !defined(__FreeBSD__)
     if (net_setsockopt(ns, temp->sock, SOL_SOCKET, SO_RCVBUF, &n, sizeof(n)) != 0) {
         LOGGER_ERROR(log, "failed to set socket option %d", SO_RCVBUF);
     }
@@ -1070,6 +1071,7 @@ Networking_Core *new_networking_ex(
     if (net_setsockopt(ns, temp->sock, SOL_SOCKET, SO_SNDBUF, &n, sizeof(n)) != 0) {
         LOGGER_ERROR(log, "failed to set socket option %d", SO_SNDBUF);
     }
+#endif
 
     /* Enable broadcast on socket */
     int broadcast = 1;

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions