From 9974975faccdceddd8f37b75eb39099636685486 Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Wed, 27 Jun 2018 13:41:38 +1000 Subject: ctdb-common: Use sin6_len only if the structure supports it BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke (cherry picked from commit 79992dbb73ac9749ac987cb6a88964fa600b4c35) --- ctdb/common/ctdb_util.c | 4 ++-- ctdb/common/system_util.c | 2 +- ctdb/protocol/protocol_util.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'ctdb') diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c index 82526b58a19..ffaa1a780ed 100644 --- a/ctdb/common/ctdb_util.c +++ b/ctdb/common/ctdb_util.c @@ -389,8 +389,8 @@ void ctdb_canonicalize_ip(const ctdb_sock_addr *ip, ctdb_sock_addr *cip) sizeof(cip->ip.sin_addr)); } else { cip->ip6.sin6_family = AF_INET6; -#ifdef HAVE_SOCK_SIN_LEN - cip->ip6.sin_len = sizeof(ctdb_sock_addr); +#ifdef HAVE_SOCK_SIN6_LEN + cip->ip6.sin6_len = sizeof(ctdb_sock_addr); #endif cip->ip6.sin6_port = ip->ip6.sin6_port; memcpy(&cip->ip6.sin6_addr, diff --git a/ctdb/common/system_util.c b/ctdb/common/system_util.c index f27eed7038d..f1e9763c52a 100644 --- a/ctdb/common/system_util.c +++ b/ctdb/common/system_util.c @@ -154,7 +154,7 @@ static bool parse_ipv6(const char *s, const char *ifaces, unsigned port, ctdb_so saddr->ip6.sin6_scope_id = if_nametoindex(ifaces); } -#ifdef HAVE_SOCK_SIN_LEN +#ifdef HAVE_SOCK_SIN6_LEN saddr->ip6.sin6_len = sizeof(*saddr); #endif return true; diff --git a/ctdb/protocol/protocol_util.c b/ctdb/protocol/protocol_util.c index 73652e7f060..c75555fa734 100644 --- a/ctdb/protocol/protocol_util.c +++ b/ctdb/protocol/protocol_util.c @@ -206,7 +206,7 @@ static int ipv6_from_string(const char *str, struct sockaddr_in6 *ip6) return EINVAL; } -#ifdef HAVE_SOCK_SIN_LEN +#ifdef HAVE_SOCK_SIN6_LEN ip6->sin6_len = sizeof(*ip6); #endif return 0; -- cgit v1.2.1