From fcbf0bdd843acab00443238aedf908c132270f8f Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sat, 5 Apr 2008 15:10:50 +0000 Subject: [PATCH] I hope this makes the code work on solaris, too and fix the EINVAL on sendto() --- code/qcommon/net_ip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c index 41918e91..5c66f80b 100644 --- a/code/qcommon/net_ip.c +++ b/code/qcommon/net_ip.c @@ -550,9 +550,9 @@ void Sys_SendPacket( int length, const void *data, netadr_t to ) { } else { if(addr.ss_family == AF_INET) - ret = sendto( ip_socket, data, length, 0, (struct sockaddr *) &addr, sizeof(addr) ); - else - ret = sendto( ip6_socket, data, length, 0, (struct sockaddr *) &addr, sizeof(addr) ); + ret = sendto( ip_socket, data, length, 0, (struct sockaddr *) &addr, sizeof(struct sockaddr_in) ); + else if(addr.ss_family == AF_INET6) + ret = sendto( ip6_socket, data, length, 0, (struct sockaddr *) &addr, sizeof(struct sockaddr_in6) ); } if( ret == SOCKET_ERROR ) { int err = socketError;