Commit Diff


commit - 275b5ade3a9d9c9850dd0e6f3129bdd58e4a3756
commit + 8f795179913a172632debbcf459cdea3562a2279
blob - /dev/null
blob + 3ee344ae0da72bf5dce7537f2d690a67fec60bed (mode 644)
--- /dev/null
+++ compat/sockaddr-linux.c
@@ -0,0 +1,27 @@
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include <string.h>
+
+#include "got_sockaddr.h"
+
+/* These calls are found in lib/socketaddr.c, but are overriden here for
+ * platform-specific reasons.
+ */
+
+void
+got_sockaddr_inet_init(struct sockaddr_in *in, struct in_addr *ina)
+{
+	in->sin_family = AF_INET;
+	in->sin_addr.s_addr = ina->s_addr;
+}
+
+void
+got_sockaddr_inet6_init(struct sockaddr_in6 *in6, struct in6_addr *in6a,
+    uint32_t sin6_scope_id)
+{
+	in6->sin6_family = AF_INET6;
+	memcpy(&in6->sin6_addr, in6a, sizeof(in6->sin6_addr));
+	in6->sin6_scope_id = sin6_scope_id;
+}
blob - d3effa5d26df2da9b48681c1e302195ca6731d4e
blob + f2e1a2e3d98e637f912bf963ffafe63b73fab425
--- gotwebd/Makefile.am
+++ gotwebd/Makefile.am
@@ -54,6 +54,11 @@ gotwebd_SOURCES = config.c \
 		  $(top_srcdir)/lib/utf8.c \
 		  $(top_srcdir)/lib/worktree.c \
 		  $(top_srcdir)/lib/worktree_open.c
+if HOST_LINUX
+nodist_gotwebd_SOURCES = $(top_srcdir)/compat/sockaddr-@PLATFORM@.c
+else
+nodist_gotwebd_SOURCES = $(top_srcdir)/lib/sockaddr.c
+endif
 
 gotwebd_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a
 EXTRA_DIST = $(top_srcdir)/gotwebd/*.h \