listen.c: fix shadow warning here
git-svn-id: https://svn.musicpd.org/mpd/trunk@7182 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
parent
77e3283973
commit
5915fe55c0
16
src/listen.c
16
src/listen.c
|
@ -124,7 +124,7 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param)
|
||||||
{
|
{
|
||||||
struct sockaddr *addrp;
|
struct sockaddr *addrp;
|
||||||
socklen_t addrlen;
|
socklen_t addrlen;
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin4;
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
struct sockaddr_in6 sin6;
|
struct sockaddr_in6 sin6;
|
||||||
int useIpv6 = ipv6Supported();
|
int useIpv6 = ipv6Supported();
|
||||||
|
@ -133,9 +133,9 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param)
|
||||||
sin6.sin6_port = htons(port);
|
sin6.sin6_port = htons(port);
|
||||||
sin6.sin6_family = AF_INET6;
|
sin6.sin6_family = AF_INET6;
|
||||||
#endif
|
#endif
|
||||||
memset(&sin, 0, sizeof(struct sockaddr_in));
|
memset(&sin4, 0, sizeof(struct sockaddr_in));
|
||||||
sin.sin_port = htons(port);
|
sin4.sin_port = htons(port);
|
||||||
sin.sin_family = AF_INET;
|
sin4.sin_family = AF_INET;
|
||||||
|
|
||||||
if (!param || 0 == strcmp(param->value, "any")) {
|
if (!param || 0 == strcmp(param->value, "any")) {
|
||||||
DEBUG("binding to any address\n");
|
DEBUG("binding to any address\n");
|
||||||
|
@ -148,8 +148,8 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param)
|
||||||
BINDERROR();
|
BINDERROR();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
sin.sin_addr.s_addr = INADDR_ANY;
|
sin4.sin_addr.s_addr = INADDR_ANY;
|
||||||
addrp = (struct sockaddr *)&sin;
|
addrp = (struct sockaddr *)&sin4;
|
||||||
addrlen = sizeof(struct sockaddr_in);
|
addrlen = sizeof(struct sockaddr_in);
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
if ((establishListen(port, addrp, addrlen) < 0) && !useIpv6) {
|
if ((establishListen(port, addrp, addrlen) < 0) && !useIpv6) {
|
||||||
|
@ -180,9 +180,9 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
memcpy((char *)&sin.sin_addr.s_addr,
|
memcpy((char *)&sin4.sin_addr.s_addr,
|
||||||
(char *)he->h_addr, he->h_length);
|
(char *)he->h_addr, he->h_length);
|
||||||
addrp = (struct sockaddr *)&sin;
|
addrp = (struct sockaddr *)&sin4;
|
||||||
addrlen = sizeof(struct sockaddr_in);
|
addrlen = sizeof(struct sockaddr_in);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue