diff mbox

nl_socket_set_buffer_size usage

Message ID 54C665BF.8050006@gmail.com
State Superseded
Headers show

Commit Message

Jonathan Bither Jan. 26, 2015, 4:05 p.m. UTC
Hello Jouni,

I was unable to build hostapd this morning on CentOS6 again after commit 
"630b323 nl80211: Increase netlink receive buffer size".

libnl1 doesn't provide "nl_socket_set_buffer_size()" so I fixed my build 
with the change below. I'm not sure if it was the appropriate method so 
I just wanted to check with you if this was the correct fix.

Thanks again,


  	 * by default. It is possible to hit that limit in some cases where
@@ -145,6 +146,7 @@ static void nl80211_register_eloop_read(struct 
nl_handle **handle,
  			   strerror(errno));
  		/* continue anyway with the default (smaller) buffer */
  	}
+#endif

  	nl_socket_set_nonblocking(*handle);
  	eloop_register_read_sock(nl_socket_get_fd(*handle), handler,

Comments

Jouni Malinen Jan. 26, 2015, 11:52 p.m. UTC | #1
On Mon, Jan 26, 2015 at 11:05:19AM -0500, Jonathan Bither wrote:
> I was unable to build hostapd this morning on CentOS6 again after
> commit "630b323 nl80211: Increase netlink receive buffer size".
> 
> libnl1 doesn't provide "nl_socket_set_buffer_size()" so I fixed my
> build with the change below. I'm not sure if it was the appropriate
> method so I just wanted to check with you if this was the correct
> fix.

Thanks for reporting this.

> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> +#ifdef CONFIG_LIBNL3_ROUTE

It would be possible to implement nl_socket_set_buffer_size() for libnl
1.1 as well, but I guess I don't really care enough about that old
version anymore to add such complexity and for now, it's fine to #ifdef
this out. That said, I'll fix this with CONFIG_LIBNL20 which is more
appropriate define to use here.
diff mbox

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index f955ee4..a29037f 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -132,6 +132,7 @@  static void nl80211_register_eloop_read(struct 
nl_handle **handle,
  					eloop_sock_handler handler,
  					void *eloop_data)
  {
+#ifdef CONFIG_LIBNL3_ROUTE
  	/*
  	 * libnl uses a pretty small buffer (32 kB that gets converted to 64 kB)