diff --git a/src/mnl.c b/src/mnl.c index 26f943dbb4c8..ee62c0c9c2a0 100644 --- a/src/mnl.c +++ b/src/mnl.c @@ -261,8 +261,13 @@ static void mnl_set_sndbuffer(const struct mnl_socket *nl, /* Rise sender buffer length to avoid hitting -EMSGSIZE */ if (setsockopt(mnl_socket_get_fd(nl), SOL_SOCKET, SO_SNDBUFFORCE, - &newbuffsiz, sizeof(socklen_t)) < 0) - return; + &newbuffsiz, sizeof(socklen_t)) < 0) { + /* Fall back to SO_SNDBUF, this never fails, kernel trims down + * the size to net.core.wmem_max. + */ + setsockopt(mnl_socket_get_fd(nl), SOL_SOCKET, SO_SNDBUF, + &newbuffsiz, sizeof(socklen_t)); + } } static unsigned int nlsndbufsiz;