Hi, Bit of a low level question, again probably one for Krisztian. One of our developers is trying to ascertain what the original peer addresses are on a tproxy socket. In the code snippet below, he prints out the original source and destination addresses. However they are always zero. Does anybody know the correct way of doing this? We are still using cttproxy-2.4.25-1.9.3.
Here's the code sample
struct in_origaddrs orig; ... ... if ( getsockopt(fd, SOL_IP, IP_ORIGADDRS, &orig, &orig_len) ) { debug(5, 1) ("commConnectStart: Couldn't get original address for fd\n"); } else { debug(5, 1) ("commConnectStart: FD = %d\n", fd); debug(5, 1) ("commConnectStart: Original source address is %s\n", inet_ntoa(orig.ioa_srcaddr)); debug(5, 1) ("commConnectStart: Original destination address is %s\n", inet_ntoa(orig.ioa_dstaddr)); }
Regards, Andrew Ivins System Administrator Swiftel Communications (08) 9480 1233