Also add os_init incase other os need similar in the future.
}
#endif
+ os_init();
+
#if defined(BSD) && defined(INET6)
/* Disable the kernel RTADV sysctl as early as possible. */
if (ctx.options & DHCPCD_IPV6 && ctx.options & DHCPCD_IPV6RS)
struct dev *dev;
void *dev_handle;
#endif
-
-#ifdef __linux__
- char netns[PATH_MAX];
-#endif
};
#ifdef USE_SIGNALS
char buffer[sizeof(struct sockaddr_storage) * RTAX_MAX];
};
+int
+os_init(void)
+{
+ return 0;
+}
+
int
if_init(__unused struct interface *iface)
{
int route_fd;
int generic_fd;
uint32_t route_pid;
- char netns[PATH_MAX];
};
/* We need this to send a broadcast for InfiniBand.
return bufp;
}
+int
+os_init(void)
+{
+ char netns[PATH_MAX], *p;
+
+ p = if_getnetworknamespace(netns, sizeof(netns));
+ if (p != NULL)
+ loginfox("network namespace: %s", p);
+
+ return 0;
+}
+
int
if_opensockets_os(struct dhcpcd_ctx *ctx)
{
if (priv->generic_fd == -1)
return -1;
- if (if_getnetworknamespace(ctx->netns, sizeof(ctx->netns)) != NULL)
- logdebugx("network namespace: %s", ctx->netns);
-
return 0;
}
static int if_plumb(int, const struct dhcpcd_ctx *, int, const char *);
+int
+os_init(void)
+{
+ return 0;
+}
+
int
if_init(struct interface *ifp)
{
int if_nametospec(const char *, struct if_spec *);
/* The below functions are provided by if-KERNEL.c */
+int os_init(void);
int if_conf(struct interface *);
int if_init(struct interface *);
int if_getssid(struct interface *);