Set reply source IP from query destination IP

Currently, on multihomed host, when chrony is not bound to a specific
IP address, a query is sent to an interface and the default source IP
hint for the back route differs, the reply will have a source IP
different than where the query was destinied to. This will cause
problems because connection tracking firewalls will drop the replies
and most likely the client program will get confused too.

This patch uses the IP_PKTINFO mechanism to get the IP address where
received packets where targetted to and use that IP address as source
hint when sending a reply.
This commit is contained in:
Timo Teras
2009-08-07 16:26:15 +02:00
committed by Miroslav Lichvar
parent d87cddd6a5
commit 0666d04ab2
5 changed files with 49 additions and 2 deletions

View File

@@ -35,6 +35,7 @@
number. Both parts are in HOST order, NOT network order. */
typedef struct {
unsigned long ip_addr;
unsigned long local_ip_addr;
unsigned short port;
} NTP_Remote_Address;