summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-10-17 21:51:54 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-10-17 21:51:54 +0400
commite61344e439bbbca5ba711cf7566fdf5bcf8a34cc (patch)
tree4a7df87ca09a45e15ae5d11f8d12a9d58a28f0a4 /accel-pppd
parent8d3351d4cdfcaf45aa2c918b0f8920798be4dc04 (diff)
downloadaccel-ppp-e61344e439bbbca5ba711cf7566fdf5bcf8a34cc.tar.gz
accel-ppp-e61344e439bbbca5ba711cf7566fdf5bcf8a34cc.zip
ipoe: initialize before_switch function for server contexts
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ctrl/ipoe/dhcpv4.c2
-rw-r--r--accel-pppd/ctrl/ipoe/ipoe.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c
index 21042b7..b34a239 100644
--- a/accel-pppd/ctrl/ipoe/dhcpv4.c
+++ b/accel-pppd/ctrl/ipoe/dhcpv4.c
@@ -890,6 +890,8 @@ struct dhcpv4_relay *dhcpv4_relay_create(const char *_addr, in_addr_t giaddr, st
r->hnd.fd = sock;
r->hnd.read = dhcpv4_relay_read;
+ r->ctx.before_switch = log_switch;
+
triton_context_register(&r->ctx, NULL);
triton_md_register_handler(&r->ctx, &r->hnd);
triton_md_enable_handler(&r->hnd, MD_MODE_READ);
diff --git a/accel-pppd/ctrl/ipoe/ipoe.c b/accel-pppd/ctrl/ipoe/ipoe.c
index 2a49b83..483ea7f 100644
--- a/accel-pppd/ctrl/ipoe/ipoe.c
+++ b/accel-pppd/ctrl/ipoe/ipoe.c
@@ -2302,6 +2302,7 @@ static void add_interface(const char *ifname, int ifindex, const char *opt, int
serv = _malloc(sizeof(*serv));
memset(serv, 0, sizeof(*serv));
serv->ctx.close = ipoe_serv_close;
+ serv->ctx.before_switch = log_switch;
pthread_mutex_init(&serv->lock, NULL);
serv->ifname = _strdup(ifname);
serv->ifindex = ifindex;
@@ -3078,7 +3079,7 @@ static void ipoe_init(void)
disc_item_pool = mempool_create(sizeof(struct disc_item));
req_item_pool = mempool_create(sizeof(struct request_item));
uc_pool = mempool_create(sizeof(struct unit_cache));
-
+
triton_context_register(&l4_redirect_ctx, NULL);
triton_context_wakeup(&l4_redirect_ctx);