summaryrefslogtreecommitdiff
path: root/accel-pppd/session.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-11-06 12:35:57 +0300
committerDmitry Kozlov <xeb@mail.ru>2014-11-06 12:35:57 +0300
commitb276238f8721849c364cf718f854c7b07a706254 (patch)
tree7072b043b36de7c82c6f2be745b6901c86c7ba38 /accel-pppd/session.c
parent22e13bac6488cfbb939fc1f54133f966a0cc1e62 (diff)
downloadaccel-ppp-b276238f8721849c364cf718f854c7b07a706254.tar.gz
accel-ppp-b276238f8721849c364cf718f854c7b07a706254.zip
release IP addresses before fire EV_SESSION_FINISHED (fixes segfault when using IPoE)
Diffstat (limited to 'accel-pppd/session.c')
-rw-r--r--accel-pppd/session.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/accel-pppd/session.c b/accel-pppd/session.c
index b50686cd..8885cb22 100644
--- a/accel-pppd/session.c
+++ b/accel-pppd/session.c
@@ -19,6 +19,7 @@
#include "log.h"
#include "events.h"
#include "ap_session.h"
+#include "ipdb.h"
#include "backup.h"
#include "iputils.h"
#include "spinlock.h"
@@ -159,6 +160,16 @@ void __export ap_session_finished(struct ap_session *ses)
break;
}
+ if (ses->ipv4 && ses->ipv4->owner) {
+ ipdb_put_ipv4(ses, ses->ipv4);
+ ses->ipv4 = NULL;
+ }
+
+ if (ses->ipv6 && ses->ipv6->owner) {
+ ipdb_put_ipv6(ses, ses->ipv6);
+ ses->ipv6 = NULL;
+ }
+
triton_event_fire(EV_SES_FINISHED, ses);
ses->ctrl->finished(ses);