diff options
author | Simon Rettberg | 2017-10-28 14:56:58 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-10-28 14:56:58 +0200 |
commit | c8c62246f84b5d9d4a496097f043696e2d9ba0bb (patch) | |
tree | 27a896f6677791ef8087fa44b1aab7cb2071d774 /src/server/rpc.c | |
parent | [SERVER] Add function to parse x-www-form-urlencoded strings (diff) | |
download | dnbd3-c8c62246f84b5d9d4a496097f043696e2d9ba0bb.tar.gz dnbd3-c8c62246f84b5d9d4a496097f043696e2d9ba0bb.tar.xz dnbd3-c8c62246f84b5d9d4a496097f043696e2d9ba0bb.zip |
[*] 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.
Diffstat (limited to 'src/server/rpc.c')
-rw-r--r-- | src/server/rpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |