set net_interface_config.type
This commit is contained in:
1 parent
ab3c15d2e7
commit
0e912b962c
2 files changed
+8
No files matched your search
@@ -1637,6 +1637,8 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
|
||||
if (ifconfig->flags & IFF_LOOPBACK) {
|
||||
ifconfig->destination = ifconfig->address;
|
||||
ifconfig->broadcast = 0;
|
||||
SIGAR_SSTRCPY(ifconfig->type,
|
||||
SIGAR_NIC_LOOPBACK);
|
||||
}
|
||||
else {
|
||||
if (!ioctl(sock, SIOCGIFDSTADDR, &ifr)) {
|
||||
@@ -1646,6 +1648,8 @@ int sigar_net_interface_config_get(sigar_t *sigar, const char *name,
|
||||
if (!ioctl(sock, SIOCGIFBRDADDR, &ifr)) {
|
||||
ifconfig->broadcast = ifr_s_addr(ifr);
|
||||
}
|
||||
SIGAR_SSTRCPY(ifconfig->type,
|
||||
SIGAR_NIC_ETHERNET);
|
||||
}
|
||||
|
||||
close(sock);
|
||||
|
||||
@@ -229,9 +229,13 @@ sigar_net_interface_config_get(sigar_t *sigar,
|
||||
#else
|
||||
sigar_hwaddr_set_null(ifconfig);
|
||||
#endif
|
||||
SIGAR_SSTRCPY(ifconfig->type,
|
||||
SIGAR_NIC_LOOPBACK);
|
||||
}
|
||||
else {
|
||||
hwaddr_lookup(ifconfig, i);
|
||||
SIGAR_SSTRCPY(ifconfig->type,
|
||||
SIGAR_NIC_ETHERNET);
|
||||
}
|
||||
if (flags & IFF_POINTTOPOINT) {
|
||||
ifconfig->flags |= SIGAR_IFF_POINTOPOINT;
|
||||
|
||||
Reference in new issue
Block a user