Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/auto
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2017-04-11 16:41:53 +0300
committerRoman Arutyunyan <arut@nginx.com>2017-04-11 16:41:53 +0300
commit05841adfb2e5d50dee066b6f92cbb95b78c5b725 (patch)
tree5c719a5c7ae8d897244cfa94639cf65337342fba /auto
parent62b20ce87ae9dda51010742523ccad9650380f11 (diff)
Set UDP datagram source address (ticket #1239).
Previously, the source IP address of a response UDP datagram could differ from the original datagram destination address. This could happen if the server UDP socket is bound to a wildcard address and the network interface chosen to output the response packet has a different default address than the destination address of the original packet. For example, if two addresses from the same network are configured on an interface. Now source address is set explicitly if a response is sent for a server UDP socket bound to a wildcard address.
Diffstat (limited to 'auto')
-rw-r--r--auto/unix13
1 files changed, 13 insertions, 0 deletions
diff --git a/auto/unix b/auto/unix
index 5ef74d4a8..52060fc04 100644
--- a/auto/unix
+++ b/auto/unix
@@ -394,6 +394,19 @@ ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_RECVDSTADDR, NULL, 0)"
. auto/feature
+# BSD way to set IPv4 datagram source address
+
+ngx_feature="IP_SENDSRCADDR"
+ngx_feature_name="NGX_HAVE_IP_SENDSRCADDR"
+ngx_feature_run=no
+ngx_feature_incs="#include <sys/socket.h>
+ #include <netinet/in.h>"
+ngx_feature_path=
+ngx_feature_libs=
+ngx_feature_test="setsockopt(0, IPPROTO_IP, IP_SENDSRCADDR, NULL, 0)"
+. auto/feature
+
+
# Linux way to get IPv4 datagram destination address
ngx_feature="IP_PKTINFO"