freebsd 6.1 SIOCGIFMEDIA on rl0 no longer works

Stephen Clark Stephen.Clark at seclark.us
Thu Aug 17 14:36:10 UTC 2006


Hello list,

We have been running 4.9 and using freevrrpd 0.9.3, which worked great,
- the latest in the ports tree. We are switching
to 6.1 released and we now get the the following error from freevrrpd:
freevrrpd[6241]: cannot do ioctl, intertface is faulty: Device not
configured

This is a bogus message since the interface is configured up and running.
What changed in 6.1 to cause this?

The message comes from the following code in freevrrpd:

int vrrp_moncircuit_interface_status(int sd, char *if_name)
{
     struct ifmediareq ifmr;

     if (sd < 0) {
         syslog(LOG_ERR, "socket descriptor must be != -1");
         return -1;
     }
     bzero(&ifmr, sizeof(ifmr));
     strncpy(ifmr.ifm_name, if_name, sizeof(ifmr.ifm_name));

     if (ioctl(sd, SIOCGIFMEDIA, (caddr_t)&ifmr) < 0) {
         if (errno == EINVAL) {
             syslog(LOG_ERR, "your NIC doesn't support SIOCGIFMEDIA
ioctl: %s", strerror(errno));
             return -3;
         }
         else
             syslog(LOG_ERR, "cannot do ioctl, intertface is faulty: %s",
strerror(errno));
         return -2;
     }

     if (ifmr.ifm_status & IFM_AVALID) {
         if (ifmr.ifm_status & IFM_ACTIVE)
             return 1;
         else
             return 0;
     }

     /* Interface has no carrier cable problem ? */
     return 0;
}

Any help on this would be greatly appreciated.

Thanks,
Steve

-- 

"They that give up essential liberty to obtain temporary safety,
deserve neither liberty nor safety."  (Ben Franklin)

"The course of history shows that as a government grows, liberty
decreases."  (Thomas Jefferson)






More information about the freebsd-stable mailing list