- Use gai_strerror() where appropriate

- Clear hints before using them with getaddrinfo()
- Use sa_len on platforms that support them
This commit is contained in:
Guus Sliepen 2002-02-20 22:15:32 +00:00
parent 28cc9a6488
commit dbc5b5bb5e
4 changed files with 20 additions and 14 deletions

View file

@ -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.40 2002/02/20 22:15:32 guus Exp $
*/
#ifndef __TINC_NET_H__
@ -67,6 +67,12 @@ typedef union {
#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)
#else
#define SA_LEN(s) (s.sa_len)
#endif
typedef struct vpn_packet_t {
length_t len; /* the actual number of bytes in the `data' field */
unsigned int seqno; /* 32 bits sequence number (network byte order of course) */