From: David Parrish 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: 2.2.1-2fdn3.1~19^2^2~1^2~401 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/020c472e7561205425860e1f46b1c67b52d009e6?hp=340d76dae5734fd64a69f6cee60e4e508d2323c2 Don't continue creating session if no IP addresses are free --- diff --git a/l2tpns.c b/l2tpns.c index a402e57..bce5f38 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; + } }