From 8c608ea9a5b6b73520c11e3974bb8cad3b7da914 Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Thu, 3 Oct 2013 11:08:45 +0400 Subject: Introduce per-ctrl 'ip-pool' option to be used as default IP pool name which may be overrided by radius Signed-off-by: Dmitry Kozlov --- accel-pppd/ctrl/pppoe/pppoe.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'accel-pppd/ctrl/pppoe') diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index 21051ed3..c254c7aa 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -89,6 +89,7 @@ char *conf_pado_delay; int conf_tr101 = 1; int conf_padi_limit = 0; int conf_mppe = MPPE_UNSET; +static const char *conf_ip_pool; static mempool_t conn_pool; static mempool_t pado_pool; @@ -299,6 +300,9 @@ static struct pppoe_conn_t *allocate_channel(struct pppoe_serv_t *serv, const ui conn->ppp.ses.ctrl = &conn->ctrl; conn->ppp.ses.chan_name = conn->ctrl.calling_station_id; + + if (conf_ip_pool) + conn->ppp.ses.ipv4_pool_name = _strdup(conf_ip_pool); triton_context_register(&conn->ctx, &conn->ppp.ses); triton_context_wakeup(&conn->ctx); @@ -1489,6 +1493,8 @@ static void load_config(void) else if (strcmp(opt, "require") == 0) conf_mppe = MPPE_REQUIRE; } + + conf_ip_pool = conf_get_opt("pppoe", "ip-pool"); } static void pppoe_init(void) -- cgit v1.2.3