Fix check_loopback()

Add missing htonl() so that check_loopback() actually tests for 127.0.0.1
instead of 1.0.0.127 on little-endian machines.
This commit is contained in:
Stéphane Graber
2014-12-27 19:17:39 +01:00
committed by Martin Pitt
parent 01c51934cb
commit 58a489c2b3
+1 -1
View 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