From owner-freebsd-arch@FreeBSD.ORG Mon Mar 30 15:04:05 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F9C1065673 for ; Mon, 30 Mar 2009 15:04:05 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from skerryvore.cs.uoguelph.ca (skerryvore.cs.uoguelph.ca [131.104.94.204]) by mx1.freebsd.org (Postfix) with ESMTP id 0EE788FC08 for ; Mon, 30 Mar 2009 15:04:04 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by skerryvore.cs.uoguelph.ca (8.13.1/8.13.1) with ESMTP id n2UF43B9020374 for ; Mon, 30 Mar 2009 11:04:04 -0400 Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n2UF9tm15770 for ; Mon, 30 Mar 2009 11:09:55 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Mon, 30 Mar 2009 11:09:55 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: freebsd-arch@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Scanned-By: MIMEDefang 2.63 on 131.104.94.204 Subject: Unique machine identifier for nfsv4 client X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2009 15:04:05 -0000 An nfsv4 client needs a unique identifier that is persistent across reboots. My code currently uses the MAC address of the first net interface that it can find that has an Ethernet style MAC. There are two problems with this: 1 - If it can't find a net interface with a MAC, it falls back on a randomly generated identifier, which changes when it is rebooted. 2 - The code that finds the MAC breaks layering (ie knows stuff about the network code like struct ifnet) and only builds if "options VIMAGE_GLOBALS" is set. Can anyone suggest a better way to do this? If not, would it be reasonable to put a function in sys/net that returns a MAC address if it can find one? (At least this gets around the "options VIMAGE_GLOBALS" issue.) Thanks in advance for any help, rick