diff options
author | chris <> | 2003-02-06 10:51:24 +0000 |
---|---|---|
committer | chris <> | 2003-02-06 10:51:24 +0000 |
commit | 2dc4a06dda004862b5718a6d5ad0c0373558dc1a (patch) | |
tree | 5d94b350445ac019c9ff6e6be5bf49b2f807c30b /iftop.c | |
parent | 5058cf3bc5934ef4080b5ef422f4a24b49db4a42 (diff) | |
download | iftop-2dc4a06dda004862b5718a6d5ad0c0373558dc1a.zip |
""
Diffstat (limited to 'iftop.c')
-rw-r--r-- | iftop.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -417,7 +417,7 @@ void packet_init() { } strncpy(ifr.ifr_name, options.interface, IFNAMSIZ); ifr.ifr_hwaddr.sa_family = AF_UNSPEC; - if (ioctl(s, SIOCGIFHWADDR, &ifr) == -1) { + if (ioctl(s, SIOCGIFADDR, &ifr) == -1) { fprintf(stderr, "Error getting hardware address for interface: %s\n", options.interface); perror("ioctl(SIOCGIFHWADDR)"); exit(1); @@ -428,6 +428,8 @@ void packet_init() { for (s = 0; s < 6; ++s) fprintf(stderr, "%c%02x", s ? ':' : ' ', (unsigned int)if_hw_addr[s]); fprintf(stderr, "\n"); + + fprintf(stderr, "IP address is: %s", inet_ntoa(((struct sockaddr_in*)&ifr.ifr_addr)->sin_addr)); resolver_initialise(); |