This commit is contained in:
bol-van 2021-03-07 16:59:53 +03:00
parent 2fe4de5aed
commit 6d5090b11e

View File

@ -505,9 +505,9 @@ static bool find_listen_addr(struct sockaddr_storage *salisten, const char *bind
if (getifaddrs(&addrs)<0) if (getifaddrs(&addrs)<0)
return false; return false;
// ipv6 preference order // for ipv6 preference order
// bindll=1 : link-local // bind-linklocal-1 : link-local,any
// bindll=0 : private,global,link-local // bind-linklocal=0 : private,global,link-local
for(int pass=0;pass<3;pass++) for(int pass=0;pass<3;pass++)
{ {
a = addrs; a = addrs;
@ -851,7 +851,7 @@ int main(int argc, char *argv[])
{ {
// in linux strange behaviour was observed // in linux strange behaviour was observed
// just after ifup and address assignment there's short window when bind() can't bind to addresses got from getifaddrs() // just after ifup and address assignment there's short window when bind() can't bind to addresses got from getifaddrs()
// it does not happen to transparent sockets because they cant bind to any non-existend ip // it does not happen to transparent sockets because they can bind to any non-existend ip
// also only ipv6 seem to be buggy this way // also only ipv6 seem to be buggy this way
if (errno==EADDRNOTAVAIL && params.proxy_type!=CONN_TYPE_TRANSPARENT && list[i].bind_wait_ip_left) if (errno==EADDRNOTAVAIL && params.proxy_type!=CONN_TYPE_TRANSPARENT && list[i].bind_wait_ip_left)
{ {