From c8c62246f84b5d9d4a496097f043696e2d9ba0bb Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sat, 28 Oct 2017 14:56:58 +0200 Subject: [*] Introduce constants for IPv4/6 in dnbd3_host_t AF_INET luckily was "2" on all platforms checked, so no problems there with interoperation, but AF_INET6 is different between Linux, BSD, Windows and possibly others, so map back and forth between AF_INET/AF_INET6 and HOST_IP4/HOST_IP6 to fix this. --- src/server/altservers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server/altservers.c') diff --git a/src/server/altservers.c b/src/server/altservers.c index 18e2548..b9394cf 100644 --- a/src/server/altservers.c +++ b/src/server/altservers.c @@ -296,7 +296,7 @@ int altservers_netCloseness(dnbd3_host_t *host1, dnbd3_host_t *host2) { if ( host1 == NULL || host2 == NULL || host1->type != host2->type ) return -1; int retval = 0; - const int max = host1->type == AF_INET ? 4 : 16; + const int max = host1->type == HOST_IP4 ? 4 : 16; for (int i = 0; i < max; ++i) { if ( (host1->addr[i] & 0xf0) != (host2->addr[i] & 0xf0) ) return retval; ++retval; -- cgit v1.2.3-55-g7522