]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile on sunos again.
authorRoy Marples <roy@marples.name>
Sun, 1 May 2016 14:51:10 +0000 (14:51 +0000)
committerRoy Marples <roy@marples.name>
Sun, 1 May 2016 14:51:10 +0000 (14:51 +0000)
configure
dhcp-common.c
if-sun.c
ipv6.h

index fc7b76c259e60c608b7ceb07c036901096963d11..eaa6db2be0c3eab8d904ccd39cdf4f0ec525aa58 100755 (executable)
--- a/configure
+++ b/configure
@@ -347,8 +347,9 @@ CFLAGS+=    -Wpointer-sign -Wmissing-noreturn
 EOF
        case "$OS" in
        mirbsd*|openbsd*);; # OpenBSD has many redundant decs in system headers
-       bitrig*)        echo "CFLAGS+=  -Wredundant-decls" >>$CONFIG_MK
+       bitrig*|sunos*) echo "CFLAGS+=  -Wredundant-decls" >>$CONFIG_MK
                        ;; # Bitrig spouts many conversion errors with htons
+                          # sunos has many as well
        *)              echo "CFLAGS+=  -Wredundant-decls" >>$CONFIG_MK
                        echo "CFLAGS+=  -Wconversion" >>$CONFIG_MK
                        ;;
index 92ff8ceb6dd652c59c49e86a114a80e3c83c2cd0..d8028ce74e7a3d9468ffe2939820121fff761dbd 100644 (file)
@@ -27,8 +27,6 @@
 
 #include <sys/utsname.h>
 
-#include <arpa/nameser.h>
-
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -37,6 +35,8 @@
 #include <string.h>
 #include <unistd.h>
 
+#include <arpa/nameser.h> /* after normal includes for sunos */
+
 #include "config.h"
 
 #include "common.h"
index 42082c001e0d3473b0847546103e102343930426..68986a42e60fce798f9ac52aa532373ddc1dc60a 100644 (file)
--- a/if-sun.c
+++ b/if-sun.c
@@ -1,6 +1,6 @@
 /*
  * dhcpcd - DHCP client daemon
- * Copyright (c) 2006-2015 Roy Marples <roy@marples.name>
+ * Copyright (c) 2006-2016 Roy Marples <roy@marples.name>
  * All rights reserved
 
  * Redistribution and use in source and binary forms, with or without
 #include "ipv6nd.h"
 
 int
-if_init(__unused struct interface *iface)
+if_init(__unused struct interface *ifp)
 {
 
        return 0;
 }
 
 int
-if_conf(__unused struct interface *iface)
+if_conf(__unused struct interface *ifp)
 {
 
        return 0;
 }
 
 int
-if_openlinksocket(void)
+if_opensockets_os(struct dhcpcd_ctx *ctx)
 {
 
        errno = ENOTSUP;
        return -1;
 }
 
+void
+if_closesockets_os(struct dhcpcd_ctx *ctx)
+{
+
+}
+
 int
-if_getssid(const char *ifname, char *ssid)
+if_getssid(struct interface *ifp)
 {
 
        errno = ENOTSUP;
@@ -71,15 +77,32 @@ if_getssid(const char *ifname, char *ssid)
 }
 
 int
-if_vimaster(const char *ifname)
+if_vimaster(__unused const struct dhcpcd_ctx *ctx, __unused const char *ifname)
 {
 
        return 0;
 }
 
+int
+if_managelink(struct dhcpcd_ctx *ctx)
+{
+
+       errno = ENOTSUP;
+       return -1;
+}
+
+if_machinearch(char *str, size_t len)
+{
+
+       errno = ENOTSUP;
+       return -1;
+}
+
 #ifdef INET
+const char *if_pfname = "SunOS";
+
 int
-if_openrawsocket(struct interface *ifp, int protocol)
+if_openrawsocket(struct interface *ifp, uint16_t protocol)
 {
 
        errno = ENOTSUP;
@@ -87,7 +110,7 @@ if_openrawsocket(struct interface *ifp, int protocol)
 }
 
 ssize_t
-if_sendrawpacket(const struct interface *ifp, int protocol,
+if_sendrawpacket(const struct interface *ifp, uint16_t protocol,
     const void *data, size_t len)
 {
 
@@ -96,7 +119,7 @@ if_sendrawpacket(const struct interface *ifp, int protocol,
 }
 
 ssize_t
-if_readrawpacket(struct interface *ifp, int protocol,
+if_readrawpacket(struct interface *ifp, uint16_t protocol,
     void *data, size_t len, int *flags)
 {
 
@@ -105,8 +128,8 @@ if_readrawpacket(struct interface *ifp, int protocol,
 }
 
 int
-if_address(const struct interface *iface, const struct in_addr *address,
-    const struct in_addr *netmask, const struct in_addr *broadcast,
+if_address(const struct interface *iface, const struct in_addr *addr,
+    const struct in_addr *net, const struct in_addr *bcast,
     int action)
 {
 
@@ -115,17 +138,15 @@ if_address(const struct interface *iface, const struct in_addr *address,
 }
 
 int
-if_route(const struct rt *rt, int action)
+if_addrflags(const struct in_addr *addr, const struct interface *ifp)
 {
 
        errno = ENOTSUP;
        return -1;
 }
-#endif
 
-#ifdef INET6
 int
-if_address6(const struct ipv6_addr *a, int action)
+if_route(unsigned char cmd, const struct rt *rt)
 {
 
        errno = ENOTSUP;
@@ -133,7 +154,7 @@ if_address6(const struct ipv6_addr *a, int action)
 }
 
 int
-if_route6(const struct rt6 *rt, int action)
+if_initrt(struct interface *ifp)
 {
 
        errno = ENOTSUP;
@@ -142,6 +163,14 @@ if_route6(const struct rt6 *rt, int action)
 #endif
 
 #ifdef INET6
+int
+if_address6(const struct ipv6_addr *a, int action)
+{
+
+       errno = ENOTSUP;
+       return -1;
+}
+
 int
 if_addrflags6(const struct in6_addr *addr, const struct interface *ifp)
 {
@@ -149,32 +178,33 @@ if_addrflags6(const struct in6_addr *addr, const struct interface *ifp)
        errno = ENOTSUP;
        return -1;
 }
-#endif
 
 int
-if_managelink(struct dhcpcd_ctx *ctx)
+if_getlifetime6(struct ipv6_addr *addr)
 {
 
        errno = ENOTSUP;
        return -1;
 }
 
-if_machinearch(char *str, size_t len)
+int
+if_route6(unsigned char cmd, const struct rt6 *rt)
 {
 
        errno = ENOTSUP;
        return -1;
 }
 
-#ifdef INET6
-void
-if_rarestore(struct dhcpcd_ctx *ctx)
+int
+if_initrt6(struct interface *ifp)
 {
 
+       errno = ENOTSUP;
+       return -1;
 }
 
 int
-if_checkipv6(struct dhcpcd_ctx *ctx, const char *ifname, int own)
+if_checkipv6(struct dhcpcd_ctx *ctx, const struct interface *ifp, int own)
 {
 
        errno = ENOTSUP;
diff --git a/ipv6.h b/ipv6.h
index 0eee0dae8fb192ee104dc3d6e1fa6a2ddafaab0e..1fe138174b492a20b07505ede00d7b3d968eeb30 100644 (file)
--- a/ipv6.h
+++ b/ipv6.h
@@ -34,7 +34,7 @@
 #include "config.h"
 
 #ifndef __linux__
-#  ifndef __QNX__
+#  if !defined(__QNX__) && !defined(__sun)
 #    include <sys/endian.h>
 #  endif
 #  include <net/if.h>