From owner-freebsd-net@FreeBSD.ORG Mon Apr 14 09:02:15 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C07591065670 for ; Mon, 14 Apr 2008 09:02:15 +0000 (UTC) (envelope-from marc.loerner@hob.de) Received: from mailgate.hob.de (mailgate.hob.de [212.185.199.3]) by mx1.freebsd.org (Postfix) with ESMTP id 86D148FC16 for ; Mon, 14 Apr 2008 09:02:15 +0000 (UTC) (envelope-from marc.loerner@hob.de) Received: from imap.hob.de (mail2.hob.de [172.25.1.102]) by mailgate.hob.de (Postfix) with ESMTP id DBE8D164442 for ; Mon, 14 Apr 2008 10:33:44 +0200 (CEST) Received: from [172.22.0.190] (linux03.hob.de [172.22.0.190]) by imap.hob.de (Postfix on SuSE eMail Server 2.0) with ESMTP id 84274FCBBE for ; Mon, 14 Apr 2008 10:33:44 +0200 (CEST) From: Marc =?iso-8859-1?q?L=F6rner?= Organization: hob Date: Mon, 14 Apr 2008 10:33:35 +0200 User-Agent: KMail/1.6.2 To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200804141033.35918.marc.loerner@hob.de> Subject: problem in if_tap.c X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 09:02:15 -0000 Hello, I found the following problem in the if_tap-device code in function tapcreate when used on 64-bit systems: TAPDEBUG("tapcreate(%s%d). minor = %#x\n", name, unit, minor(dev)); /* generate fake MAC address: 00 bd xx xx xx unit_no */ macaddr_hi = htons(0x00bd); bcopy(&macaddr_hi, eaddr, sizeof(short)); ----> bcopy(&ticks, &eaddr[2], sizeof(long)); eaddr[5] = (u_char)unit; /* fill the rest and attach interface */ sizeof(long) is not always 4 on any system (e.g. on ia64 it's 8) => bytes are copied from undefined memory into undefined memory Regards, Marc P.S.: On replies please cc me because I'm not on the list.