diff options
author | Thomas Haller <thaller@redhat.com> | 2015-03-05 08:46:31 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-03-05 11:25:20 +0100 |
commit | 15824e42730980132a9e52d0c9d6929808e5ae78 (patch) | |
tree | 5c632a65922bfbdd2a6cc216fa91c4263c2e5f7e /lib/nl.c | |
parent | 364ab3daf6d00dfa8e0dd81046f741e70cac5da9 (diff) | |
download | libnl-15824e42730980132a9e52d0c9d6929808e5ae78.tar.gz |
lib/socket: remove NL_SOCK_BUFSIZE_SET socket flag
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>
Diffstat (limited to 'lib/nl.c')
-rw-r--r-- | lib/nl.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -116,11 +116,9 @@ int nl_connect(struct nl_sock *sk, int protocol) 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; |