Fix tap device counting.
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 28 May 2007 02:29:59 +0000 (02:29 +0000)
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 28 May 2007 02:29:59 +0000 (02:29 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2884 c046a42c-6fe2-441c-8c8c-71466251a162

vl.c

diff --git a/vl.c b/vl.c
index 61c6c1a01322db4d8796f332b1d262c5e31d0049..c949a4752e602945b136a3ee1e5a24263dd80c37 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -4229,6 +4229,7 @@ static int net_client_init(const char *str)
         char ifname[64];
         char setup_script[1024];
         int fd;
+        vlan->nb_host_devs++;
         if (get_param_value(buf, sizeof(buf), "fd", p) > 0) {
             fd = strtol(buf, NULL, 0);
             ret = -1;
@@ -4241,7 +4242,6 @@ static int net_client_init(const char *str)
             if (get_param_value(setup_script, sizeof(setup_script), "script", p) == 0) {
                 pstrcpy(setup_script, sizeof(setup_script), DEFAULT_NETWORK_SCRIPT);
             }
-            vlan->nb_host_devs++;
             ret = net_tap_init(vlan, ifname, setup_script);
         }
     } else