oNaiPs / droidVncServer

VNC server for Android devices.
GNU General Public License v3.0
910 stars 480 forks source link

IPv6 issue with the vncserver on 2.3.x #38

Open sadin999 opened 12 years ago

sadin999 commented 12 years ago

Small issue with the listen socket either on 2.3.x or in general (don't have 4.x to test on). Basically, the wrong socket gets set in libvncserver/sockets.c. Otherwise socket never properly opens and when manually started with adb shell, it spits out:

rfbCheckFds: accept: Bad file number

Diff here to fix: (basically just comment out the IPv6 socket set)

diff --git a/jni/vnc/LibVNCServer-0.9.9/libvncserver/sockets.c b/jni/vnc/LibVNCServer-0.9.9/libvncserver/sockets.c
index 84c9c98..11f3166 100644
--- a/jni/vnc/LibVNCServer-0.9.9/libvncserver/sockets.c
+++ b/jni/vnc/LibVNCServer-0.9.9/libvncserver/sockets.c
@@ -404,9 +404,9 @@ rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen)
     }
     if (FD_ISSET(rfbScreen->listenSock, &listen_fds)) 
       chosen_listen_sock = rfbScreen->listenSock;
-    if (FD_ISSET(rfbScreen->listen6Sock, &listen_fds)) 
+    /* if (FD_ISSET(rfbScreen->listen6Sock, &listen_fds)) 
       chosen_listen_sock = rfbScreen->listen6Sock;
-
+    */
     if ((sock = accept(chosen_listen_sock,
                       (struct sockaddr *)&addr, &addrlen)) < 0) {
       rfbLogPerror("rfbCheckFds: accept");
swt2c commented 11 years ago

Fixed upstream: http://libvncserver.git.sourceforge.net/git/gitweb.cgi?p=libvncserver/libvncserver;a=commit;h=66282f58000c8863e104666c30cb67b1d5cbdee3