VNC on amd64: SIOCGIFCONF problems
Brooks Davis
brooks at one-eyed-alien.net
Tue Mar 1 01:41:39 GMT 2005
On Sun, Feb 27, 2005 at 09:13:20PM -0800, David C. Myers wrote:
>
>
> VNC-3.3.7 in ports looks like it doesn't work because of 64-bit
> alignment issues with SIOCGIFCONF. The offending code is in
> Xvnc/programs/Xserver/os/access.c:
>
> if (ifioctl (fd, (int) SIOCGIFCONF, (pointer) &ifc) < 0)
> Error ("Getting interface configuration (4)");
>
> which comes out in the trace file as:
>
> 28138 Xvnc CALL bind(0x1,0x7fffffffe670,0x13)
> 28138 Xvnc NAMI "/tmp/.X11-unix/X1"
> 28138 Xvnc RET bind 0
> 28138 Xvnc CALL listen(0x1,0x80)
> 28138 Xvnc RET listen 0
> 28138 Xvnc CALL umask(0x12)
> 28138 Xvnc RET umask 0
> 28138 Xvnc CALL ioctl(0,0xffffffffc0106924 ,0x7fffffffe030)
> 28138 Xvnc RET ioctl -1 errno 6 Device not configured
> 28138 Xvnc CALL writev(0x2,0x7fffffffd790,0x4)
> 28138 Xvnc GIO fd 2 wrote 59 bytes
> "Getting interface configuration (4): Device not configured
> "
>
>
> (Actually, the very first error you'll get is a "Could not open default
> font 'fixed'" message, but you can make that go away by running a font
> server and passing its address to Xvnc...)
>
> Is there a quick solution to this? A 32-bit compatibility shim?
> Judging from Google, issues with this ioctl go back years, on all kinds
> of platforms. getifaddrs() is the right way to do this on BSD?
You need to copy the misaligned element(s) into properly aligned temporary
storage or use getifaddrs instead. SIOCGIFCONF is a really crappy
inteface.
-- Brooks
--
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-amd64/attachments/20050228/27e4465c/attachment.bin
More information about the freebsd-amd64
mailing list