Bug 1250923 - Packet sending fails on short write in sendmsg()
Packet sending fails on short write in sendmsg()
Status: CLOSED DUPLICATE of bug 1250921
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: bind (Show other bugs)
7.2
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Tomáš Hozza
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-06 06:09 EDT by Andreas Schneider
Modified: 2015-12-07 07:55 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 07:55:23 EST
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:09:05 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

*** This bug has been marked as a duplicate of bug 1250921 ***

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