diff options
author | Thomas Haller <thaller@redhat.com> | 2016-11-30 14:09:41 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-11-30 14:40:26 (GMT) |
commit | 55ea6e6b6cd805f441b410971c9dd7575e783ef4 (patch) | |
tree | 674fa1461f678f54aa8750c72ffcaaf69945f559 /lib/utils.c | |
parent | 6f9620721200d171d6a317573b3c1c00141f036b (diff) | |
download | libnl-55ea6e6b6cd805f441b410971c9dd7575e783ef4.zip libnl-55ea6e6b6cd805f441b410971c9dd7575e783ef4.tar.gz libnl-55ea6e6b6cd805f441b410971c9dd7575e783ef4.tar.bz2 |
lib: use MSG_PEEK by default for nl_recvmsgs()
The MSG_PEEK API of recvmsg() should be avoid because it requires an additional
syscall. But worse is to choose a too small buffer size and failing to receive
the message.
A user who is aware of the issue can avoid MSG_PEEK by either
nl_socket_disable_msg_peek()/nl_socket_enable_msg_peek() or by setting
a buffer size via nl_socket_set_msg_buf_size().
By default however we now use MSG_PEEK. This is more important since commit
90c6ebec9bd7a where the link dump request can be rather large.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib/utils.c')
-rw-r--r-- | lib/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils.c b/lib/utils.c index 0427322..77cb4b1 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -1192,7 +1192,7 @@ int nl_has_capability (int capability) NL_CAPABILITY_NL_ADDR_FILL_SOCKADDR, NL_CAPABILITY_XFRM_SEC_CTX_LEN, NL_CAPABILITY_LINK_BUILD_ADD_REQUEST_SET_CHANGE, - 0), + NL_CAPABILITY_NL_RECVMSGS_PEEK_BY_DEFAULT), /* IMPORTANT: these capability numbers are intended to be universal and stable * for libnl3. Don't allocate new numbers on your own that differ from upstream * libnl3. |