]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Sockets would be opened with PF_*, not AF_*.
authorRoy Marples <roy@marples.name>
Tue, 20 May 2014 08:54:00 +0000 (08:54 +0000)
committerRoy Marples <roy@marples.name>
Tue, 20 May 2014 08:54:00 +0000 (08:54 +0000)
if-bsd.c
if-linux-wireless.c
if.c
ipv6nd.c

index 3413055471d82e77379ccfc7ad672d8550bef418..c4892c8bc8299ed41a1fb91d2f27f6f277876f09 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -149,7 +149,7 @@ if_getssid(const char *ifname, char *ssid)
        char nwid[IEEE80211_NWID_LEN + 1];
 #endif
 
-       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+       if ((s = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
                return -1;
 
 #if defined(SIOCG80211NWID) /* NetBSD */
@@ -197,7 +197,7 @@ if_vimaster(const char *ifname)
        int s, r;
        struct ifmediareq ifmr;
 
-       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+       if ((s = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
                return -1;
        memset(&ifmr, 0, sizeof(ifmr));
        strlcpy(ifmr.ifm_name, ifname, sizeof(ifmr.ifm_name));
@@ -397,7 +397,7 @@ if_address(const struct interface *iface, const struct in_addr *address,
                struct sockaddr_in *sin;
        } _s;
 
-       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+       if ((s = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
                return -1;
 
        memset(&ifa, 0, sizeof(ifa));
@@ -543,7 +543,7 @@ if_address6(const struct ipv6_addr *a, int action)
        struct in6_aliasreq ifa;
        struct in6_addr mask;
 
-       if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) == -1)
+       if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) == -1)
                return -1;
 
        memset(&ifa, 0, sizeof(ifa));
@@ -738,7 +738,7 @@ if_addrflags6(const char *ifname, const struct in6_addr *addr)
        int s, flags;
        struct in6_ifreq ifr6;
 
-       s = socket(AF_INET6, SOCK_DGRAM, 0);
+       s = socket(PF_INET6, SOCK_DGRAM, 0);
        flags = -1;
        if (s != -1) {
                memset(&ifr6, 0, sizeof(ifr6));
@@ -962,7 +962,7 @@ if_nd6_flag(const char *ifname, unsigned int flag, int set)
        struct in6_ndireq nd;
        unsigned int oflags;
 
-       if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) == -1)
+       if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) == -1)
                return -1;
        memset(&nd, 0, sizeof(nd));
        strlcpy(nd.ifname, ifname, sizeof(nd.ifname));
@@ -994,7 +994,7 @@ if_nd6reachable(const char *ifname, struct in6_addr *addr)
        int s, flags;
        struct in6_nbrinfo nbi;
 
-       if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
+       if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0)
                return -1;
 
        memset(&nbi, 0, sizeof(nbi));
@@ -1063,7 +1063,7 @@ if_raflush(void)
        int s;
        char dummy[IFNAMSIZ + 8];
 
-       s = socket(AF_INET6, SOCK_DGRAM, 0);
+       s = socket(PF_INET6, SOCK_DGRAM, 0);
        if (s == -1)
                return -1;
        strlcpy(dummy, "lo0", sizeof(dummy));
index 9733517d8986ab376f20b2b85c65a773ba60ba77..028b682a13960381fcfb10f5190361388082e438 100644 (file)
@@ -69,7 +69,7 @@ if_getssid(const char *ifname, char *ssid)
        int s, retval;
        struct iwreq iwr;
 
-       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+       if ((s = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
                return -1;
        memset(&iwr, 0, sizeof(iwr));
        strlcpy(iwr.ifr_name, ifname, sizeof(iwr.ifr_name));
diff --git a/if.c b/if.c
index ef6d0503acbd431d37c6d87e764e11ceed07d6bb..add301ea6383876c27e4be6f73878c123ee418a9 100644 (file)
--- a/if.c
+++ b/if.c
@@ -102,7 +102,7 @@ if_carrier(struct interface *iface)
        char *p;
 #endif
 
-       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+       if ((s = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
                return LINK_UNKNOWN;
        memset(&ifr, 0, sizeof(ifr));
        strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name));
@@ -141,7 +141,7 @@ up_interface(struct interface *iface)
        char *p;
 #endif
 
-       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+       if ((s = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
                return -1;
        memset(&ifr, 0, sizeof(ifr));
        strlcpy(ifr.ifr_name, iface->name, sizeof(ifr.ifr_name));
@@ -198,11 +198,11 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
 #endif
 
 #ifdef SIOCGIFPRIORITY
-       if ((s_inet = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+       if ((s_inet = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
                return NULL;
 #endif
 #ifdef IFLR_ACTIVE
-       if ((s_link = socket(AF_LINK, SOCK_DGRAM, 0)) == -1) {
+       if ((s_link = socket(PF_LINK, SOCK_DGRAM, 0)) == -1) {
 #ifdef SIOCGIFPRIORITY
                close(s_inet);
 #endif
@@ -502,7 +502,7 @@ if_domtu(const char *ifname, short int mtu)
        int s, r;
        struct ifreq ifr;
 
-       if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
+       if ((s = socket(PF_INET, SOCK_DGRAM, 0)) == -1)
                return -1;
        memset(&ifr, 0, sizeof(ifr));
        strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
index 9977fd06e60923fa13fe443db7bf1cf0b7704aef..362fe4f745ef59c93d7a5120bac719b9c67ab7c3 100644 (file)
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -172,12 +172,12 @@ ipv6nd_open(struct dhcpcd_ctx *dctx)
        if (ctx->nd_fd != -1)
                return ctx->nd_fd;
 #ifdef SOCK_CLOEXEC
-       ctx->nd_fd = socket(AF_INET6, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK,
+       ctx->nd_fd = socket(PF_INET6, SOCK_RAW | SOCK_CLOEXEC | SOCK_NONBLOCK,
            IPPROTO_ICMPV6);
        if (ctx->nd_fd == -1)
                return -1;
 #else
-       if ((ctx->nd_fd = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) == -1)
+       if ((ctx->nd_fd = socket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) == -1)
                return -1;
        if ((on = fcntl(ctx->nd_fd, F_GETFD, 0)) == -1 ||
            fcntl(ctx->nd_fd, F_SETFD, on | FD_CLOEXEC) == -1)