<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello guys,<br>
<br>
I'am having some trouble to use libnl 3.0 (from git) with a
multi-threaded app.<br>
<br>
I my case, I have 2 thread that allocate their own nl_socket .<br>
Is this the rigth way ? Should I share a socket with all the thread
?<br>
<br>
My issue is that i get a error with the bind() call in the function
nl_connect().<br>
<blockquote type="cite"> err = bind(sk->s_fd, (struct sockaddr*)
&sk->s_local, sizeof(sk->s_local));<br>
if (err < 0) {<br>
err = -nl_syserr2nlerr(errno);<br>
goto errout;<br>
}<br>
</blockquote>
<br>
The response is errno=10 "No child processes"<br>
<br>
So i checked into the var sk->s_local ( my process pid is <font
color="#ff0000">6808</font>)<br>
Thread that doesn't get any error : s_local = {nl_family = 16,
nl_pad = 0, nl_pid = <font color="#ff0000">6808</font>, nl_groups =
0},<br>
Thread that does get an error : s_local = {nl_family = 16, nl_pad =
0, nl_pid = <font color="#ff0000">4201112</font>, nl_groups = 0},<br>
<br>
I didn't took time to understand the function
generate_local_port(), but it seems realy obscure to me.<br>
As far a I understood generate_local_port(), the bit mapping seeme
to be correct: <br>
<font color="#ff0000">6808 : </font> <font
color="#ff6600">0000000000</font>1101010011000<br>
<font color="#ff0000">4201112:</font> <font
color="#ff6600">1000000000</font>1101010011000<br>
<br>
So the question is for me : Does libnl support multihtreaded apps ?<br>
<br>
Does someone hase any idea ?<br>
<br>
Any help would be welcome.... <br>
<br>
Regards,<br>
<br>
Romary Sonrier<br>
<br>
<br>
<br>
</body>
</html>