The flag was not actually used.
NL_SOCK_BUFSIZE_SET was only set by nl_socket_set_buffer_size().
Note that you can only call nl_socket_set_buffer_size() on a socket that
is already connected via nl_connect().
On first call, nl_connect() would always see NL_SOCK_BUFSIZE_SET unset, and
call nl_socket_set_buffer_size().
Since the flag was never unset, when trying to connect a socket a second
time, we would not set the buffer size again. Which was a bug.
Signed-off-by: Thomas Haller <thaller@redhat.com>
#include <linux/tc_act/tc_mirred.h>
#include <linux/tc_act/tc_skbedit.h>
-#define NL_SOCK_BUFSIZE_SET (1<<0)
#define NL_SOCK_PASSCRED (1<<1)
#define NL_OWN_PORT (1<<2)
#define NL_MSG_PEEK (1<<3)
goto errout;
}
- if (!(sk->s_flags & NL_SOCK_BUFSIZE_SET)) {
- err = nl_socket_set_buffer_size(sk, 0, 0);
- if (err < 0)
- goto errout;
- }
+ err = nl_socket_set_buffer_size(sk, 0, 0);
+ if (err < 0)
+ goto errout;
if (_nl_socket_is_local_port_unspecified (sk)) {
uint32_t port;
return -nl_syserr2nlerr(errno);
}
- sk->s_flags |= NL_SOCK_BUFSIZE_SET;
-
return 0;
}