linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Courtier-Dutton <james.dutton@gmail.com>
To: LKML Mailing List <linux-kernel@vger.kernel.org>
Subject: SO_REUSEADDR compatibility problems
Date: Fri, 4 Dec 2020 00:15:29 +0000	[thread overview]
Message-ID: <CAAMvbhFFkFstAH9xm2_KA8vYzW7cu9=V4YXTwioaDhb-mR_Dig@mail.gmail.com> (raw)

Hi,

The use case I am struggling with is the use of a Windows program
running in wine that is sending and receiving UDP packets.
This particular windows program uses SO_REUSEADDR socket option and
opens two sockets. Lets call the first one socket A, and the second
one Socket B.

The SO_REUSEADDR from the Windows application is translated by "wine" into a
SO_REUSEADDR in Linux.
Unfortunately the behaviour of these is different between Windows and
Linux so the Windows application fails to run on Linux under wine.
1 ) On windows:
All received unicast UDP packets will arrive on the first opened
socket. Thus on socket A.
2) On Linux:
All received unicast UDP packets will arrive on the last opened
socket. Thus on socket B.

The problem is that this windows program only expects to receive
unicast UDP packets on socket A, and thus it sees no packets.

There are no currently existing socket options in Linux that would
permit wine to simulate the Windows behaviour.
And thus, the reason I am asking the question here.
Please can we add an extra socket option to the Linux socket options
such that we can get wine to simulate Windows correctly. I.e. behave
like (1) above.
Now wine is pretty good at simulating most things Windows throws at
it, but socket options is not one of them yet.
Also note, that (1) is actually more secure than (2) because it
prevents other applications with the same UserID from hijacking the
socket.
Although (2) is more helpful in more gracefully handling some error edge cases.

Suggested new option name:  SO_REUSEADDR_WS

Kind Regards

James

                 reply	other threads:[~2020-12-04  0:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAMvbhFFkFstAH9xm2_KA8vYzW7cu9=V4YXTwioaDhb-mR_Dig@mail.gmail.com' \
    --to=james.dutton@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).