chiark / gitweb /
Fix check_loopback()
authorStéphane Graber <stgraber@ubuntu.com>
Sat, 27 Dec 2014 18:17:39 +0000 (19:17 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Sat, 27 Dec 2014 18:17:39 +0000 (19:17 +0100)
Add missing htonl() so that check_loopback() actually tests for 127.0.0.1
instead of 1.0.0.127 on little-endian machines.

src/core/loopback-setup.c

index 98fc04dd2e93e67c799359e4844d1efa7e02acd4..ab6335c0ceb576198b03630ac7288b90dae25dd7 100644 (file)
@@ -64,7 +64,7 @@ static int check_loopback(void) {
                 struct sockaddr_in in;
         } sa = {
                 .in.sin_family = AF_INET,
-                .in.sin_addr.s_addr = INADDR_LOOPBACK,
+                .in.sin_addr.s_addr = htonl(INADDR_LOOPBACK),
         };
 
         /* If we failed to set up the loop back device, check whether