Determining one's own IP address.

Dave Mielke davem at bmers58.UUCP
Fri Dec 15 03:25:22 AEST 1989


I thank you all for your responses and mail. The solution that works,
i.e. the one which yields the local IP address without looking in the
hosts file or yp is as follows:
     
    struct sockaddr_in address;
    get_myaddress(&address);
    return address.sin_addr;



More information about the Comp.unix.wizards mailing list