From owner-freebsd-stable@FreeBSD.ORG Mon Nov 4 17:10:03 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A0BCFF43; Mon, 4 Nov 2013 17:10:03 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email2.allantgroup.com (email2.emsphone.com [199.67.51.116]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 667E0243E; Mon, 4 Nov 2013 17:10:02 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [172.17.17.101]) by email2.allantgroup.com (8.14.5/8.14.5) with ESMTP id rA4H9tSu095479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Nov 2013 11:09:55 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.7/8.14.6) with ESMTP id rA4H9tSl033160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 4 Nov 2013 11:09:55 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.7/8.14.7/Submit) id rA4H9tPA033157; Mon, 4 Nov 2013 11:09:55 -0600 (CST) (envelope-from dan) Date: Mon, 4 Nov 2013 11:09:55 -0600 From: Dan Nelson To: Aryeh Friedman Subject: Re: how is the MAC for tap(4) computed? Message-ID: <20131104170955.GH63947@dan.emsphone.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.1-STABLE User-Agent: Mutt/1.5.22 (2013-10-16) X-Virus-Scanned: clamav-milter 0.98 at email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (email2.allantgroup.com [172.17.19.78]); Mon, 04 Nov 2013 11:09:55 -0600 (CST) X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on email2.allantgroup.com X-Scanned-By: MIMEDefang 2.73 Cc: FreeBSD Stable List , "freebsd-virtualization@freebsd.org" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2013 17:10:03 -0000 In the last episode (Nov 04), Aryeh Friedman said: > There seems to be a very high rate of MAC address collisions when tap is > running on different machines.... is there anyway to make the selection > of MAC more random It looks like it's generated based on the number of ticks since boot, plus the unit number of the tap device: http://fxr.watson.org/fxr/source/net/if_tap.c#L434 So if you have devices created on boot on a bunch of machines, chances are high that you'll get conflicts. Maybe instead of using the 'ticks' value, kern.hostid could be used instead? That has much better randomness than 'ticks'. -- Dan Nelson dnelson@allantgroup.com