Always call res_init() before getaddrinfo().
authorGuus Sliepen <guus@tinc-vpn.org>
Sun, 12 Apr 2015 13:42:48 +0000 (15:42 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 12 Apr 2015 13:42:48 +0000 (15:42 +0200)
Unfortunately, glibc assumes that /etc/resolv.conf is a static file that
never changes. Even on servers, /etc/resolv.conf might be a dynamically
generated file, and we never know when it changes. So just call
res_init() every time, so glibc uses up-to-date nameserver information.

Conflicts:
src/have.h
src/net.c
src/net_setup.c

1  2 
doc/tinc.conf.5.in
doc/tinc.texi
src/net_packet.c
src/net_setup.c

@@@ -500,14 -500,14 +500,16 @@@ The minimum amount of time between send
  .It Va UDPDiscoveryTimeout Li = Ar seconds Pq 30
  If tinc doesn't receive any UDP ping replies over the specified interval,
  it will assume UDP communication is broken and will fall back to TCP.
- .It Va UDPRcvBuf Li = Ar bytes Pq OS default
 +.It Va UDPInfoInterval Li = Ar seconds Pq 5
 +The minimum amount of time between sending periodic updates about UDP addresses, which are mostly useful for UDP hole punching.
+ .It Va UDPRcvBuf Li = Ar bytes Pq 1048576
  Sets the socket receive buffer size for the UDP socket, in bytes.
- If unset, the default buffer size will be used by the operating system.
- .It Va UDPSndBuf Li = Ar bytes Pq OS default
+ If set to zero, the default buffer size will be used by the operating system.
+ Note: this setting can have a significant impact on performance, especially raw throughput.
+ .It Va UDPSndBuf Li = Ar bytes Pq 1048576
  Sets the socket send buffer size for the UDP socket, in bytes.
- If unset, the default buffer size will be used by the operating system.
+ If set to zero, the default buffer size will be used by the operating system.
+ Note: this setting can have a significant impact on performance, especially raw throughput.
  .El
  .Sh HOST CONFIGURATION FILES
  The host configuration files contain all information needed
diff --cc doc/tinc.texi
@@@ -1253,19 -1253,17 +1253,21 @@@ The minimum amount of time between send
  If tinc doesn't receive any UDP ping replies over the specified interval,
  it will assume UDP communication is broken and will fall back to TCP.
  
 +@cindex UDPInfoInterval
 +@item UDPInfoInterval = <seconds> (5)
 +The minimum amount of time between sending periodic updates about UDP addresses, which are mostly useful for UDP hole punching.
 +
  @cindex UDPRcvBuf
- @item UDPRcvBuf = <bytes> (OS default)
+ @item UDPRcvBuf = <bytes> (1048576)
  Sets the socket receive buffer size for the UDP socket, in bytes.
- If unset, the default buffer size will be used by the operating system.
+ If set to zero, the default buffer size will be used by the operating system.
+ Note: this setting can have a significant impact on performance, especially raw throughput.
  
  @cindex UDPSndBuf
- @item UDPSndBuf = <bytes> Pq OS default
+ @item UDPSndBuf = <bytes> (1048576)
  Sets the socket send buffer size for the UDP socket, in bytes.
- If unset, the default buffer size will be used by the operating system.
+ If set to zero, the default buffer size will be used by the operating system.
+ Note: this setting can have a significant impact on performance, especially raw throughput.
  
  @end table
  
Simple merge
diff --cc src/net_setup.c
Simple merge