maskit commented on code in PR #10212:
URL: https://github.com/apache/trafficserver/pull/10212#discussion_r1298627277
##########
iocore/net/UnixUDPNet.cc:
##########
@@ -1014,8 +1014,8 @@ bool
UDPNetProcessor::CreateUDPSocket(int *resfd, sockaddr const *remote_addr,
Action **status, NetVCOptions const &opt)
{
int res = 0, fd = -1;
- int local_addr_len;
IpEndpoint local_addr;
+ int local_addr_len = sizeof(local_addr.sa);
Review Comment:
I thought so too, but actually initializing it with 0 is wrong.
> getsockname() returns the current address to which the socket
sockfd is bound, in the buffer pointed to by addr. The addrlen
argument should be initialized to indicate the amount of space
(in bytes) pointed to by addr. On return it contains the actual
size of the socket address.
https://man7.org/linux/man-pages/man2/getsockname.2.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]