How to increase net.core.rmem_max value from c code

前端 未结 2 1768
南方客
南方客 2021-01-23 10:11

I tried to increase the value SO_RCVBUF by getsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &rcvBufferSize, &sockOptSize) but I am not able to increase it more than rmem_

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-23 10:35

    In Linux kernels 2.6.14 and above we have SO_RCVBUFFORCE which can be used to override the rmem_max limit. However this needs CAP_NET_ADMIN to be set.

    Check https://linux.die.net/man/7/socket.

提交回复
热议问题