X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/fc0a36320874bea43b9fd73df0e0990bfd3b59cd..3bfd1c4e87cbe74f5c2ad81ef7a4944ce41cb311:/garden.c diff --git a/garden.c b/garden.c index 1083b65..c3ce34a 100644 --- a/garden.c +++ b/garden.c @@ -34,19 +34,19 @@ int plugin_post_auth(struct param_post_auth *data) p.log(3, 0, 0, 0, "Walled Garden allowing login\n"); data->auth_allowed = 1; - data->s->garden = 1; + data->s->walled_garden = 1; return PLUGIN_RET_OK; } int plugin_new_session(struct param_new_session *data) { - if (data->s->garden) garden_session(data->s, 1); + if (data->s->walled_garden) garden_session(data->s, 1); return PLUGIN_RET_OK; } int plugin_kill_session(struct param_new_session *data) { - if (data->s->garden) garden_session(data->s, 0); + if (data->s->walled_garden) garden_session(data->s, 0); return PLUGIN_RET_OK; } @@ -68,7 +68,7 @@ int plugin_control(struct param_control *data) sprintf((data->response + data->response_length), "%s", errormsg); data->response_length += strlen(errormsg) + 1; - p.log(3, 0, 0, 0, "Unknown session %s\n", session); + p.log(3, 0, 0, 0, "Unknown session %d\n", session); return PLUGIN_RET_STOP; } *(short *)(data->response + 2) = ntohs(PKT_RESP_OK); @@ -119,7 +119,7 @@ int garden_session(sessiont *s, int flag) snprintf(cmd, 2048, "iptables -t nat -A garden_users -s %s -j garden", p.inet_toa(ntohl(s->ip))); p.log(3, 0, 0, s->tunnel, "%s\n", cmd); system(cmd); - s->garden = 1; + s->walled_garden = 1; } else { @@ -145,15 +145,15 @@ int garden_session(sessiont *s, int flag) if (WEXITSTATUS(status) != 0) break; } - s->garden = 0; + s->walled_garden = 0; if (!s->die) { /* OK, we're up! */ - u8 r = p.radiusnew(p.get_id_by_session(s)); + u16 r = p.radiusnew(p.get_id_by_session(s)); p.radiussend(r, RADIUSSTART); } } - s->garden = flag; + s->walled_garden = flag; return 1; }