Given a filedescriptor, how can I find source IP??

Joe Porkka jap at convex.cl.msu.edu
Sat Mar 23 14:18:24 AEST 1991


jap at convex.cl.msu.edu (Joe Porkka) writes:

>Well, the subject says it all...

>On a SUN, I am trying to track down the address of the machine
>that telneted to me. The reason is that I want to be able
>to open another connection going back the other way.


>Any ideas???

Remember boys and girls, "getpeername()" only works on sockets.
I guess I was not clear - the program does not open a socket -
it inherits some filedescriptors (0 1 and 2).

Sombody already suggested that I place a program between inetd
and telnetd, but I was hoping to not have to resort to such
yuck - I would rather not modify the system.



More information about the Comp.unix.wizards mailing list