From b9eb3647186bf697e4bdc8f60fd05cc15a99c18b Mon Sep 17 00:00:00 2001 From: Aaron Krebs Date: Tue, 12 Aug 2014 11:43:35 +0200 Subject: [PATCH] Removed references to HAVE_STRUCT_SOCKADDR_STORAGE. Enforced sockaddr_storage support in configure.ac --- configure.ac | 4 ++++ src/meshlink.c | 2 -- src/meshlink.h | 2 -- src/sockaddr.h | 2 -- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 2f1caa68..6c6543cb 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,10 @@ AC_CHECK_TYPES([socklen_t, struct addrinfo, struct sockaddr_in6], , , [#include "src/have.h"] ) +AC_CHECK_TYPES([struct sockaddr_storage], ,AC_MSG_ERROR([System must support struct sockaddr_storage.]), + [#include "src/have.h"] +) + dnl Checks for library functions. AC_TYPE_SIGNAL AC_CHECK_FUNCS([asprintf fchmod fork get_current_dir_name gettimeofday random select strdup strerror time usleep], diff --git a/src/meshlink.c b/src/meshlink.c index 0799c4d7..e84aafca 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -1880,9 +1880,7 @@ meshlink_edge_t **meshlink_get_all_edges_state(meshlink_handle_t *mesh, meshlink } copy->from = (meshlink_node_t*)e->from; copy->to = (meshlink_node_t*)e->to; -#ifdef HAVE_STRUCT_SOCKADDR_STORAGE copy->address = e->address.storage; -#endif copy->options = e->options; copy->weight = e->weight; *p++ = copy; diff --git a/src/meshlink.h b/src/meshlink.h index 4b240429..6f104abe 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -110,9 +110,7 @@ struct meshlink_edge { // owned by meshlink and should not be // deallocated. Node contents may be // changed by meshlink. -#ifdef HAVE_STRUCT_SOCKADDR_STORAGE struct sockaddr_storage address;///< The address information associated -#endif // with this edge. uint32_t options; ///< Edge options. @TODO what are edge options? int weight; ///< Weight assigned to this edge. diff --git a/src/sockaddr.h b/src/sockaddr.h index 255dc830..775f81f6 100644 --- a/src/sockaddr.h +++ b/src/sockaddr.h @@ -22,9 +22,7 @@ typedef union sockaddr_t { struct sockaddr_in in; struct sockaddr_in6 in6; struct sockaddr_unknown unknown; -#ifdef HAVE_STRUCT_SOCKADDR_STORAGE struct sockaddr_storage storage; -#endif } sockaddr_t; #endif // SOCKADDR_H -- 2.39.5