if (!model_ops) goto failed;
if (lp_interfaces(task->lp_ctx) && lp_bind_interfaces_only(task->lp_ctx)) {
- int num_interfaces = iface_count();
+ int num_interfaces;
int i;
+ struct interface *ifaces;
+
+ load_interfaces(NULL, lp_interfaces(task->lp_ctx), &ifaces);
+
+ num_interfaces = iface_count(ifaces);
for(i = 0; i < num_interfaces; i++) {
- const char *address = iface_n_ip(i);
- status = stream_setup_socket(task->event_ctx, model_ops,
+ const char *address = iface_n_ip(ifaces, i);
+ status = stream_setup_socket(task->event_ctx,
+ task->lp_ctx, model_ops,
&web_stream_ops,
"ipv4", address,
- &port, task);
+ &port, lp_socket_options(task->lp_ctx),
+ task);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
+
+ talloc_free(ifaces);
} else {
- status = stream_setup_socket(task->event_ctx, model_ops,
- &web_stream_ops,
+ status = stream_setup_socket(task->event_ctx, task->lp_ctx,
+ model_ops, &web_stream_ops,
"ipv4", lp_socket_address(task->lp_ctx),
- &port, task);
+ &port, lp_socket_options(task->lp_ctx), task);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
struct loadparm_context *lp_ctx,
const struct model_ops *model_ops)
{
- return task_server_startup(event_context, model_ops, websrv_task_init);
+ return task_server_startup(event_context, lp_ctx, "web",
+ model_ops, websrv_task_init);
}
/* called at smbd startup - register ourselves as a server service */