[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (web server) serving on both ipv6 and ipv4?
From: |
Chris Vine |
Subject: |
Re: (web server) serving on both ipv6 and ipv4? |
Date: |
Wed, 19 Jan 2022 13:44:13 +0000 |
On Wed, 19 Jan 2022 13:07:33 +0000
Chris Vine <vine35792468@gmail.com> wrote:
[snip]
> As I understand it, with linux IPv6 sockets are dual stack capable, and
> in earlier kernel versions this was be enabled by default. I believe
> with current versions that is no longer the case, and that you have to
> specifically enable dual stack by turning off IPV6_V6ONLY using
> setsockopt before binding on the socket.
>
> Then, if receiving a IPv4 connection from address 1.2.3.4, this would be
> mapped as ::::ffff:1.2.3.4.
>
> I do not know about other OSes. I have half a memory that some earlier
> versions of windows did not support dual stack sockets (XP?).
By the way I did use dual stack some years ago, and I cannot now
remember all the details, but I think I may have had to bind on
in6addr_any (which in dual stack would cover INADDR_ANY) or on ::
(which would cover 127.0.0.1) to get dual stack to work. I suggest you
play around with it to see.
One other correction: when I said there was a mapping to ::::ffff:
1.2.3.4 I meant ::ffff:1.2.3.4.