• Bug#265674: ListenOnTCPPort: Address family not supported by protocol

    From Georg Hoermann@1:229/2 to All on Sat Aug 14 14:10:09 2004
    From: [email protected]

    Package: vncserver
    Version: 3.3.7-3
    Severity: grave
    Justification: renders package unusable


    Hello,

    since the upgrade this morning, vncserver refuses to work.



    14/08/04 12:53:45 Xvnc version 3.3.7 - built Aug 13 2004 10:23:57
    14/08/04 12:53:45 Copyright (C) 2002-2003 RealVNC Ltd.
    14/08/04 12:53:45 Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
    14/08/04 12:53:45 All Rights Reserved.
    14/08/04 12:53:45 See http://www.realvnc.com for information on VNC
    14/08/04 12:53:45 Desktop name 'X' (voltaire:1)
    14/08/04 12:53:45 Protocol version supported 3.3
    14/08/04 12:53:45 Listening for VNC connections on TCP port 5901
    14/08/04 12:53:45 ListenOnTCPPort: Address family not supported by
    protocol


    -- System Information:
    Debian Release: 3.1
    APT prefers unstable
    APT policy: (990, 'unstable'), (500, 'testing')
    Architecture: i386 (i686)
    Kernel: Linux 2.4.26
    Locale: LANG=C, LC_CTYPE=C (ignored: LC_ALL set to de_DE@euro)

    Versions of packages vncserver depends on:
    ii dpkg 1.10.23 Package maintenance system for Deb ii libc6 2.3.2.ds1-16 GNU C Library: Shared libraries an ii libgcc1 1:3.4.1-5 GCC support library
    ii libice6 4.3.0.dfsg.1-6 Inter-Client Exchange library
    ii libsm6 4.3.0.dfsg.1-6 X Window System Session Management ii libstdc++5 1:3.3.4-7 The GNU Standard C++ Library v3
    ii libx11-6 4.3.0.dfsg.1-6 X Window System protocol client li ii libxext6 4.3.0.dfsg.1-6 X Window System miscellaneous exte ii perl 5.8.4-2 Larry Wall's Practical Extraction ii vnc-common 3.3.7-3 Virtual network computing server s ii xbase-clients 4.3.0.dfsg.1-6 miscellaneous X clients
    ii xlibs 4.3.0.dfsg.1-6 X Window System client libraries m ii xserver-common 4.3.0.dfsg.1-6 files and utilities common to all ii zlib1g 1:1.2.1.1-5 compression library - runtime

    -- no debconf information


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From J.H.M. Dassen (Ray)@1:229/2 to Georg Hoermann on Sat Aug 14 18:10:12 2004
    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)
  • From Ola Lundqvist@1:229/2 to All on Sat Aug 14 19:30:10 2004
    From: [email protected]

    Hello

    Thanks for the patch.

    I'll upload a new version with it applied. If it do not work as expected I'll revert
    back to the original state.

    Regards,

    // Ola

    On Sat, Aug 14, 2004 at 05:56:19PM +0200, J.H.M. Dassen (Ray) wrote:
    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);
    +
    + if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
    + return -1;
    + }
    }
    if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
    (char *)&one, sizeof(one)) < 0) {


    --
    --------------------- Ola Lundqvist ---------------------------
    / [email protected] Annebergsslingan 37 \
    | [email protected] 654 65 KARLSTAD |
    | +46 (0)54-10 14 30 +46 (0)70-332 1551 |
    | http://www.opal.dhs.org UIN/icq: 4912500 |
    \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 /
    ---------------------------------------------------------------


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)