]> xenbits.xen.org Git - xenclient/toolstack.git/commitdiff
[xenvm] Fix network state propagation when network != "brbridged"
authorTomasz Wroblewski <tomasz.wroblewski@citrix.com>
Thu, 21 Jan 2010 17:02:49 +0000 (17:02 +0000)
committerTomasz Wroblewski <tomasz.wroblewski@citrix.com>
Thu, 21 Jan 2010 17:02:49 +0000 (17:02 +0000)
xenvm/network_manager.ml

index 117a6d2bf2ef756d6ef2fba0ed14e24a950fecbf..8d717fc3ba7df05e9fd319d9f1c7d84d338a33f6 100644 (file)
@@ -81,15 +81,19 @@ let process_signal state xs bus msg =
                  let news = devstate_of_int (Int32.to_int news) in
                  (* previous state *)
                  let olds = devstate_of_int (Int32.to_int olds) in
-                 (* to keep it simple we look the nic by bridge name.. *)
-                 let bridge = get_devintf bus path in
-                 let nics = List.filter (fun n -> n.ns_bridge = bridge) state.vm_nics in
-                 (match nics with
-                 | [nic] -> 
-                           let id = nic.ns_id in
-                           when_conn_changed xs state id news olds
-                 | _     ->
-                           ()
-                 )
+                 let nics =
+                         let intf = get_devintf bus path in
+                         match intf with
+                         | "brbridged" ->
+                                   (* it is wired connection which has changed state *)
+                                   List.find_all (fun n ->
+                                           n.ns_bridge = "brshared"  ||
+                                           n.ns_bridge = "brbridged" ||
+                                           n.ns_bridge = "brinternal") state.vm_nics
+                         | _ ->
+                                   (* it is wireless connection which has changed state *)
+                                   List.find_all (fun n -> n.ns_bridge = "brwireless") state.vm_nics
+                 in
+                 List.iter (fun nic -> when_conn_changed xs state nic.ns_id news olds) nics
        | _ -> ()