From ca6455606c14fec4fd825325a1ae0cc8a9c8fe90 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Mon, 30 Jul 2012 10:42:15 +0400 Subject: add per-CTRL ip-pool option to specify default ip pool name --- accel-pppd/ctrl/l2tp/l2tp.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'accel-pppd/ctrl/l2tp') diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index fa760487..162c9cb4 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -56,6 +56,7 @@ static int conf_dir300_quirk = 0; static const char *conf_host_name = "accel-ppp"; static const char *conf_secret = NULL; static int conf_mppe = MPPE_UNSET; +static char *conf_ip_pool; static unsigned int stat_active; static unsigned int stat_starting; @@ -336,6 +337,7 @@ static int l2tp_tunnel_alloc(struct l2tp_serv_t *serv, struct l2tp_packet_t *pac conn->ctrl.finished = l2tp_ppp_finished; conn->ctrl.max_mtu = 1420; conn->ctrl.mppe = conf_mppe; + conn->ctrl.def_pool = conf_ip_pool; conn->ctrl.calling_station_id = _malloc(17); conn->ctrl.called_station_id = _malloc(17); @@ -1232,6 +1234,13 @@ static void load_config(void) else if (strcmp(opt, "require") == 0) conf_mppe = MPPE_REQUIRE; } + + opt = conf_get_opt("l2tp", "ip-pool"); + if (opt) { + if (!conf_ip_pool || strcmp(conf_ip_pool, opt)) + conf_ip_pool = _strdup(opt); + } else + conf_ip_pool = NULL; } static void l2tp_init(void) -- cgit v1.2.3