source: packages/net/tinyproxy/patches/120-fix_INET6.patch @ 19319

Last change on this file since 19319 was 19319, checked in by jow, 6 years ago

[packages] tinyproxy: update to v1.8.0 (#6563)

File size: 1.6 KB
  • src/sock.c

    a b  
    3939 * returned if the bind succeeded.  Otherwise, -1 is returned 
    4040 * to indicate an error. 
    4141 */ 
    42 static int 
    43 bind_socket (int sockfd, const char *addr, int family) 
     42static int bind_socket (int sockfd, const char *addr) 
    4443{ 
    4544        struct addrinfo hints, *res, *ressave; 
    4645 
    bind_socket (int sockfd, const char *addr, int family) 
    4847        assert (addr != NULL && strlen (addr) != 0); 
    4948 
    5049        memset (&hints, 0, sizeof (struct addrinfo)); 
    51         hints.ai_family = family; 
     50        hints.ai_family = AF_UNSPEC; 
    5251        hints.ai_socktype = SOCK_STREAM; 
    5352 
    5453        /* The local port it not important */ 
    int opensock (const char *host, int port, const char *bind_to) 
    106105 
    107106                /* Bind to the specified address */ 
    108107                if (bind_to) { 
    109                         if (bind_socket (sockfd, bind_to, 
    110                                          res->ai_family) < 0) { 
     108                        if (bind_socket (sockfd, bind_to) < 0) { 
    111109                                close (sockfd); 
    112110                                continue;       /* can't bind, so try again */ 
    113111                        } 
    114112                } else if (config.bind_address) { 
    115                         if (bind_socket (sockfd, config.bind_address, 
    116                                          res->ai_family) < 0) { 
     113                        if (bind_socket (sockfd, config.bind_address) < 0) { 
    117114                                close (sockfd); 
    118115                                continue;       /* can't bind, so try again */ 
    119116                        } 
Note: See TracBrowser for help on using the repository browser.