mirror of
https://github.com/nmap/nmap.git
synced 2025-12-22 15:39:03 +00:00
Fix up indentation in collect_dnet_interfaces.
This commit is contained in:
21
tcpip.cc
21
tcpip.cc
@@ -2994,11 +2994,12 @@ static int collect_dnet_interfaces(const struct intf_entry *entry, void *arg) {
|
|||||||
/* Make sure we have room for the new route */
|
/* Make sure we have room for the new route */
|
||||||
if (dcrn->numifaces >= dcrn->capacity) {
|
if (dcrn->numifaces >= dcrn->capacity) {
|
||||||
dcrn->capacity <<= 2;
|
dcrn->capacity <<= 2;
|
||||||
dcrn->ifaces = (struct interface_info *) safe_realloc(dcrn->ifaces, dcrn-> capacity * sizeof(struct interface_info));
|
dcrn->ifaces = (struct interface_info *) safe_realloc(dcrn->ifaces,
|
||||||
|
dcrn->capacity * sizeof(struct interface_info));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The first time through the loop we add the primary interface record. After
|
/* The first time through the loop we add the primary interface record.
|
||||||
that we add the aliases one at a time. */
|
After that we add the aliases one at a time. */
|
||||||
if (!primary_done) {
|
if (!primary_done) {
|
||||||
if (entry->intf_addr.addr_type == ADDR_TYPE_IP) {
|
if (entry->intf_addr.addr_type == ADDR_TYPE_IP) {
|
||||||
addr_ntos(&entry->intf_addr, (struct sockaddr *) &dcrn->ifaces[dcrn->numifaces].addr);
|
addr_ntos(&entry->intf_addr, (struct sockaddr *) &dcrn->ifaces[dcrn->numifaces].addr);
|
||||||
@@ -3023,22 +3024,22 @@ static int collect_dnet_interfaces(const struct intf_entry *entry, void *arg) {
|
|||||||
if (entry->intf_type == INTF_TYPE_ETH) {
|
if (entry->intf_type == INTF_TYPE_ETH) {
|
||||||
dcrn->ifaces[dcrn->numifaces].device_type = devt_ethernet;
|
dcrn->ifaces[dcrn->numifaces].device_type = devt_ethernet;
|
||||||
/* Collect the MAC address since this is ethernet */
|
/* Collect the MAC address since this is ethernet */
|
||||||
memcpy(dcrn->ifaces[dcrn->numifaces].mac,
|
memcpy(dcrn->ifaces[dcrn->numifaces].mac, &entry->intf_link_addr.addr_eth.data, 6);
|
||||||
&entry->intf_link_addr.addr_eth.data, 6);
|
} else if (entry->intf_type == INTF_TYPE_LOOPBACK) {
|
||||||
} else if (entry->intf_type == INTF_TYPE_LOOPBACK)
|
|
||||||
dcrn->ifaces[dcrn->numifaces].device_type = devt_loopback;
|
dcrn->ifaces[dcrn->numifaces].device_type = devt_loopback;
|
||||||
else if (entry->intf_type == INTF_TYPE_TUN)
|
} else if (entry->intf_type == INTF_TYPE_TUN) {
|
||||||
dcrn->ifaces[dcrn->numifaces].device_type = devt_p2p;
|
dcrn->ifaces[dcrn->numifaces].device_type = devt_p2p;
|
||||||
else
|
} else {
|
||||||
dcrn->ifaces[dcrn->numifaces].device_type = devt_other;
|
dcrn->ifaces[dcrn->numifaces].device_type = devt_other;
|
||||||
|
}
|
||||||
|
|
||||||
/* Is the interface up and running? */
|
/* Is the interface up and running? */
|
||||||
dcrn->ifaces[dcrn->numifaces].device_up =
|
dcrn->ifaces[dcrn->numifaces].device_up = (entry->intf_flags & INTF_FLAG_UP) ? true : false;
|
||||||
(entry->intf_flags & INTF_FLAG_UP) ? true : false;
|
|
||||||
|
|
||||||
/* For the rest of the information, we must open the interface directly ... */
|
/* For the rest of the information, we must open the interface directly ... */
|
||||||
dcrn->numifaces++;
|
dcrn->numifaces++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user