diff options
Diffstat (limited to 'src/server/helper.h')
-rw-r--r-- | src/server/helper.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server/helper.h b/src/server/helper.h index 301a5ea..95a5157 100644 --- a/src/server/helper.h +++ b/src/server/helper.h @@ -19,7 +19,12 @@ void trim_right(char * const string); void setThreadName(char *name); void blockNoncriticalSignals(); -static inline int is_same_server(const dnbd3_host_t * const a, const dnbd3_host_t * const b) +static inline int 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) )); +} + +static inline int 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) )); } |