Commit 76db959b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Increase size of netlink socket buffer.

This appears to get rid with ENOBUFS on recvmsg.  Kill me if I know why.
parent 480c78c9
......@@ -232,6 +232,7 @@ static int
netlink_socket(struct netlink *nl, uint32_t groups)
{
int rc;
int rcvsize = 512 * 1024;
nl->sock = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if(nl->sock < 0)
......@@ -252,6 +253,20 @@ netlink_socket(struct netlink *nl, uint32_t groups)
if(rc < 0)
goto fail;
#ifdef SO_RCVBUFFORCE
rc = setsockopt(nl->sock, SOL_SOCKET, SO_RCVBUFFORCE,
&rcvsize, sizeof(rcvsize));
#else
rc = -1;
#endif
if(rc < 0) {
rc = setsockopt(nl->sock, SOL_SOCKET, SO_RCVBUF,
&rcvsize, sizeof(rcvsize));
if(rc < 0) {
perror("setsockopt(SO_RCVBUF)");
}
}
rc = bind(nl->sock, (struct sockaddr *)&nl->sockaddr, nl->socklen);
if(rc < 0)
goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment