}
#endif
-static int
-dhcp6_open(struct dhcpcd_ctx *ctx)
-{
-
- if (ctx->dhcp6_fd == -1)
- ctx->dhcp6_fd = dhcp6_openudp(0, NULL);
- return ctx->dhcp6_fd;
-}
-
static void
dhcp6_start1(void *arg)
{
size_t i;
const struct dhcp_compat *dhc;
- if (ctx->options & DHCPCD_MASTER) {
- if (dhcp6_open(ctx) == -1)
+ if (ctx->options & DHCPCD_MASTER && ctx->dhcp6_fd == -1) {
+ ctx->dhcp6_fd = dhcp6_openudp(0, NULL);
+ if (ctx->dhcp6_fd == -1) {
+ logerr(__func__);
return;
+ }
eloop_event_add(ctx->eloop, ctx->dhcp6_fd, dhcp6_recvctx, ctx);
}