jsoninfo: INADDR_LOOPBACK is in host format and the socket address is not
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 30 Nov 2015 21:50:54 +0000 (22:50 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Wed, 2 Dec 2015 17:41:12 +0000 (18:41 +0100)
e2149e7 did this for txtinfo, but forgot to apply the same
fix for jsoninfo

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index 9d2ce08..6b3dd90 100644 (file)
@@ -340,7 +340,7 @@ static void ipc_action(int fd, void *data __attribute__ ((unused)), unsigned int
       addr[0] = '\0';
     if (!ip4equal(&pin.in4.sin_addr, &info_accept_ip.v4) && info_accept_ip.v4.s_addr != INADDR_ANY) {
 #ifdef INFO_ALLOW_LOCALHOST
-      if (pin.in4.sin_addr.s_addr != INADDR_LOOPBACK) {
+      if (ntohl(pin.in4.sin_addr.s_addr) != INADDR_LOOPBACK) {
 #endif /* INFO_ALLOW_LOCALHOST */
       olsr_printf(1, "("PLUGIN_NAME") From host(%s) not allowed!\n", addr);
       close(ipc_connection);