From 270f02c8dccb663baa0b1d6e518518f4e364d068 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Tue, 28 Jan 2014 22:14:07 +0100 Subject: [PATCH] INADDR_* macros are defined in host byte order --- src/modbus-tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index 31ed7c3..b837bb9 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -517,7 +517,7 @@ int modbus_tcp_listen(modbus_t *ctx, int nb_connection) addr.sin_port = htons(ctx_tcp->port); if (ctx_tcp->ip[0] == '0') { /* Listen any addresses */ - addr.sin_addr.s_addr = INADDR_ANY; + addr.sin_addr.s_addr = htonl(INADDR_ANY); } else { /* Listen only specified IP address */ addr.sin_addr.s_addr = inet_addr(ctx_tcp->ip); -- libgit2 0.21.4