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/fuse/helper.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/fuse') diff --git a/src/fuse/helper.h b/src/fuse/helper.h index 8c290cc..9e5d127 100644 --- a/src/fuse/helper.h +++ b/src/fuse/helper.h @@ -24,12 +24,12 @@ int connect_to_server(char *server_adress, int port); static inline bool isSameAddressPort(const dnbd3_host_t * const a, const dnbd3_host_t * const b) { - return (a->type == b->type) && (a->port == b->port) && (0 == memcmp( a->addr, b->addr, (a->type == AF_INET ? 4 : 16) )); + return (a->type == b->type) && (a->port == b->port) && (0 == memcmp( a->addr, b->addr, (a->type == HOST_IP4 ? 4 : 16) )); } static inline bool isSameAddress(const dnbd3_host_t * const a, const dnbd3_host_t * const b) { - return (a->type == b->type) && (0 == memcmp( a->addr, b->addr, (a->type == AF_INET ? 4 : 16) )); + return (a->type == b->type) && (0 == memcmp( a->addr, b->addr, (a->type == HOST_IP4 ? 4 : 16) )); } #endif -- cgit v1.2.3-55-g7522