X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fauth.c;h=fb719446f7489895f0b51081c99b99c8221fd210;hb=406215672cfadc03017341fe03802d1c7294b903;hp=22941af2249e2e829097f751feb9885450825a63;hpb=b5edacdfeec0ff65e9a365324992214f056f46d0;p=ppp.git diff --git a/pppd/auth.c b/pppd/auth.c index 22941af..fb71944 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -68,7 +68,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: auth.c,v 1.115 2008/06/15 06:56:12 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.117 2008/07/01 12:27:56 paulus Exp $" #include #include @@ -557,6 +557,7 @@ void start_link(unit) new_phase(PHASE_SERIALCONN); + hungup = 0; devfd = the_channel->connect(); msg = "Connect script failed"; if (devfd < 0) @@ -1140,7 +1141,6 @@ static void check_maxoctets(arg) void *arg; { - int diff; unsigned int used; update_link_stats(ifunit); @@ -1161,8 +1161,7 @@ check_maxoctets(arg) used = link_stats.bytes_in+link_stats.bytes_out; break; } - diff = maxoctets - used; - if(diff < 0) { + if (used > maxoctets) { notice("Traffic limit reached. Limit: %u Used: %u", maxoctets, used); status = EXIT_TRAFFIC_LIMIT; lcp_close(0, "Traffic limit");