summaryrefslogtreecommitdiff
path: root/emulators/qemu-devel/files/patch-tapclose
blob: d4a27c268197f495ceb84be0f1019b5c8980fda5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Index: qemu/net/tap.c
@@ -286,12 +286,13 @@ static void tap_cleanup(NetClientState *
 
     qemu_purge_queued_packets(nc);
 
-    if (s->down_script[0])
-        launch_script(s->down_script, s->down_script_arg, s->fd);
-
     tap_read_poll(s, false);
     tap_write_poll(s, false);
     close(s->fd);
+
+    if (s->down_script[0])
+        launch_script(s->down_script, s->down_script_arg, s->fd);
+
     s->fd = -1;
 }