aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2015-12-22 09:45:09 +0100
committerJan Moskyto Matejka <mq@ucw.cz>2015-12-22 09:45:09 +0100
commit70b90dde23a684c4d32aa53685f76a73ecba941d (patch)
treef75dbb0b0920a50b0d5ba1e096233100767b8641
parent600998fcb1a1d155215ab32644982e9b78767e3e (diff)
downloadbird-70b90dde23a684c4d32aa53685f76a73ecba941d.tar.gz
Better fix of missing AF_INET6? definition in lib/socket.h
Moved the code to sysdep.
-rw-r--r--lib/socket.h8
-rw-r--r--sysdep/unix/io.c6
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/socket.h b/lib/socket.h
index de8cff62..d7c78e72 100644
--- a/lib/socket.h
+++ b/lib/socket.h
@@ -10,7 +10,6 @@
#define _BIRD_SOCKET_H_
#include <errno.h>
-#include <sys/socket.h>
#include "lib/resource.h"
@@ -67,11 +66,8 @@ void sk_set_tbsize(sock *s, uint val); /* Resize TX buffer, keeping content */
void sk_set_tbuf(sock *s, void *tbuf); /* Switch TX buffer, NULL-> return to internal */
void sk_dump_all(void);
-static inline int sk_is_ipv4(sock *s)
-{ return s->af == AF_INET; }
-
-static inline int sk_is_ipv6(sock *s)
-{ return s->af == AF_INET6; }
+int sk_is_ipv4(sock *s); /* True if socket is IPv4 */
+int sk_is_ipv6(sock *s); /* True if socket is IPv6 */
static inline int sk_send_buffer_empty(sock *sk)
{ return sk->tbuf == sk->tpos; }
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index bc00def9..43c2eeef 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -1860,6 +1860,12 @@ sk_write(sock *s)
}
}
+int sk_is_ipv4(sock *s)
+{ return s->af == AF_INET; }
+
+int sk_is_ipv6(sock *s)
+{ return s->af == AF_INET6; }
+
void
sk_dump_all(void)
{