diff --git a/base/hosts.c b/base/hosts.c
index fd4a3f5..543231f 100644
--- a/base/hosts.c
+++ b/base/hosts.c
@@ -2031,10 +2031,10 @@ gvm_duplicate_host (gvm_host_t *host)
       ret->name = g_strdup (host->name);
       break;
     case HOST_TYPE_IPV4:
-      ret->addr.s_addr = host->addr.s_addr;
+      ret->addr = host->addr;
       break;
     case HOST_TYPE_IPV6:
-      ret->addr6.__in6_u = host->addr6.__in6_u;
+      ret->addr6 = host->addr6;
       break;
     default:
       g_free (ret);
