summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2016-11-28 14:25:51 +0300
committerDmitry Kozlov <xeb@mail.ru>2016-11-28 14:25:51 +0300
commit1a19681636d57f443321488ba736db66a1fc6c6b (patch)
treee3eda091628c12276af6177a4404dd73a8d1aab1
parentaaedc70f5ef82bbc8c711dcd5f1e5913bc2118d0 (diff)
downloadaccel-ppp-1a19681636d57f443321488ba736db66a1fc6c6b.tar.gz
accel-ppp-1a19681636d57f443321488ba736db66a1fc6c6b.zip
vlan_mon: switch context to default net
-rw-r--r--accel-pppd/vlan-mon/vlan_mon.c8
1 files changed, 8 insertions, 0 deletions
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);