From owner-freebsd-net@FreeBSD.ORG Tue Apr 15 06:40:40 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 AFCD9106564A for ; Tue, 15 Apr 2008 06:40:40 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 82D608FC20 for ; Tue, 15 Apr 2008 06:40:40 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id 3471FEDDEA; Tue, 15 Apr 2008 02:40:40 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 15 Apr 2008 02:40:40 -0400 X-Sasl-enc: 2mW1NyC4SIRUU84Hb8a3lFYW3jCody75c9d5wi7551ER 1208241639 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id A130D1B898; Tue, 15 Apr 2008 02:40:39 -0400 (EDT) Message-ID: <48044DE6.8070600@FreeBSD.org> Date: Tue, 15 Apr 2008 07:40:38 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.12 (X11/20080405) MIME-Version: 1.0 To: Maksim Yevmenkin References: <200804141033.35918.marc.loerner@hob.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, =?ISO-8859-1?Q?Marc_L=F6rner?= Subject: Re: 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: Tue, 15 Apr 2008 06:40:40 -0000 Maksim Yevmenkin wrote: > please try the following patch. if there is no objections, i will commit it > > beetle# diff -u if_tap.c.orig if_tap.c > --- if_tap.c.orig 2007-04-05 10:58:39.000000000 -0700 > +++ if_tap.c 2008-04-14 09:42:42.000000000 -0700 > @@ -404,6 +404,7 @@ > struct ifnet *ifp = NULL; > struct tap_softc *tp = NULL; > unsigned short macaddr_hi; > + uint32_t macaddr_mid; > int unit, s; > char *name = NULL; > u_char eaddr[6]; > @@ -432,8 +433,9 @@ > > /* generate fake MAC address: 00 bd xx xx xx unit_no */ > macaddr_hi = htons(0x00bd); > + macaddr_mid = (uint32_t) ticks; > bcopy(&macaddr_hi, eaddr, sizeof(short)); > - bcopy(&ticks, &eaddr[2], sizeof(long)); > + bcopy(&macaddr_mid, &eaddr[2], sizeof(uint32_t)); > eaddr[5] = (u_char)unit; > > /* fill the rest and attach interface */ > This patch looks good, please commit. [Unless of course we want the autogenerated MAC to be deterministic for some reason, but given that it comes from a timer, there's not much point in fixing the endianness...] cheers BMS