From 1a19681636d57f443321488ba736db66a1fc6c6b Mon Sep 17 00:00:00 2001 From: Dmitry Kozlov Date: Mon, 28 Nov 2016 14:25:51 +0300 Subject: vlan_mon: switch context to default net --- accel-pppd/vlan-mon/vlan_mon.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'accel-pppd') diff --git a/accel-pppd/vlan-mon/vlan_mon.c b/accel-pppd/vlan-mon/vlan_mon.c index 102f6f4..10e6c21 100644 --- a/accel-pppd/vlan-mon/vlan_mon.c +++ b/accel-pppd/vlan-mon/vlan_mon.c @@ -18,6 +18,7 @@ #include "genl.h" #include "libnetlink.h" #include "iputils.h" +#include "ap_net.h" #include "vlan_mon.h" #include "if_vlan_mon.h" @@ -503,6 +504,12 @@ static void vlan_mon_mc_close(struct triton_context_t *ctx) triton_context_unregister(ctx); } +static void mc_ctx_switch(struct triton_context_t *ctx, void *arg) +{ + net = def_net; + log_switch(NULL, NULL); +} + static struct triton_context_t mc_ctx = { .close = vlan_mon_mc_close, }; @@ -531,6 +538,7 @@ static void init(void) fcntl(rth.fd, F_SETFL, O_NONBLOCK); fcntl(rth.fd, F_SETFD, fcntl(rth.fd, F_GETFD) | FD_CLOEXEC); + mc_ctx.before_switch = mc_ctx_switch; triton_context_register(&mc_ctx, NULL); mc_hnd.fd = rth.fd; triton_md_register_handler(&mc_ctx, &mc_hnd); -- cgit v1.2.3