From: Martin Schiller Date: Thu, 7 Dec 2017 07:55:53 +0000 (+0100) Subject: pppoe-discovery: use correct exit code depending on PADO replies. X-Git-Tag: ppp-2.4.8~31^2~2 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=bb65ff8830596e22d5f6c4c66274ddd726545c85;p=ppp.git pppoe-discovery: use correct exit code depending on PADO replies. This makes it possible to evaluate the exit code of the tool, e.g. if you just want to know if there is an access concentrator or not. Signed-off-by: Martin Schiller --- diff --git a/pppd/plugins/rp-pppoe/pppoe-discovery.c b/pppd/plugins/rp-pppoe/pppoe-discovery.c index 3c19dfa..784bd71 100644 --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c @@ -698,7 +698,11 @@ int main(int argc, char *argv[]) conn->printACNames = 1; discovery(conn); - exit(0); + + if (!conn->numPADOs) + exit(1); + else + exit(0); } void rp_fatal(char const *str)