[packages] tinyproxy: update to v1.8.0 (#6563)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@19319 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
38
net/tinyproxy/patches/120-fix_INET6.patch
Normal file
38
net/tinyproxy/patches/120-fix_INET6.patch
Normal file
@ -0,0 +1,38 @@
|
||||
--- a/src/sock.c
|
||||
+++ b/src/sock.c
|
||||
@@ -39,8 +39,7 @@
|
||||
* returned if the bind succeeded. Otherwise, -1 is returned
|
||||
* to indicate an error.
|
||||
*/
|
||||
-static int
|
||||
-bind_socket (int sockfd, const char *addr, int family)
|
||||
+static int bind_socket (int sockfd, const char *addr)
|
||||
{
|
||||
struct addrinfo hints, *res, *ressave;
|
||||
|
||||
@@ -48,7 +47,7 @@ bind_socket (int sockfd, const char *addr, int family)
|
||||
assert (addr != NULL && strlen (addr) != 0);
|
||||
|
||||
memset (&hints, 0, sizeof (struct addrinfo));
|
||||
- hints.ai_family = family;
|
||||
+ hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
|
||||
/* The local port it not important */
|
||||
@@ -106,14 +105,12 @@ int opensock (const char *host, int port, const char *bind_to)
|
||||
|
||||
/* Bind to the specified address */
|
||||
if (bind_to) {
|
||||
- if (bind_socket (sockfd, bind_to,
|
||||
- res->ai_family) < 0) {
|
||||
+ if (bind_socket (sockfd, bind_to) < 0) {
|
||||
close (sockfd);
|
||||
continue; /* can't bind, so try again */
|
||||
}
|
||||
} else if (config.bind_address) {
|
||||
- if (bind_socket (sockfd, config.bind_address,
|
||||
- res->ai_family) < 0) {
|
||||
+ if (bind_socket (sockfd, config.bind_address) < 0) {
|
||||
close (sockfd);
|
||||
continue; /* can't bind, so try again */
|
||||
}
|
Reference in New Issue
Block a user