]> granicus.if.org Git - libtirpc/commit
Try to ensure datagram replies come from the address requests were sent to.
authorOlaf Kirch <okir@suse.de>
Wed, 2 Mar 2011 15:09:24 +0000 (10:09 -0500)
committerSteve Dickson <steved@redhat.com>
Wed, 2 Mar 2011 15:09:24 +0000 (10:09 -0500)
commit74ef3df0236c55185225c62fba34953f2582da72
treeff7daa061a51f23b53bb5f1e6781ecaa552808ff
parent9bdcba10aa67ce3f67810c7aaac944a00dcfcee5
Try to ensure datagram replies come from the address requests were sent to.

On multi-homed servers it is currently possible for a reply to be sent
from a different address to the one the request was received from.  This
is because there is no strong connection between the request and the
reply as there is with stream.

This causes problems with some clients, particularly those that uses
connected datagram sockets.

So use IP_PKTINFO or IP6_PKTINFO to create the necessary connection,
recording the destination of the request, and setting the source of
the reply.

Note that we clear the interface index (ifindex) as it is not necessary
(and is sometimes wrong) to set the reply out on the same interface that
the request arrived on.

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
src/svc_dg.c
tirpc/rpc/svc_dg.h