From ae72e179afa46d82865aa8d459b32cc27541e4a7 Mon Sep 17 00:00:00 2001 From: Vladislav Grishenko Date: Mon, 30 Oct 2017 17:27:22 +0500 Subject: ppp: implement per-ctrl ppp interface rename support, may be overrided by radius Reuse exsisting radius functionality and allow set iterface name template for pppoe/pptp/l2tp, '%d' specification will be replaced automagically to the next available index by kernel. PPP interface rename allows to easy differ client's interfaces from the other ppp ones, for example, with just netfilter interface rules. Example: [pptp] ifname=pptp%d will produce pptp0, pptp1, ... --- accel-pppd/ctrl/pptp/pptp.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'accel-pppd/ctrl/pptp') diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index fa48687..88b3759 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -61,6 +61,7 @@ static int conf_echo_failure = 3; static int conf_verbose = 0; static int conf_mppe = MPPE_UNSET; static const char *conf_ip_pool; +static const char *conf_ifname; static mempool_t conn_pool; @@ -705,6 +706,8 @@ static int pptp_connect(struct triton_md_handler_t *h) if (conf_ip_pool) conn->ppp.ses.ipv4_pool_name = _strdup(conf_ip_pool); + if (conf_ifname) + conn->ppp.ses.ifname_rename = _strdup(conf_ifname); triton_context_register(&conn->ctx, &conn->ppp.ses); triton_md_register_handler(&conn->ctx, &conn->hnd); @@ -781,6 +784,7 @@ static void load_config(void) } conf_ip_pool = conf_get_opt("pptp", "ip-pool"); + conf_ifname = conf_get_opt("pptp", "ifname"); switch (iprange_check_activation()) { case IPRANGE_DISABLED: -- cgit v1.2.3