From: fred_nerk Date: Tue, 5 Oct 2004 02:50:03 +0000 (+0000) Subject: Don't continue creating session if no IP addresses are free X-Git-Tag: release_2_0_3~26 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/f6f9bebeaa11fad58aedcde9a4e382f98b7ba08d Don't continue creating session if no IP addresses are free --- diff --git a/l2tpns.c b/l2tpns.c index 2b31b81..3c0108d 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -4,7 +4,7 @@ // Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced // vim: sw=8 ts=8 -char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.29 2004/09/23 03:59:09 fred_nerk Exp $"; +char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.30 2004/10/05 02:50:03 fred_nerk Exp $"; #include #include @@ -3526,7 +3526,6 @@ int sessionsetup(tunnelidt t, sessionidt s) CSTAT(call_sessionsetup); - log(3, session[s].ip, s, t, "Doing session setup for session\n"); if (!session[s].ip || session[s].ip == 0xFFFFFFFE) @@ -3536,7 +3535,11 @@ int sessionsetup(tunnelidt t, sessionidt s) log(3, 0, s, t, " No IP allocated. Assigned %s from pool\n", inet_toa(htonl(session[s].ip))); else + { log(0, 0, s, t, " No IP allocated. The IP address pool is FULL!\n"); + sessionshutdown(s, "No IP addresses available"); + return 0; + } }