[Olsr-dev] [PATCH v1 008/115] jsoninfo: INADDR_LOOPBACK is in host format and the socket address is not
Ferry Huberts
(spam-protected)
Wed Dec 2 21:27:41 CET 2015
From: Ferry Huberts <(spam-protected)>
e2149e7 did this for txtinfo, but forgot to apply the same
fix for jsoninfo
Signed-off-by: Ferry Huberts <(spam-protected)>
---
lib/jsoninfo/src/olsrd_jsoninfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/jsoninfo/src/olsrd_jsoninfo.c b/lib/jsoninfo/src/olsrd_jsoninfo.c
index 9d2ce08..6b3dd90 100644
--- a/lib/jsoninfo/src/olsrd_jsoninfo.c
+++ b/lib/jsoninfo/src/olsrd_jsoninfo.c
@@ -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);
--
2.5.0
More information about the Olsr-dev
mailing list