- if (ioctl(af_inet_sock, SIOCGIFHWADDR, &ifr) < 0) {
- /* ENODEV probably means that a vif disappeared asynchronously and
- * hasn't been removed from the database yet, so reduce the log level
- * to INFO for that case. */
- VLOG(errno == ENODEV ? VLL_INFO : VLL_ERR,
- "ioctl(SIOCGIFHWADDR) on %s device failed: %s",
- dev->real_name, strerror(errno));
- return errno;
+ error = af_inet_ifreq_ioctl(dev->real_name, &ifr,
+ SIOCGIFHWADDR, "SIOCGIFHWADDR");
+ if (error) {
+ return error;