No longer exits if it can't find IP or MAC address.
This commit is contained in:
2
iftop.c
2
iftop.c
@@ -447,7 +447,6 @@ void packet_init() {
|
|||||||
if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) {
|
if (ioctl(s, SIOCGIFHWADDR, &ifr) < 0) {
|
||||||
fprintf(stderr, "Error getting hardware address for interface: %s\n", options.interface);
|
fprintf(stderr, "Error getting hardware address for interface: %s\n", options.interface);
|
||||||
perror("ioctl(SIOCGIFHWADDR)");
|
perror("ioctl(SIOCGIFHWADDR)");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
memcpy(if_hw_addr, ifr.ifr_hwaddr.sa_data, 6);
|
memcpy(if_hw_addr, ifr.ifr_hwaddr.sa_data, 6);
|
||||||
@@ -470,7 +469,6 @@ void packet_init() {
|
|||||||
if (ioctl(s, SIOCGIFADDR, &ifr) < 0) {
|
if (ioctl(s, SIOCGIFADDR, &ifr) < 0) {
|
||||||
fprintf(stderr, "Error getting IP address for interface: %s\n", options.interface);
|
fprintf(stderr, "Error getting IP address for interface: %s\n", options.interface);
|
||||||
perror("ioctl(SIOCGIFADDR)");
|
perror("ioctl(SIOCGIFADDR)");
|
||||||
exit(1);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
have_ip_addr = 1;
|
have_ip_addr = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user