From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BHlJ9-0008MX-Qv for qemu-devel@nongnu.org; Sun, 25 Apr 2004 11:12:39 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BHlId-0008KO-4y for qemu-devel@nongnu.org; Sun, 25 Apr 2004 11:12:38 -0400 Received: from [62.210.158.41] (helo=moscou.magic.fr) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHlIc-0008KI-Oc for qemu-devel@nongnu.org; Sun, 25 Apr 2004 11:12:06 -0400 From: "J. Mayer" Content-Type: multipart/mixed; boundary="=-w4rBiVdiI/ZAL0zVWffG" Message-Id: <1082906225.26153.7.camel@rapid> Mime-Version: 1.0 Date: Sun, 25 Apr 2004 17:17:05 +0200 Subject: [Qemu-devel] [BUG] qemu crashes if tun init fails Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --=-w4rBiVdiI/ZAL0zVWffG Content-Type: text/plain Content-Transfer-Encoding: 7bit Attached patch solves the problem. -- J. Mayer Never organized --=-w4rBiVdiI/ZAL0zVWffG Content-Description: Content-Disposition: inline; filename=tun.diff Content-Type: text/x-patch; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Index: vl.c =================================================================== RCS file: /cvsroot/qemu/qemu/vl.c,v retrieving revision 1.61 diff -u -d -w -B -b -d -p -r1.61 vl.c --- vl.c 22 Apr 2004 00:35:09 -0000 1.61 +++ vl.c 25 Apr 2004 15:10:33 -0000 @@ -913,6 +926,9 @@ static int net_tun_init(NetDriverState * char *args[3]; char **parg; + /* Avoid crash if no tun device init fails */ + nd->send_packet = dummy_send_packet; + nd->add_read_packet = dummy_add_read_packet; nd->fd = tun_open(nd->ifname, sizeof(nd->ifname)); if (nd->fd < 0) return -1; --=-w4rBiVdiI/ZAL0zVWffG--