[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pppoe borken?



Hello!

On Sat, Feb 15, 2003 at 11:33:59AM +0100, Adrian 'Dagurashibanipal' von Bidder wrote:
> Yo!
> 
> Is pppoe broken in testing or is it just my adsl provider having strange
> problems? From time to time, the pppoe connection breaks down, with
> pppoe apparently running wild (like dozens of pppoe processes appearing
> and disappearing fast and apparently in parallel). Syslog excerpt below.

You are using "pty" option in ppp.conf, aren't you?
This is not pppoe problem but pppd or kernel one, I'm not sure.
I have the following patch to work around this, it's against pppd 
from Woody, not pretty but works for me.

--- _orig_ppp-2.4.1.uus/pppd/sys-linux.c	Sun Jan  5 15:19:31 2003
+++ ppp-2.4.1.uus/pppd/sys-linux.c	Sun Jan  5 15:33:26 2003
@@ -532,7 +532,30 @@
 	close(ppp_fd);
 	ppp_fd = -1;
 	if (!looped && ifunit >= 0 && ioctl(ppp_dev_fd, PPPIOCDETACH) < 0)
+	{
+	    int new_fd;
+	    int flags;
+
 	    error("Couldn't release PPP unit: %m");
+	    if (close(ppp_dev_fd))
+		warn("Closing /dev/ppp: %m");
+	    
+	    new_fd = open("/dev/ppp", O_RDWR);
+	    if (new_fd < 0)
+		fatal("Could not reopen /dev/ppp: %m");
+	    if (new_fd != ppp_dev_fd) {
+		if (ppp_dev_fd != dup2(new_fd, ppp_dev_fd)) 
+		    fatal("Could not duplicate /dev/ppp: %m");
+		close(new_fd);
+	    }
+	    flags = fcntl(ppp_dev_fd, F_GETFL);
+	    if (flags == -1
+		|| fcntl(ppp_dev_fd, F_SETFL, flags | O_NONBLOCK) == -1)
+		warn("Couldn't set /dev/ppp to nonblock: %m");
+	    warn("Success reopening /dev/ppp: %d -> %d",
+		    new_fd, ppp_dev_fd);
+	}
+	    
 	if (!multilink)
 	    remove_fd(ppp_dev_fd);
     }
> 
> Sometimes, the connection is reestablished again after some time,
> sometimes it is not and a reboot helps.
> 
> Anybody?
> 
> thanks
> -- vbi
> 
> [syslog]
[log messahes snipped]


:wq
                                        With best regards, 
                                           Vladimir Savkin. 



Reply to: