Code

treewide: Use AF_UNSPEC consistently
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 2 Aug 2016 15:16:58 +0000 (17:16 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Wed, 3 Aug 2016 08:06:07 +0000 (10:06 +0200)
.ai_family expects an address family, not a protocol family.
Note that on most platforms these constants are the same, so this
is purely cosmetic.

src/hddtemp.c
src/mbmon.c
src/ntpd.c
src/olsrd.c

index 1b7ed329a9a088360730abc44fd59eee356da2d5..e7b4d8a10d63aefcc153bb9757ca770ec2e1504d 100644 (file)
@@ -101,7 +101,7 @@ static int hddtemp_query_daemon (char *buffer, int buffer_size)
 
        struct addrinfo ai_hints = {
                .ai_flags = AI_ADDRCONFIG,
-               .ai_family = PF_UNSPEC,
+               .ai_family = AF_UNSPEC,
                .ai_protocol = IPPROTO_TCP,
                .ai_socktype = SOCK_STREAM
        };
index 1f0a0d638814bdd2cd31b0255df039d7ca388914..5f398d0c8301fd1701a98c0d1a68695323290487 100644 (file)
@@ -96,7 +96,7 @@ static int mbmon_query_daemon (char *buffer, int buffer_size)
                port = MBMON_DEF_PORT;
 
        struct addrinfo ai_hints = {
-               .ai_family = PF_UNSPEC,
+               .ai_family = AF_UNSPEC,
                .ai_flags = AI_ADDRCONFIG,
                .ai_protocol = IPPROTO_TCP,
                .ai_socktype = SOCK_STREAM
index e075a208b745790ac011a0efe7e6dbaef34395e9..c3dee22c2d0b656e3ad9e2cb9a8c723acdbb8bbf 100644 (file)
@@ -364,7 +364,7 @@ static int ntpd_connect (void)
                port = NTPD_DEFAULT_PORT;
 
        struct addrinfo ai_hints = {
-               .ai_family   = PF_UNSPEC,
+               .ai_family   = AF_UNSPEC,
                .ai_flags    = AI_ADDRCONFIG,
                .ai_protocol = IPPROTO_UDP,
                .ai_socktype = SOCK_DGRAM
index ac47811ceb4734aae3178cd43eac65c4b03a70a3..7838ebaaa2f90ed96164a19dfba6c37e4bc09591 100644 (file)
@@ -155,7 +155,7 @@ static FILE *olsrd_connect (void) /* {{{ */
   FILE *fh;
 
   struct addrinfo ai_hints = {
-    .ai_family   = PF_UNSPEC,
+    .ai_family   = AF_UNSPEC,
     .ai_flags    = AI_ADDRCONFIG,
     .ai_protocol = IPPROTO_TCP,
     .ai_socktype = SOCK_STREAM