pkgsrc-Bugs archive

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

Re: pkg/33926 rp-pppoe/pppoe-server fails



The following reply was made to PR pkg/33926; it has been noted by GNATS.

From: Water NB <netbsd78%126.com@localhost>
To: martin%NetBSD.org@localhost
Cc: gnats-bugs%NetBSD.org@localhost, gnats-admin%NetBSD.org@localhost,
        pkgsc-bugs%NetBSD.org@localhost
Subject: Re: pkg/33926 rp-pppoe/pppoe-server fails
Date: Mon, 30 Oct 2006 22:04:49 +0800

 I traced the problem and now report the result here:
 
 asyncReadFromPPP() is used to read data from pppd,
 but comment in patch gived by martin said that it read from BPF.
 I think I couldn't agree it.
 
 pppoe-server fork pppd, pppd fork pppoe. so data-stream is like below:
 pppd <---> pppoe <---> BPF/ethernet
 
 safe_fork() in src/dist/pppd/pppd/main.c says:
 pppd create a pipe and used to communicates with forked progcess (here
 is pppoe).
 
 because of safe_fork()'s works,
 pppoe read from stdin (fd=0) means read from pppd,
 pppoe write to stdout (fd=1) means write to pppd,
 
 Now I find out a problem, 
 when pppoe call openInterface() to get BPF fd (calling in session() of
 pppoe.c)
 it return 0;
 So, in fact, as like I traced:
 asyncReadFromPPP() alwasy read data from BPF. But it should read from
 pipe of pppd.
 
 I notice that openInterface() return 3 in program pppoe-server.
 Why it return 0 in program pppoe?
 Because pppd close stdin, stdout,stderr before call execl()?
 
 I guess that if openInterface() return >= 3 will resolve the problem.
 Right?
 How?
 
 Thanks.
 
 



Home | Main Index | Thread Index | Old Index