From owner-cvs-src@FreeBSD.ORG Fri Apr 16 02:07:37 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A65716A4CE; Fri, 16 Apr 2004 02:07:37 -0700 (PDT) Received: from srv01.sparkit.no (srv01.sparkit.no [193.69.116.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BE1043D5A; Fri, 16 Apr 2004 02:07:36 -0700 (PDT) (envelope-from eivind@FreeBSD.org) Received: from ws ([193.69.114.88]) by srv01.sparkit.no (8.12.10/8.12.10) with ESMTP id i3G97UcZ056768; Fri, 16 Apr 2004 11:07:30 +0200 (CEST) (envelope-from eivind@FreeBSD.org) Received: from ws (localhost [127.0.0.1]) by ws (8.12.9/8.12.10) with ESMTP id i3G96Mea001763; Fri, 16 Apr 2004 09:06:22 GMT (envelope-from eivind@ws) Received: (from eivind@localhost) by ws (8.12.9/8.12.10/Submit) id i3G96Mgd001700; Fri, 16 Apr 2004 09:06:22 GMT (envelope-from eivind) Date: Fri, 16 Apr 2004 09:05:20 +0000 From: Eivind Eklund To: Luigi Rizzo Message-ID: <20040416090520.GA1194@FreeBSD.org> References: <200404160814.i3G8EYpj071288@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404160814.i3G8EYpj071288@repoman.freebsd.org> User-Agent: Mutt/1.5.4i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net if.c route.c rtsock.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2004 09:07:37 -0000 On Fri, Apr 16, 2004 at 01:14:34AM -0700, Luigi Rizzo wrote: > luigi 2004/04/16 01:14:34 PDT > > FreeBSD src repository > > Modified files: > sys/net if.c route.c rtsock.c > Log: > Consistently use ifaddr_byindex() to access the link-level address > of an interface. No functional change. [...] > strlcpy(ifp->if_xname, new_name, sizeof(ifp->if_xname)); > - ifa = TAILQ_FIRST(&ifp->if_addrhead); > + ifa = ifaddr_byindex(ifp->if_index); Given that all of the changes in this commit end of the form ifaddr_byindex(ifp->if_index), I'd suggest an abstraction might be in order. Something like #define ifp2ifaddr(p) ifaddr_byindex((p)->if_index) in order to isolate this case (which, as you say, can be implemented several ways). I'm not sure ifp2ifaddr is a good name - that was just the first that came to mind. Eivind.