Jean-Rene Cormier wrote:
For some reason the PPP connection doesn't seem to be working, it seems
like the server can't receive any data from the WinXP client or vice
versa. Anybody has an idea what could be causing this?

In l2tpd.c, the function start_pppd opens some file descriptors without setting them to non-blocking. The following is an edited extract from a diff between 0.69 and our own in-house version, perhaps this will help you:


@@ -309,28 +322,40 @@
     else
     {
 #endif
         if ((c->fd = getPtyMaster (&a, &b)) < 0)
         {
             log (LOG_WARN, "%s: unable to allocate pty, abandoning!\n",
                  __FUNCTION__);
             return -EINVAL;
         }
+        /* Set FD to non-block */
+        if( fcntl( c->fd, F_SETFL, O_NONBLOCK ) < 0 )
+        {
+            log (LOG_WARN, "%s: unable to set O_NONBLOCK" );
+        }

/* set fd opened above to not echo so we don't see read our own packets
back of the file descriptor that we just wrote them to */
tcgetattr (c->fd, &ptyconf);
*(c->oldptyconf) = ptyconf;
- ptyconf.c_cflag &= ~(ICANON | ECHO);
+ cfmakeraw( &ptyconf);
tcsetattr (c->fd, TCSANOW, &ptyconf);


-        snprintf (tty, sizeof (tty), "/dev/tty%c%c", a, b);
         fd2 = open (tty, O_RDWR);
+        if (fd2 == -1)
+        {
+            log (LOG_WARN, "%s: unable to open slave tty %s\n",
+                        __FUNCTION__, tty);
+            close (c->fd);
+            return -EINVAL;
+        }



HTH
Alex




Reply via email to