diff options
author | Thomas Haller <thaller@redhat.com> | 2015-03-05 07:46:31 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-03-05 10:25:20 (GMT) |
commit | 15824e42730980132a9e52d0c9d6929808e5ae78 (patch) | |
tree | 5c632a65922bfbdd2a6cc216fa91c4263c2e5f7e /lib | |
parent | 364ab3daf6d00dfa8e0dd81046f741e70cac5da9 (diff) | |
download | libnl-15824e42730980132a9e52d0c9d6929808e5ae78.zip libnl-15824e42730980132a9e52d0c9d6929808e5ae78.tar.gz libnl-15824e42730980132a9e52d0c9d6929808e5ae78.tar.bz2 |
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')
-rw-r--r-- | lib/nl.c | 8 | ||||
-rw-r--r-- | lib/socket.c | 2 |
2 files changed, 3 insertions, 7 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; diff --git a/lib/socket.c b/lib/socket.c index 5db7f29..628a96d 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -715,8 +715,6 @@ int nl_socket_set_buffer_size(struct nl_sock *sk, int rxbuf, int txbuf) return -nl_syserr2nlerr(errno); } - sk->s_flags |= NL_SOCK_BUFSIZE_SET; - return 0; } |