From: Roy Marples Date: Tue, 25 Apr 2023 10:06:29 +0000 (+0100) Subject: OpenBSD: fix unused variables compile warning X-Git-Tag: v10.0.2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b80133b6b306a4d62446a3347dac6424fb078a3c;p=thirdparty%2Fdhcpcd.git OpenBSD: fix unused variables compile warning --- diff --git a/src/if-bsd.c b/src/if-bsd.c index aba8eb72..aac7cf77 100644 --- a/src/if-bsd.c +++ b/src/if-bsd.c @@ -1832,23 +1832,20 @@ if_disable_rtadv(void) void if_setup_inet6(const struct interface *ifp) { +#ifdef ND6_NDI_FLAGS struct priv *priv; int s; -#ifdef ND6_NDI_FLAGS struct in6_ndireq nd; int flags; -#endif priv = (struct priv *)ifp->ctx->priv; s = priv->pf_inet6_fd; -#ifdef ND6_NDI_FLAGS memset(&nd, 0, sizeof(nd)); strlcpy(nd.ifname, ifp->name, sizeof(nd.ifname)); if (ioctl(s, SIOCGIFINFO_IN6, &nd) == -1) logerr("%s: SIOCGIFINFO_FLAGS", ifp->name); flags = (int)nd.ndi.flags; -#endif #ifdef ND6_IFF_AUTO_LINKLOCAL /* Unlike the kernel, dhcpcd make make a stable private address. */ @@ -1878,14 +1875,13 @@ if_setup_inet6(const struct interface *ifp) #endif #endif -#ifdef ND6_NDI_FLAGS if (nd.ndi.flags != (uint32_t)flags) { nd.ndi.flags = (uint32_t)flags; if (if_ioctl6(ifp->ctx, SIOCSIFINFO_FLAGS, &nd, sizeof(nd)) == -1) logerr("%s: SIOCSIFINFO_FLAGS", ifp->name); } -#endif +#endif /* ND6_NDI_FLAGS */ /* Enabling IPv6 by whatever means must be the * last action undertaken to ensure kernel RS and