X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fnet.h;h=df43197940ad51bcbeda9e55b26ef8122e64bab1;hp=5f3e2a8744a0dce7ec9f178e61d9de99052d59c7;hb=2ac7be0d51a112108dc6c2b1c6f46da022f72f40;hpb=dbc5b5bb5eb3096ad930aa6b590deaba2a103dfc diff --git a/src/net.h b/src/net.h index 5f3e2a87..df431979 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.40 2002/02/20 22:15:32 guus Exp $ + $Id: net.h,v 1.9.4.42 2002/02/26 22:47:51 guus Exp $ */ #ifndef __TINC_NET_H__ @@ -65,12 +65,10 @@ 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 SA_LEN(s) sizeof(sockaddr_t) +#ifdef SA_LEN +#define SALEN(s) SA_LEN(&s) #else - #define SA_LEN(s) (s.sa_len) +#define SALEN(s) (s.sa_family==AF_INET?sizeof(struct sockaddr_in):sizeof(struct sockaddr_in6)) #endif typedef struct vpn_packet_t {