[exim-dev] Re: Exim-dev Digest, Vol 241, Issue 4

Top Page
Delete this message
Reply to this message
Author: Martin D Kealey
Date:  
To: exim-dev
Subject: [exim-dev] Re: Exim-dev Digest, Vol 241, Issue 4
On Wed, 11 Sep 2024 10:56:40 +0000 , <exim-cc0@???
<exim-cc0@???>>> wrote:

> --- Comment #27 from Dave <exim-cc0@???> ---
> (In reply to Jeremy Harris from comment #26)
> > It's been long enough that I've forgotten the issue details... but I
> suspect
> > you are assuming that by asking for a specific IP in an smtp transport
> > "interface" option, that IP will be used. Wrong. The IP is only used to
> > select the interface. If there's only one interface that happens to have
> > several IPs, that interface is still the interface that it used. Which
> IP
> > gets used for packets is up to the OS.
> >
> > That's why the option is "interface" and not "IPADDRESS" (or similar).
> The
> > documentation says:
> >   "This option specifies which interface to bind to when
> >    making an outgoing SMTP call."
> > It does not say "This option sets the local IP address to use when
> [...]".

>
> This doesn't sound right. Internally exim passes the string for and binds
> to an
> IP address, not an interface name. "Physical interface" is quite arbitrary
> in
> this regard, the interfaces in use do not share the same name, and the same
> behaviour would be exhibited regardless of whether the interface were
> physical
> or not.



This is both right and wrong.

Yes a socket can be bound to a source IP address before initiating an
outbound connection.

No, the interface names are not different, at least under Linux. "Virtual
interfaces" do not exist as entities in the kernel, they exist purely as
textual strings that are presented when you query the addresses on an
actual interface.

If you do *not* bind an address to a socket before attempting an outgoing
TCP connection, the kernel will first test the routing to get a tentative
interface entity, and from that interface get its primary address; at that
point those textual strings are completely ignored.

In Linux the "ifconfig" commander lies to you, faking the "virtual
interfaces"; if you want to see the real state of affairs, use the "ip
address show" command instead.

-Martin

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-dev.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-dev-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/