For various reasons, I need to be able to determine the ip address and
port that an RPC request was sent to (though trivial on a machine with
just one network card, if a RPC request is sent to a multi-homed
machine, then determining which network interface received the request
becomes a bit harder, I think.)
So machine A sends say a RPC read request to machine B. Machine B
gets the request and wishes to determine which network interface
received the request. What I do now, to get this information is call
getsockname on the SVCXPRT* parameter of the server side transport
So if svc_req *rqstp is the server side transport handle, I call
getsockname on the socket defined by rqstp->rq_xprt->xp_sock in order
to find the port and ip the RPC packet was sent to on machine B.
Unfortunately, the resulting sock_addr structure gives me an IP of
zero, and a rather interesting port...
Is there a better way of doing this? Please bear with me, as I'm
rather new at all this socket based stuff:(