]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Revert "OpenBSD: When attaching INET6 set IFF_UP"
authorRoy Marples <roy@marples.name>
Wed, 26 Apr 2023 13:01:07 +0000 (14:01 +0100)
committerRoy Marples <roy@marples.name>
Wed, 26 Apr 2023 13:01:07 +0000 (14:01 +0100)
This reverts commit 985aa759da7b8b1c47d5e90c5a6e835ec17855e8.

src/if-bsd.c
src/if-linux.c
src/if-sun.c
src/if.h

index f6f0902d72be88034dcec0a9f97d1edf17da0516..eb3a4380de18e386592e9f45f262b6c10cdb67c3 100644 (file)
@@ -1758,9 +1758,10 @@ ip6_forwarding(__unused const char *ifname)
 static int
 if_af_attach(const struct interface *ifp, int af)
 {
-       struct if_afreq ifar = { .ifar_af = af };
+       struct if_afreq ifar;
 
        strlcpy(ifar.ifar_name, ifp->name, sizeof(ifar.ifar_name));
+       ifar.ifar_af = af;
        return if_ioctl6(ifp->ctx, SIOCIFAFATTACH, &ifar, sizeof(ifar));
 }
 #endif
@@ -1832,7 +1833,7 @@ if_disable_rtadv(void)
 }
 
 void
-if_setup_inet6(struct interface *ifp)
+if_setup_inet6(const struct interface *ifp)
 {
 #ifdef ND6_NDI_FLAGS
        struct priv *priv;
@@ -1891,14 +1892,6 @@ if_setup_inet6(struct interface *ifp)
 #ifdef SIOCIFAFATTACH
        if (if_af_attach(ifp, AF_INET6) == -1)
                logerr("%s: if_af_attach", ifp->name);
-#ifdef __OpenBSD__
-       /* Adding any address to any interface *will* force the interface
-        * UP without sending a notification via route(4).
-        * Attaching INET6 will add a LL address.
-        * This truely sucks balls, but is what it is. */
-       else
-               ifp->flags |= IFF_UP;
-#endif
 #endif
 
 #ifdef SIOCGIFXFLAGS
index ea47f0d67f5fa95f55a8f32937d11f4a848dc016..3ca967055d5d6cda2f228efd38dc564daecfb33d 100644 (file)
@@ -2117,7 +2117,7 @@ static const char *p_conf = "/proc/sys/net/ipv6/conf";
 static const char *p_neigh = "/proc/sys/net/ipv6/neigh";
 
 void
-if_setup_inet6(struct interface *ifp)
+if_setup_inet6(const struct interface *ifp)
 {
        struct dhcpcd_ctx *ctx = ifp->ctx;
        int ra;
index 9e152c747963996565472244cc338a5f34916917..0a60368edb5e63287c5398b9570ea28bb5584913 100644 (file)
@@ -1741,7 +1741,7 @@ if_applyra(const struct ra *rap)
 }
 
 void
-if_setup_inet6(__unused struct interface *ifp)
+if_setup_inet6(__unused const struct interface *ifp)
 {
 
 }
index 6ae22d610bd55138654638fc5b3eee3d18a74d54..df5f921e63987562c2f3ba0268940d8a2ac21dab 100644 (file)
--- a/src/if.h
+++ b/src/if.h
@@ -266,7 +266,7 @@ int if_addrflags(const struct interface *, const struct in_addr *,
 
 #ifdef INET6
 void if_disable_rtadv(void);
-void if_setup_inet6(struct interface *);
+void if_setup_inet6(const struct interface *);
 int ip6_forwarding(const char *ifname);
 
 struct ra;