Skip to content

Commit f63326e

Browse files
committed
try this
1 parent 2c67ba7 commit f63326e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

netcode.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,10 @@ void netcode_socket_set_qos( struct netcode_socket_t * socket, struct netcode_ad
745745
}
746746
socket_address.sin6_port = htons( to->port );
747747

748-
if ( netcode_set_socket_codepoint( socket->handle, QOSTrafficTypeAudioVideo, 0, &socket_address ) != 0 )
748+
sockaddr_storage addr;
749+
memcpy( (char*) &addr, (char*) &socket_address, sizeof(socket_address) );
750+
751+
if ( netcode_set_socket_codepoint( socket->handle, QOSTrafficTypeAudioVideo, 0, &addr ) != 0 )
749752
{
750753
netcode_printf( NETCODE_LOG_LEVEL_ERROR, "error: failed to enable packet tagging (ipv6)\n" );
751754
netcode_socket_destroy( s );
@@ -763,7 +766,10 @@ void netcode_socket_set_qos( struct netcode_socket_t * socket, struct netcode_ad
763766
( ( (uint32_t) to->data.ipv4[3] ) << 24 );
764767
socket_address.sin_port = htons( to->port );
765768

766-
if ( netcode_set_socket_codepoint( socket->handle, QOSTrafficTypeAudioVideo, 0, &socket_address ) != 0 )
769+
sockaddr_storage addr;
770+
memcpy( (char*) &addr, (char*) &socket_address, sizeof(socket_address) );
771+
772+
if ( netcode_set_socket_codepoint( socket->handle, QOSTrafficTypeAudioVideo, 0, &addr ) != 0 )
767773
{
768774
netcode_printf( NETCODE_LOG_LEVEL_ERROR, "error: failed to enable packet tagging (ipv4)\n" );
769775
netcode_socket_destroy( s );

0 commit comments

Comments
 (0)