Re: (try 2) ws2_32: getsockname should fail for unbound sockets
31 May
2007
31 May
'07
4:09 a.m.
"Damjan Jovanovic" <damjan.jov(a)gmail.com> wrote:
+ case AF_INET6: + { + static const struct sockaddr_in6 emptyAddr; + const struct sockaddr_in6 *in6 = (struct sockaddr_in6*) uaddr; + return in6->sin6_port || memcmp(&in6->sin6_addr, &emptyAddr.sin6_addr, sizeof(struct in6_addr)); + } + case AF_INET: + { + static const struct sockaddr_in emptyAddr; + const struct sockaddr_in *in = (struct sockaddr_in*) uaddr; + return in->sin_port || memcmp(&in->sin_addr, &emptyAddr.sin_addr, sizeof(struct in_addr)); + }
You should add 'const' to the casting if the target you create is 'const'. -- Dmitry.
6860
Age (days ago)
6860
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dmitry Timoshkov