make minihttptestserver listen on loopback interface instead of 0.0.0.0
This commit is contained in:
parent
2665ed123b
commit
45b845009f
|
@ -1,6 +1,9 @@
|
||||||
$Id: Changelog.txt,v 1.161 2012/01/25 21:24:02 nanard Exp $
|
$Id: Changelog.txt,v 1.162 2012/03/08 10:02:49 nanard Exp $
|
||||||
miniUPnP client Changelog.
|
miniUPnP client Changelog.
|
||||||
|
|
||||||
|
2012/03/08:
|
||||||
|
make minihttptestserver listen on loopback interface instead of 0.0.0.0
|
||||||
|
|
||||||
2012/01/25:
|
2012/01/25:
|
||||||
Maven installation thanks to Alexey Kuznetsov
|
Maven installation thanks to Alexey Kuznetsov
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: minihttptestserver.c,v 1.6 2011/05/09 08:53:15 nanard Exp $ */
|
/* $Id: minihttptestserver.c,v 1.7 2012/03/08 10:02:49 nanard Exp $ */
|
||||||
/* Project : miniUPnP
|
/* Project : miniUPnP
|
||||||
* Author : Thomas Bernard
|
* Author : Thomas Bernard
|
||||||
* Copyright (c) 2011 Thomas Bernard
|
* Copyright (c) 2011 Thomas Bernard
|
||||||
|
@ -360,12 +360,12 @@ int main(int argc, char * * argv) {
|
||||||
struct sockaddr_in6 * addr = (struct sockaddr_in6 *)&server_addr;
|
struct sockaddr_in6 * addr = (struct sockaddr_in6 *)&server_addr;
|
||||||
addr->sin6_family = AF_INET6;
|
addr->sin6_family = AF_INET6;
|
||||||
addr->sin6_port = htons(port);
|
addr->sin6_port = htons(port);
|
||||||
addr->sin6_addr = in6addr_any;
|
addr->sin6_addr = in6addr_loopback;
|
||||||
} else {
|
} else {
|
||||||
struct sockaddr_in * addr = (struct sockaddr_in *)&server_addr;
|
struct sockaddr_in * addr = (struct sockaddr_in *)&server_addr;
|
||||||
addr->sin_family = AF_INET;
|
addr->sin_family = AF_INET;
|
||||||
addr->sin_port = htons(port);
|
addr->sin_port = htons(port);
|
||||||
addr->sin_addr.s_addr = htonl(INADDR_ANY);
|
addr->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||||
}
|
}
|
||||||
if(bind(s, (struct sockaddr *)&server_addr,
|
if(bind(s, (struct sockaddr *)&server_addr,
|
||||||
ipv6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in)) < 0) {
|
ipv6 ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in)) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue