diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2015-11-22 00:39:20 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2015-12-04 21:01:53 +0300 |
commit | bf84f9763ca3b6f018774b2b1664e838e119b028 (patch) | |
tree | 41cfefc92766e120bacf8974e77a267af881995a /accel-pppd/ctrl/l2tp | |
parent | 9ba935fac2880939921d98b0b238d11a8cf1f3f6 (diff) | |
download | accel-ppp-bf84f9763ca3b6f018774b2b1664e838e119b028.tar.gz accel-ppp-bf84f9763ca3b6f018774b2b1664e838e119b028.zip |
preparation for DPDK intergation
Diffstat (limited to 'accel-pppd/ctrl/l2tp')
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index befe0c90..6350e8e3 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -253,6 +253,12 @@ static inline int nsnr_cmp(uint16_t ns, uint16_t nr) return (sub_nsnr != 0 && sub_nsnr < ref) - (sub_nsnr >= ref); } +static void l2tp_ctx_switch(struct triton_context_t *ctx, void *arg) +{ + net = &def_net; + log_switch(ctx, arg); +} + static inline struct l2tp_conn_t *l2tp_tunnel_self(void) { return container_of(triton_context_self(), struct l2tp_conn_t, ctx); @@ -1684,7 +1690,7 @@ static struct l2tp_conn_t *l2tp_tunnel_alloc(const struct sockaddr_in *peer, conn->state = STATE_INIT; conn->framing_cap = framing_cap; - conn->ctx.before_switch = log_switch; + conn->ctx.before_switch = l2tp_ctx_switch; conn->ctx.close = l2tp_conn_close; conn->hnd.read = l2tp_conn_read; conn->timeout_timer.expire = l2tp_tunnel_timeout; @@ -1741,7 +1747,7 @@ static inline int l2tp_tunnel_update_peerport(struct l2tp_conn_t *conn, static int l2tp_session_start_data_channel(struct l2tp_sess_t *sess) { - sess->apses_ctx.before_switch = log_switch; + sess->apses_ctx.before_switch = l2tp_ctx_switch; sess->apses_ctx.close = apses_ctx_stop; sess->ctrl.ctx = &sess->apses_ctx; @@ -4436,7 +4442,7 @@ static struct l2tp_serv_t udp_serv = { .hnd.read = l2tp_udp_read, .ctx.close = l2tp_udp_close, - .ctx.before_switch = log_switch, + .ctx.before_switch = l2tp_ctx_switch, }; /*static struct l2tp_serv_t ip_serv = |