summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sysdep/linux/sysio.h15
-rw-r--r--sysdep/unix/io.c17
2 files changed, 16 insertions, 16 deletions
diff --git a/sysdep/linux/sysio.h b/sysdep/linux/sysio.h
index bef8a61..58fb977 100644
--- a/sysdep/linux/sysio.h
+++ b/sysdep/linux/sysio.h
@@ -7,10 +7,25 @@
*/
#ifdef IPV6
+
#include <linux/in6.h> /* FIXMEv6: glibc variant? */
+static inline void
+set_inaddr(struct in6_addr *ia, ip_addr a)
+{
+ ipa_hton(a);
+ memcpy(ia, &a, sizeof(a));
+}
+
#else
+static inline void
+set_inaddr(struct in_addr *ia, ip_addr a)
+{
+ ipa_hton(a);
+ memcpy(&ia->s_addr, &a, sizeof(a));
+}
+
/*
* Multicasting in Linux systems is a real mess. Not only different kernels
* have different interfaces, but also different libc's export it in different
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index af630f5..f860307 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -27,6 +27,7 @@
#include "nest/iface.h"
#include "lib/unix.h"
+#include "lib/sysio.h"
/*
* Random Numbers
@@ -379,13 +380,6 @@ sk_new(pool *p)
#ifdef IPV6
-static inline void
-set_inaddr(struct in6_addr *ia, ip_addr a)
-{
- ipa_hton(a);
- memcpy(ia, &a, sizeof(a));
-}
-
void
fill_in_sockaddr(sockaddr *sa, ip_addr a, unsigned port)
{
@@ -408,13 +402,6 @@ get_sockaddr(sockaddr *sa, ip_addr *a, unsigned *port)
#else
-static inline void
-set_inaddr(struct in_addr *ia, ip_addr a)
-{
- ipa_hton(a);
- memcpy(&ia->s_addr, &a, sizeof(a));
-}
-
void
fill_in_sockaddr(sockaddr *sa, ip_addr a, unsigned port)
{
@@ -436,8 +423,6 @@ get_sockaddr(sockaddr *sa, ip_addr *a, unsigned *port)
#endif
-#include "lib/sysio.h"
-
static char *
sk_setup(sock *s)
{