<div dir="ltr">Hi Sedat,<div><br></div><div>The change looks good. I haven't tested it yet, but when I get a chance to test I doubt I'll find any reason to not merge the change.</div><div><br></div><div>I'll make a new release in a few weeks with the change.</div>
<div><br></div><div>Thanks,<br>Reuben</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 7, 2013 at 6:12 PM, Sedat Dilek <span dir="ltr"><<a href="mailto:sedat.dilek@gmail.com" target="_blank">sedat.dilek@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My build with radvd-1.9.3 and the Freetz build-system breaks with a<br>
Linux-kernel v2.6.13.1 like this:<br>
<br>
netlink.c: In function 'netlink_socket':<br>
netlink.c:84:41: error: 'NETLINK_NO_ENOBUFS' undeclared (first use in<br>
this function)<br>
netlink.c:84:41: note: each undeclared identifier is reported only<br>
once for each function it appears in<br>
make[2]: *** [netlink.o] Error 1<br>
<br>
This is obvious as my kernel-sources have no "NETLINK_NO_ENOBUFS" definition<br>
in "include/linux/netlink.h".<br>
<br>
The culprit is the else-if line here:<br>
<br>
[ netlink.c ]<br>
<br>
int netlink_socket(void)<br>
{<br>
...<br>
if (sock == -1) {<br>
flog(LOG_ERR, "Unable to open netlink socket: %s", strerror(errno));<br>
}<br>
else if (setsockopt(sock, SOL_NETLINK, NETLINK_NO_ENOBUFS, &val, sizeof(val)) < 0 ) {<br>
flog(LOG_ERR, "Unable to setsockopt NETLINK_NO_ENOBUFS: %s", strerror(errno));<br>
}<br>
...<br>
<br>
The NETLINK_NO_ENOBUFS socket flag was first introduced with Linux-kernel<br>
v2.6.29-rc7:<br>
<br>
commit 38938bfe3489394e2eed5e40c9bb8f66a2ce1405<br>
"netlink: add NETLINK_NO_ENOBUFS socket flag"<br>
<br>
The issue in radvd was introduced with:<br>
<br>
commit de9a8849258b2a6a125d686dcb9c424affad354d<br>
"setsockopt NETLINK_NO_ENOBUFS"<br>
<br>
I have added extra checks for SOL_NETLINK and NETLINK_NO_ENOBUFS definitions<br>
which fixes the issue for me.<br>
<br>
NOTE: Compile-tested only!<br>
Signed-off-by: Sedat Dilek <<a href="mailto:sedat.dilek@gmail.com">sedat.dilek@gmail.com</a>><br>
---<br>
netlink.c | 2 ++<br>
1 file changed, 2 insertions(+)<br>
<br>
diff --git a/netlink.c b/netlink.c<br>
index a37ccad..d405731 100644<br>
--- a/netlink.c<br>
+++ b/netlink.c<br>
@@ -81,9 +81,11 @@ int netlink_socket(void)<br>
if (sock == -1) {<br>
flog(LOG_ERR, "Unable to open netlink socket: %s", strerror(errno));<br>
}<br>
+#if defined SOL_NETLINK && defined NETLINK_NO_ENOBUFS<br>
else if (setsockopt(sock, SOL_NETLINK, NETLINK_NO_ENOBUFS, &val, sizeof(val)) < 0 ) {<br>
flog(LOG_ERR, "Unable to setsockopt NETLINK_NO_ENOBUFS: %s", strerror(errno));<br>
}<br>
+#endif<br>
<br>
memset(&snl, 0, sizeof(snl));<br>
snl.nl_family = AF_NETLINK;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.4<br>
<br>
</font></span></blockquote></div><br></div>