Fix bug in udp functions

This commit is contained in:
Kirigaya Kazuto 2018-06-06 00:06:54 +08:00
parent 23dbae63e4
commit 8c449dc774

View File

@ -600,7 +600,7 @@ static int convert_ipv46(const std::string& IPStr, int Port,
paddr6->sin6_port = htons(Port); paddr6->sin6_port = htons(Port);
paddr6->sin6_family = AF_INET6; paddr6->sin6_family = AF_INET6;
_out_psockaddr = (sockaddr*)&paddr6; _out_psockaddr = (sockaddr*)paddr6;
_out_szsockaddr = sizeof(sockaddr_in6); _out_szsockaddr = sizeof(sockaddr_in6);
return 1; return 1;
} }
@ -615,7 +615,7 @@ static int convert_ipv46(const std::string& IPStr, int Port,
paddr->sin_port = htons(Port); paddr->sin_port = htons(Port);
paddr->sin_family = AF_INET; paddr->sin_family = AF_INET;
_out_psockaddr = (sockaddr*)&paddr; _out_psockaddr = (sockaddr*)paddr;
_out_szsockaddr = sizeof(sockaddr_in); _out_szsockaddr = sizeof(sockaddr_in);
return 0; return 0;
} }