diff options
author | Simon Rettberg | 2013-10-22 16:43:08 +0200 |
---|---|---|
committer | Simon Rettberg | 2013-10-22 16:43:08 +0200 |
commit | a031fde5f8343d68e774a7087d3deac287ce3a24 (patch) | |
tree | 8bb6d8ec4a57b37d0395756b336fb016811539d9 /src/server/helper.h | |
parent | [SERVER] Fetch correct revision after cloning (diff) | |
download | dnbd3-a031fde5f8343d68e774a7087d3deac287ce3a24.tar.gz dnbd3-a031fde5f8343d68e774a7087d3deac287ce3a24.tar.xz dnbd3-a031fde5f8343d68e774a7087d3deac287ce3a24.zip |
[SERVER] Refactoring, more debug output, try to check for cyclic proxying
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) )); } |