Re: If source address specified on mount, it should force destination address to be same type (IPv4 vs IPv6)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 17, 2025 at 3:08 PM Tom Talpey <tom@xxxxxxxxxx> wrote:
>
> On 2/17/2025 1:27 PM, Steve French wrote:
> > Noticed this old bug today when cleaning up emails.
> >
> > When the user specifies a srcaddr on mount, the DNS resolution of the
> > host name should only look for the same type of address (ie IPv4 if
> > srcaddr is IPv4, IPv6 if IPv6) right?
> >
> > Any thoughts on how this was handled in other protocols?
>
> What is this "srcaddr" witchcraft that thou dost utter? :)

The original patch which added it was this, and apparently is needed in some
cases where the subnet the request comes from is restricted:

commit 3eb9a8893a76cf1cda3b41c3212eb2cfe83eae0e
Author: Ben Greear <greearb@xxxxxxxxxxxxxxx>
Date:   Wed Sep 1 17:06:02 2010 -0700

    cifs: Allow binding to local IP address.

    When using multi-homed machines, it's nice to be able to specify
    the local IP to use for outbound connections.  This patch gives
    cifs the ability to bind to a particular IP address.

       Usage:  mount -t cifs -o srcaddr=192.168.1.50,user=foo, ...
       Usage:  mount -t cifs -o srcaddr=2002::100:1,user=foo, ...

    Acked-by: Jeff Layton <jlayton@xxxxxxxxxx>
    Acked-by: Dr. David Holder <david.holder@xxxxxxxxxxx>
    Signed-off-by: Ben Greear <greearb@xxxxxxxxxxxxxxx>


> There isn't such an option in mount.nfs that I'm aware of.
> And, it isn't documented in mount.cifs either.

NFS man page does show "clientaddr=" mount option,
and it is necessary apparently in some cases (e.g.
https://forum.proxmox.com/threads/nfs-mounts-using-wrong-source-ip-interface.70754/)


> It seems like a hack on top of a hack to match the DNS result
> to the type of the specified srcaddr. If the server supports
> both IP versions and the DNS record exposes them, won't the
> same issue occur on "normal" mounts?
>
> I would not see this playing nicely with multichannel, btw.
> Or RDMA. Probably other scenarios.
>
> Tom.
>
>
> >
> > https://bugzilla.kernel.org/show_bug.cgi?id=218523

-- 
Thanks,

Steve





[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux