提交 e61344e4 编写于 作者: D Dmitry Kozlov

ipoe: initialize before_switch function for server contexts

上级 8d3351d4
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册