X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/a0c184ac2133e1f2b70801d9803370a27179fea9..14031c41a5c8e4e2513c6bfd65d5019da7611156:/grpsess.c?ds=sidebyside diff --git a/grpsess.c b/grpsess.c index 7f897b3..e710709 100644 --- a/grpsess.c +++ b/grpsess.c @@ -551,7 +551,13 @@ sessionidt grp_getnextsession(groupidt g, in_addr_t ip) if ((s = sessionbyip(ip))) { - if (s == grpsession[g].smax) + if (g != grp_groupbysession(s)) + { + // This session does not belong to this group + LOG(2, s, session[s].tunnel, "Warning, the session does not belong to group %d\n", g); + s = 0; + } + else if (s == grpsession[g].smax) { s = grpsession[g].smin; grpsession[g].smax = 0;