public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: netdev@vger.kernel.org
Subject: Fw: [Bug 210255] New: IP_UNICAST_IF has no effect on connect()ed UDP sockets
Date: Wed, 18 Nov 2020 07:46:11 -0800	[thread overview]
Message-ID: <20201118074611.0df443d6@hermes.local> (raw)



Begin forwarded message:

Date: Wed, 18 Nov 2020 15:06:51 +0000
From: bugzilla-daemon@bugzilla.kernel.org
To: stephen@networkplumber.org
Subject: [Bug 210255] New: IP_UNICAST_IF has no effect on connect()ed UDP sockets


https://bugzilla.kernel.org/show_bug.cgi?id=210255

            Bug ID: 210255
           Summary: IP_UNICAST_IF has no effect on connect()ed UDP sockets
           Product: Networking
           Version: 2.5
    Kernel Version: 5.9.0-36.fc34.x86_64
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: IPV4
          Assignee: stephen@networkplumber.org
          Reporter: mzxreary@0pointer.de
        Regression: No

The IP_UNICAST_IF sockopt has an effect for unconnected UDP sockets, and is
used as key for the route lookup. However, when using connect() on an UDP
socket, then the routing decision is already done at connect() time, and unlike
the routing decision for unconnected sockets the IP_UNICAST_IF sockopt is not
taken into consideration then.

I figure this was simply forgotten when IP_UNICAST_IF was added, but I am
pretty sure this should be corrected so that connected and unconnected UDP
sockets behave more alike.

(SO_BINDTODEVICE/SO_BINDTOINDEX actually works on both equally, but given they
do a lot more than IP_UNICAST_IF they are no replacement)

(This was noticed in context of the UDP/DNS code in systemd-resolved, see this
for further discussion:
https://github.com/systemd/systemd/issues/11935#issuecomment-618691018)

(The research on this was done by hvenev, not me, I am just propagating his
findings here.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

                 reply	other threads:[~2020-11-18 15:46 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=20201118074611.0df443d6@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=netdev@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