"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/net/os/freebsd/Link.inc" between
monit-5.27.2.tar.gz and monit-5.28.0.tar.gz

About: Monit is a utility for managing and monitoring processes, files, directories and filesystems (with automatic error recovery).

Link.inc  (monit-5.27.2):Link.inc  (monit-5.28.0)
skipping to change at line 39 skipping to change at line 39
* @see http://www.mmonit.com/ * @see http://www.mmonit.com/
* @file * @file
*/ */
static bool _update(T L, const char *interface) { static bool _update(T L, const char *interface) {
for (struct ifaddrs *a = _stats.addrs; a != NULL; a = a->ifa_next) { for (struct ifaddrs *a = _stats.addrs; a != NULL; a = a->ifa_next) {
if (a->ifa_addr == NULL) if (a->ifa_addr == NULL)
continue; continue;
if (Str_isEqual(interface, a->ifa_name) && a->ifa_addr->sa_famil y == AF_LINK) { if (Str_isEqual(interface, a->ifa_name) && a->ifa_addr->sa_famil y == AF_LINK) {
int s = socket(AF_INET, SOCK_DGRAM, 0); int s = socket(AF_INET, SOCK_DGRAM, 0);
if (s > 0) { if (s >= 0) {
struct ifmediareq ifmr; struct ifmediareq ifmr;
memset(&ifmr, 0, sizeof(ifmr)); memset(&ifmr, 0, sizeof(ifmr));
strncpy(ifmr.ifm_name, interface, sizeof(ifmr.if m_name)); strncpy(ifmr.ifm_name, interface, sizeof(ifmr.if m_name) - 1);
// try SIOCGIFMEDIA - if not supported, assume t he interface is UP (loopback or other virtual interface) // try SIOCGIFMEDIA - if not supported, assume t he interface is UP (loopback or other virtual interface)
if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) { if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) {
if (ifmr.ifm_status & IFM_AVALID && ifmr .ifm_status & IFM_ACTIVE) { if (ifmr.ifm_status & IFM_AVALID && ifmr .ifm_status & IFM_ACTIVE) {
L->state = 1LL; L->state = 1LL;
L->duplex = ifmr.ifm_active & 0x 00100000 ? 1LL : 0LL; L->duplex = ifmr.ifm_active & 0x 00100000 ? 1LL : 0LL;
} else { } else {
L->state = 0LL; L->state = 0LL;
L->duplex = -1LL; L->duplex = -1LL;
} }
} else { } else {
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)