X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet.h;h=ea1657be881e4d17d9ab4a55e4f111b33a1ebd3e;hp=1100071a5c012ba4d595d4e6c1970e74be0b7df1;hb=23fda5688e8a109f8a50511538b14e4fbe4f738c;hpb=c2b9c06062d36bde859b630b99a08c7b7428e721 diff --git a/src/net.h b/src/net.h index 1100071a..ea1657be 100644 --- a/src/net.h +++ b/src/net.h @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: net.h,v 1.9.4.39 2002/02/18 16:25:16 guus Exp $ + $Id: net.h,v 1.9.4.41 2002/02/20 22:37:38 guus Exp $ */ #ifndef __TINC_NET_H__ @@ -65,7 +65,11 @@ typedef union { struct sockaddr_in6 in6; } sockaddr_t; -#define SA_PORT(s) ((s.sa.sa_family==AF_INET)?s.in.sin_port:(s.sa.sa_family==AF_INET6)?s.in6.sin6_port:0) +#ifdef HAVE_LINUX + #define SALEN(s) sizeof(sockaddr_t) +#else + #define SALEN(s) (s.sa_len) +#endif typedef struct vpn_packet_t { length_t len; /* the actual number of bytes in the `data' field */