diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-06-05 14:24:31 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-06-05 14:27:57 +0400 |
commit | fa315a7a7584f6f4954888c010e3cc84c2b33330 (patch) | |
tree | 778396449f9e19c52d8b83e7fabdb1c37706e16f /accel-pppd/ppp/ppp_auth.c | |
parent | 6f01783f2b67cd0b82805240f2aeea9a39606d65 (diff) | |
download | accel-ppp-fa315a7a7584f6f4954888c010e3cc84c2b33330.tar.gz accel-ppp-fa315a7a7584f6f4954888c010e3cc84c2b33330.zip |
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
Diffstat (limited to 'accel-pppd/ppp/ppp_auth.c')
-rw-r--r-- | accel-pppd/ppp/ppp_auth.c | 12 |
1 files changed, 1 insertions, 11 deletions
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); } } |