Mercurial > hg > dhcpcd
changeset 5397:4c2de9b44e60 draft
BSD: Setup sysctls before redirecting stderr
Need to do this as early as.
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Wed, 01 Jul 2020 11:46:01 +0100 |
| parents | 541348d5a5a9 |
| children | 505ddba6ec99 |
| files | src/dhcpcd.c |
| diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dhcpcd.c Wed Jul 01 11:45:06 2020 +0100 +++ b/src/dhcpcd.c Wed Jul 01 11:46:01 2020 +0100 @@ -2262,6 +2262,12 @@ } #endif +#if defined(BSD) && defined(INET6) + /* Disable the kernel RTADV sysctl as early as possible. */ + if (ctx.options & DHCPCD_IPV6 && ctx.options & DHCPCD_IPV6RS) + if_disable_rtadv(); +#endif + if (isatty(STDOUT_FILENO) && freopen(_PATH_DEVNULL, "r", stdout) == NULL) logerr("%s: freopen stdout", __func__); @@ -2278,12 +2284,6 @@ } } -#if defined(BSD) && defined(INET6) - /* Disable the kernel RTADV sysctl as early as possible. */ - if (ctx.options & DHCPCD_IPV6 && ctx.options & DHCPCD_IPV6RS) - if_disable_rtadv(); -#endif - /* If we're not running in privsep, we need to create the DB * directory here. */ if (!(ctx.options & DHCPCD_PRIVSEP)) {
