Bug 1250921 - Packet sending fails on short write in sendmsg()
Packet sending fails on short write in sendmsg()
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: bind (Show other bugs)
7.2
Unspecified Unspecified
low Severity medium
: rc
: ---
Assigned To: Petr Menšík
qe-baseos-daemons
:
: 1250923 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-06 06:07 EDT by Andreas Schneider
Modified: 2017-05-29 08:33 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-05-29 08:33:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Andreas Schneider 2015-08-06 06:07:55 EDT
Description of problem:

I've tried to get nsupdate working in our Samba test environment. We use a tool called socket_wrapper [1] to build an isolated network. socket_wrapper is a library passing all socket communications through unix sockets.

socket_wrapper limits the max packet size to 1500 bytes to make it easier to write pcap files.

The function doio_send() uses sendmsg() to send the packet over the wire. nsupdate sends the tsig over a TCP connection. The packet size is 1505 bytes. socket_wrapper limits the packet size to 1500 and sends 1500 bytes, which is the return value. doio_send() detects it (see gdb output below) sets a soft error.

doio_send (sock=sock@entry=0x7ffff7f764b0, dev=0x7ffff7ed0678) at socket.c:1866
1866            if (cc < 0) {
(gdb)
1860            cc = sendmsg(sock->fd, &msghdr, 0);
(gdb) p msghdr
$6 = {msg_name = 0x0, msg_namelen = 0, msg_iov = 0x7ffff303ab70, msg_iovlen = 1, msg_control = 0x0, msg_controllen = 0, msg_flags = 0}
(gdb) n
1861            send_errno = errno;
(gdb) n
1866            if (cc < 0) {
(gdb) p cc
$7 = 1500
(gdb) n
1927            if (cc == 0) {
(gdb) n
1939            dev->n += cc;
(gdb) n
1940            if ((size_t)cc != write_count)
(gdb) p write_count
$8 = 1505


doio_send() should call sendmsg() again and just send the remaining bytes!



[1] https://cwrap.org/socket_wrapper.html
Comment 2 Tomáš Hozza 2015-12-07 07:55:23 EST
*** Bug 1250923 has been marked as a duplicate of this bug. ***
Comment 3 Martin Sehnoutka 2016-04-21 10:35:29 EDT
Please add steps to reproduce, so I can debug this problem.
Comment 5 Andreas Schneider 2017-05-29 08:33:53 EDT
We will stop using nsupdate in future.

Note You need to log in before you can comment on or make changes to this bug.