From 8c449dc774509d8e3971bc9bf7660e2a586946c5 Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Wed, 6 Jun 2018 00:06:54 +0800 Subject: [PATCH] Fix bug in udp functions --- gsock.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gsock.cpp b/gsock.cpp index 469f42c..60cd593 100644 --- a/gsock.cpp +++ b/gsock.cpp @@ -600,7 +600,7 @@ static int convert_ipv46(const std::string& IPStr, int Port, paddr6->sin6_port = htons(Port); paddr6->sin6_family = AF_INET6; - _out_psockaddr = (sockaddr*)&paddr6; + _out_psockaddr = (sockaddr*)paddr6; _out_szsockaddr = sizeof(sockaddr_in6); return 1; } @@ -615,7 +615,7 @@ static int convert_ipv46(const std::string& IPStr, int Port, paddr->sin_port = htons(Port); paddr->sin_family = AF_INET; - _out_psockaddr = (sockaddr*)&paddr; + _out_psockaddr = (sockaddr*)paddr; _out_szsockaddr = sizeof(sockaddr_in); return 0; }