What's the best what to test the status of an Ethernet interface 
programmatically? We've been using this code similar to this:

struct ifmediareq ifmr;
memset(&ifmr, 0, sizeof(ifmr));
strcpy(ifmr.ifm_name, "nfe0");
ioctl(sockfd, SIOCGIFMEDIA, (caddr_t)&ifmr)

and then checking the value of ifmr.ifm_status & IFM_ACTIVE. We've found that 
every once in a while this code will return a false positive, indicating that 
the interface has gone offline when in fact it has not.

So, is there a more reliable call to test if an Ethernet interface has gone 
offline?
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to