netifd-wireless: parse 'osen' encryption
[project/netifd.git] / interface-ip.c
index ff8f2193e33d627d36cb1c5ae24360fc3e064674..f1ed8d39cad1b3a2b2a90b47326fd50e608fb85c 100644 (file)
@@ -24,6 +24,8 @@
 
 #ifdef linux
 #include <netinet/ether.h>
+#else
+#include <net/ethernet.h>
 #endif
 
 #include "netifd.h"
@@ -1268,6 +1270,8 @@ interface_ip_add_device_prefix(struct interface *iface, struct in6_addr *addr,
                uint8_t length, time_t valid_until, time_t preferred_until,
                struct in6_addr *excl_addr, uint8_t excl_length, const char *pclass)
 {
+       union if_addr a = { .in6 = *addr };
+
        if (!pclass)
                pclass = (iface) ? iface->name : "local";
 
@@ -1275,8 +1279,10 @@ interface_ip_add_device_prefix(struct interface *iface, struct in6_addr *addr,
        if (!prefix)
                return NULL;
 
+       clear_if_addr(&a, length);
+
        prefix->length = length;
-       prefix->addr = *addr;
+       prefix->addr = a.in6;
        prefix->preferred_until = preferred_until;
        prefix->valid_until = valid_until;
        prefix->iface = iface;