diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index d826ad16..6c1334fa 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -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); diff --git a/src/sigar_win32ish.c b/src/sigar_win32ish.c index b7363e71..ec48022c 100644 --- a/src/sigar_win32ish.c +++ b/src/sigar_win32ish.c @@ -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;