From add0eafae973567f6aa43156a64bd2533b47df93 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Wed, 25 Jun 2008 10:30:36 +0000 Subject: [PATCH] Fix behaviour of maxoctets option when limit >= 2G Patch from Serhij Stasyuk with a minor modification by me. --- pppd/auth.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pppd/auth.c b/pppd/auth.c index 22941af..f615fd3 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.116 2008/06/25 10:30:36 paulus Exp $" #include #include @@ -1140,7 +1140,6 @@ static void check_maxoctets(arg) void *arg; { - int diff; unsigned int used; update_link_stats(ifunit); @@ -1161,8 +1160,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"); -- 2.39.2