From fa315a7a7584f6f4954888c010e3cc84c2b33330 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Tue, 5 Jun 2012 14:24:31 +0400 Subject: ppp: implemented unit cache If enabled accel-pppd will not destroy interface immediately after corresponding session is terminated, instead interface will be brought down and placed to cache for later use for new sessions. It should reduce kernel interface creation/deletion rate lack and increase responsibility of daemon --- accel-pppd/ppp/ppp_auth.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'accel-pppd/ppp/ppp_auth.c') diff --git a/accel-pppd/ppp/ppp_auth.c b/accel-pppd/ppp/ppp_auth.c index f78b652..7603d8c 100644 --- a/accel-pppd/ppp/ppp_auth.c +++ b/accel-pppd/ppp/ppp_auth.c @@ -337,16 +337,6 @@ static void __ppp_auth_started(struct ppp_t *ppp) triton_event_fire(EV_PPP_AUTHORIZED, ppp); } -static void ifdown(struct ppp_t *ppp) -{ - struct ifreq ifr; - - memset(&ifr, 0, sizeof(ifr)); - strcpy(ifr.ifr_name, ppp->ifname); - - ioctl(sock_fd, SIOCSIFFLAGS, &ifr); -} - int __export ppp_auth_successed(struct ppp_t *ppp, char *username) { struct ppp_t *p; @@ -362,7 +352,7 @@ int __export ppp_auth_successed(struct ppp_t *ppp, char *username) return -1; } else { if (conf_single_session == 1) { - ifdown(p); + ppp_ifdown(p); triton_context_call(p->ctrl->ctx, (triton_event_func)ppp_terminate_sec, p); } } -- cgit v1.2.3