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/rpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/rpc.c') diff --git a/src/server/rpc.c b/src/server/rpc.c index 6b958be..255d893 100644 --- a/src/server/rpc.c +++ b/src/server/rpc.c @@ -267,11 +267,11 @@ static void addacl(int argc, char **argv, void *data UNUSED) char *last; bits = strtol( slash, &last, 10 ); if ( last == slash ) slash = NULL; - if ( host.type == AF_INET && bits > 32 ) bits = 32; + if ( host.type == HOST_IP4 && bits > 32 ) bits = 32; if ( bits > 128 ) bits = 128; } if ( slash == NULL ) { - if ( host.type == AF_INET ) { + if ( host.type == HOST_IP4 ) { bits = 32; } else { bits = 128; -- cgit v1.2.3-55-g7522