delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/06/20/09:18:42

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:in-reply-to
:references:mime-version:content-type; q=dns; s=default; b=G5nZ0
FeRhnPEFIiU/yltfv/Te4PCQ1X1hX09x8TSHZByNj5L0v9+mn7MfSCQVVWDpuWLH
7MZFunEW4PHY/wWIGd3m05g3zT6V3LnZH+WeE5eNPU3xrwroli4O5x+otkIezmRO
Dbc04TZ0BRspHdUMmvzs8+gjK2cbZH3vELSgds=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:in-reply-to
:references:mime-version:content-type; s=default; bh=1Fy/5IP+Z2I
/mn9ko8gxqYbtI4s=; b=vW01on7OwPMshTMN9hDsoR6XCDBftVLmUbDizBZubus
6Z2KVQ9IJzHdTsABAREJoxxyJAWg6PRmdY2r5gFp8NXOB6c6/wjiPnzg6tnCTm5Z
VXGZrMqds2/0ZdeN4slkcN2a++Vad6aTBajB6qV9bW6poHmXevcLbfhr7RnizJFQ
=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=arrived, H*c:HHHH
X-HELO: conssluserg-04.nifty.com
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com w5KDI2Go006442
X-Nifty-SrcIP: [125.3.30.127]
Date: Wed, 20 Jun 2018 22:18:12 +0900
From: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
To: cygwin AT cygwin DOT com
Subject: Re: Problems of AF_INET domain socket regarding out-of-band data.
Message-Id: <20180620221812.2e10f95ef5501758493560a2@nifty.ne.jp>
In-Reply-To: <20180613224858.7822b08abb75d76b72920095@nifty.ne.jp>
References: <20180613224858 DOT 7822b08abb75d76b72920095 AT nifty DOT ne DOT jp>
Mime-Version: 1.0
X-IsSubscribed: yes

--Multipart=_Wed__20_Jun_2018_22_18_12_+0900_HL0SDKd8lT_6kdVv
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi Corinna,

On Wed, 13 Jun 2018 22:48:58 +0900
Takashi Yano wrote:
> 1. recv() with MSG_OOB flag eats normal data if no OOB data
>   is sent yet.
> 
> 2. Calling recv() with MSG_OOB flag is blocked if no OOB data
>   is sent yet.
> 
> 3. Calling recv() without MSG_OOB flag after receiving OOB data
>   is blocked even if received data exist in buffer. 

I looked into these problems and found these are due to bug of
cygwin1.dll.

Problem 1:
If recv() is called with MSG_OOB, in fhandler_socket_inet::
recv_internal(), wsamsg->dwFlags with MSG_OOB flag set is passed
to WSARecv() and this fails because no OOB data exists. At this time,
wsamsg-> dwFlags is modified by WSARecv() so that it does not have
the MSG_OOB flag. Then, WSARecv() is called again without MSG_OOB
flag in while loop. At this time, normal data is read and returned.

Problem 2:
In fhandler_socket_inet::recv_internal(), wait_for_events() is
called. This blocks the call until OOB data arrives.

Problem 3:
If recv() is called with MSG_OOB flag set, fhandler_socket_inet::
recv_internal() calls wait_for_events() with both FD_OOB and
FD_READ. If both OOB data and normal data already arrived,
not only the event of FD_OOB but also the event of FD_READ are
reset to non signaled state. I'm not sure where the signal is
reset, though.

Moreover, return value of ioctl command SIOCATMARK of winsock
is not as expected. In winsock, SIOCATMARK returns TRUE if no
OOB data exists, FALSE otherwise. This is almost opposite to
expectation.

Furthermore, inline mode (SO_OOBINLINE) of winsock is completely
broken. If SO_OOBINLINE is set, SIOATMARK always returns TRUE.
This means application cannot determine OOB data at all in inline
mode.

To solve these problems, I made a patch attached.

Could you please have a look?

-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>

--Multipart=_Wed__20_Jun_2018_22_18_12_+0900_HL0SDKd8lT_6kdVv
Content-Type: application/octet-stream;
 name="0001-Fix-the-handling-of-out-band-data-OOB-in-a-socket.patch"
Content-Disposition: attachment;
 filename="0001-Fix-the-handling-of-out-band-data-OOB-in-a-socket.patch"
Content-Transfer-Encoding: base64

RnJvbSA2MzQ5N2FkMWQ1MDg5YmViMjFhNjNjNjJkZTNjNjYyZmFmNDI4ODFm
IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBUYWthc2hpIFlhbm8g
PHRha2FzaGkueWFub0BuaWZ0eS5uZS5qcD4KRGF0ZTogV2VkLCAyMCBKdW4g
MjAxOCAxNDo0NzoyNyArMDkwMApTdWJqZWN0OiBbUEFUQ0hdIEZpeCB0aGUg
aGFuZGxpbmcgb2Ygb3V0LWJhbmQtZGF0YSAoT09CKSBpbiBhIHNvY2tldC4K
CiogZmhhbmRsZXIuaCAoY2xhc3MgZmhhbmRsZXJfc29ja2V0X3dzb2NrKTog
QWRkIHZhcmlhYmxlIGJvb2wgb29iaW5saW5lLgoqIGZoYW5kbGVyX3NvY2tl
dF9pbmV0LmNjIChmaGFuZGxlcl9zb2NrZXRfd3NvY2s6OmZoYW5kbGVyX3Nv
Y2tldF93c29jayk6CiAgQWRkIGluaXNpYWxpemUgb2Ygb29iaW5saW5lLgoo
ZmhhbmRsZXJfc29ja2V0X2luZXQ6OnJlY3ZfaW50ZXJuYWwpOiBNYWtlIHRo
ZSBoYW5kbGluZyBvZiBPT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c3RlYWQgb2YgYWN0dWFsbHkgc2V0
dGluZyBpbmxpbmUgbW9kZSwgc2ltcGx5CisJICAgICBzZXQgdGhlIHZhcmlh
YmxlIG9vYmlubGluZS4gKi8KKwkgIG9vYmlubGluZSA9ICooaW50ICopIG9w
dHZhbCA/IHRydWUgOiBmYWxzZTsKKwkgIHJldHVybiAwOworCiAJZGVmYXVs
dDoKIAkgIC8qIEFGX0xPQ0FMIHNvY2tldHMgc2ltcGx5IGlnbm9yZSBhbGwg
b3RoZXIgU09MX1NPQ0tFVCBvcHRpb25zLiAqLwogCSAgcmV0dXJuIDA7CkBA
IC0xNTM4LDYgKzE2MDgsMTAgQEAgZmhhbmRsZXJfc29ja2V0X2xvY2FsOjpn
ZXRzb2Nrb3B0IChpbnQgbGV2ZWwsIGludCBvcHRuYW1lLCBjb25zdCB2b2lk
ICpvcHR2YWwsCiAJICAgIHJldHVybiAwOwogCSAgfQogCisJY2FzZSBTT19P
T0JJTkxJTkU6CisJICAqKGludCAqKSBvcHR2YWwgPSBvb2JpbmxpbmUgPyAx
IDogMDsKKwkgIHJldHVybiAwOworCiAJZGVmYXVsdDoKIAkgIHsKIAkgICAg
dW5zaWduZWQgaW50ICp2YWwgPSAodW5zaWduZWQgaW50ICopIG9wdHZhbDsK
LS0gCjIuMTcuMAoK


--Multipart=_Wed__20_Jun_2018_22_18_12_+0900_HL0SDKd8lT_6kdVv
Content-Type: text/plain; charset=us-ascii


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
--Multipart=_Wed__20_Jun_2018_22_18_12_+0900_HL0SDKd8lT_6kdVv--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019