From:
[email protected]
On Sat, Aug 14, 2004 at 13:46:47 +0200, Georg Hoermann wrote:
Version: 3.3.7-3
14/08/04 12:53:45 ListenOnTCPPort: Address family not supported by
protocol
The IPv6 patch introduced in 3.3.7-3 is unconditional. It doesn't fall back
to IPv4 if an IPv6 socket cannot be established.
A straightforward fix would be fall back to trying to establish an IPv4
socket if an IPv6 one cannot be established. The attached (untested) patch probably does that.
A saner solution though would be modify Xvnc so that not just the port, but also the address (and thereby address family) on which to bind are configurable.
HTH,
Ray
--
Signs of world domination:
"Tonight on Celebrity Deathmatch: Tux takes on the BSD daemon"
diff -ruN vnc-3.3.7.old/Xvnc/programs/Xserver/hw/vnc/sockets.c vnc-3.3.7/Xvnc/programs/Xserver/hw/vnc/sockets.c
--- vnc-3.3.7.old/Xvnc/programs/Xserver/hw/vnc/sockets.c 2004-08-14 17:45:33.000000000 +0200
+++ vnc-3.3.7/Xvnc/programs/Xserver/hw/vnc/sockets.c 2004-08-14 17:45:15.000000000 +0200
@@ -426,18 +426,21 @@
else
addr.sin6_addr = in6addr_any;
- if ((sock = socket(AF_INET6, SOCK_STREAM, 0)) < 0) {
-#else
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
- if (rfbLocalhostOnly)
- addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- else
- addr.sin_addr.s_addr = htonl(INADDR_ANY);
-
- if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
+ /* Don't fail if an IPv6 socket cannot be established, but fall back to
+ IPv4 */
+ if ((sock = socket(AF_INET6, SOCK_STREAM, 0)) < 0)
#endif
- return -1;
+ {
+ addr.sin_family = AF_INET;
+ addr.sin_port = htons(port);
+ if (rfbLocalhostOnly)
+ addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+ else
+ addr.sin_addr.s_addr = htonl(INADDR_ANY)