X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/916c13c6039bd189873ee094e9c0ebd010899792..f6b5140de23dd17f9a9c28fcca0fcef58b161a78:/grpsess.c?ds=sidebyside diff --git a/grpsess.c b/grpsess.c index 73c729a..e710709 100644 --- a/grpsess.c +++ b/grpsess.c @@ -129,7 +129,7 @@ static void grp_routeset(groupidt g, in_addr_t ip, int prefixlen, int add) n_ip = htonl(ip); netlink_addattr(&req.nh, RTA_DST, &n_ip, sizeof(n_ip)); - LOG(1, 0, 0, "Route (Group) %s %s/%d\n", add ? "add" : "del", fmtaddr(htonl(ip), 0), prefixlen); + LOG(3, 0, 0, "Route (Group) %s %s/%d\n", add ? "add" : "del", fmtaddr(htonl(ip), 0), prefixlen); if (netlink_send(&req.nh) < 0) LOG(0, 0, 0, "grp_routeset() error in sending netlink message: %s\n", strerror(errno)); @@ -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; @@ -633,7 +639,7 @@ int grp_cluster_load_groupe(groupidt g, groupsesst *new) // Check session list for (i = 0; i < grpsession[g].nbsession; i++) { - if (grpsession[g].sesslist[i].sid == new->sesslist[i].sid) + if (grpsession[g].sesslist[i].sid != new->sesslist[i].sid) { updategroup = 1; break;