فهرست منبع

NCDInterfaceMonitor: don't rely on interface flags provided from netlink; instead, query them
manually. Fixes an issue when a wireless device is pulled out and the device is reported to be down
and then again up, incorrectly.

ambrop7 15 سال پیش
والد
کامیت
a93bfbaf07
1فایلهای تغییر یافته به همراه1 افزوده شده و 11 حذف شده
  1. 1 11
      ncd/NCDInterfaceMonitor.c

+ 1 - 11
ncd/NCDInterfaceMonitor.c

@@ -84,16 +84,6 @@ void process_buffer (NCDInterfaceMonitor *o)
         }
         struct ifinfomsg *im = (void *)pl;
         
-        int report_flags = 0;
-        
-        if (o->buf_nh->nlmsg_type == RTM_NEWLINK) {
-            report_flags |= NCDIFCONFIG_FLAG_EXISTS;
-            
-            if ((im->ifi_flags&IFF_RUNNING)) {
-                report_flags |= NCDIFCONFIG_FLAG_RUNNING;
-            }
-        }
-        
         // parse attributes to get interface name
         
         char *ifname = NULL;
@@ -117,7 +107,7 @@ void process_buffer (NCDInterfaceMonitor *o)
         BPending_Set(&o->more_job);
         
         // dispatch event
-        o->handler(o->user, ifname, report_flags);
+        o->handler(o->user, ifname, NCDIfConfig_query(ifname));
         return;
     }