Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Apr 2004 09:05:20 +0000
From:      Eivind Eklund <eivind@FreeBSD.org>
To:        Luigi Rizzo <luigi@FreeBSD.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/net if.c route.c rtsock.c
Message-ID:  <20040416090520.GA1194@FreeBSD.org>
In-Reply-To: <200404160814.i3G8EYpj071288@repoman.freebsd.org>
References:  <200404160814.i3G8EYpj071288@repoman.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040416090520.GA1194>