]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
OpenBSD: fix unused variables compile warning
authorRoy Marples <roy@marples.name>
Tue, 25 Apr 2023 10:06:29 +0000 (11:06 +0100)
committerRoy Marples <roy@marples.name>
Tue, 25 Apr 2023 10:06:29 +0000 (11:06 +0100)
src/if-bsd.c

index aba8eb721e846fd12c039116852017c11e2d36c8..aac7cf77ed3e9a444df6d0bca4d630051ad66f38 100644 (file)
@@ -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