summaryrefslogtreecommitdiffstats
path: root/sys/netatalk/at_control.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1996-12-13 21:29:07 +0000
committerwollman <wollman@FreeBSD.org>1996-12-13 21:29:07 +0000
commit3417f9411098d1cd19c5db539c0768e778b83a1c (patch)
tree782c07e423375f5e3235e7a677261301a91e59c6 /sys/netatalk/at_control.c
parent4ad813db29ba756a35db6540961c86a4c1f5592b (diff)
downloadFreeBSD-src-3417f9411098d1cd19c5db539c0768e778b83a1c.zip
FreeBSD-src-3417f9411098d1cd19c5db539c0768e778b83a1c.tar.gz
Convert the interface address and IP interface address structures
to TAILQs. Fix places which referenced these for no good reason that I can see (the references remain, but were fixed to compile again; they are still questionable).
Diffstat (limited to 'sys/netatalk/at_control.c')
-rw-r--r--sys/netatalk/at_control.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/sys/netatalk/at_control.c b/sys/netatalk/at_control.c
index 65608b7..4d8f8fa 100644
--- a/sys/netatalk/at_control.c
+++ b/sys/netatalk/at_control.c
@@ -173,25 +173,21 @@ at_control( int cmd, caddr_t data, struct ifnet *ifp, struct proc *p )
* Find the end of the interface's addresses
* and link our new one on the end
*/
- if (( ifa = ifp->if_addrlist ) != NULL ) {
- for ( ; ifa->ifa_next; ifa = ifa->ifa_next )
- ;
- ifa->ifa_next = (struct ifaddr *)aa;
- } else {
- ifp->if_addrlist = (struct ifaddr *)aa;
- }
+ ifa = (struct ifaddr *)aa;
+ TAILQ_INSERT_TAIL(&ifp->if_addrhead, ifa, ifa_link);
+
/*
* Add a reference for the linking into the ifp_if_addrlist.
*/
- aa->aa_ifa.ifa_refcnt++;
+ ifa->ifa_refcnt++;
/*
* As the at_ifaddr contains the actual sockaddrs,
* and the ifaddr itself, link them al together correctly.
*/
- aa->aa_ifa.ifa_addr = (struct sockaddr *)&aa->aa_addr;
- aa->aa_ifa.ifa_dstaddr = (struct sockaddr *)&aa->aa_addr;
- aa->aa_ifa.ifa_netmask = (struct sockaddr *)&aa->aa_netmask;
+ ifa->ifa_addr = (struct sockaddr *)&aa->aa_addr;
+ ifa->ifa_dstaddr = (struct sockaddr *)&aa->aa_addr;
+ ifa->ifa_netmask = (struct sockaddr *)&aa->aa_netmask;
/*
* Set/clear the phase 2 bit.
@@ -285,23 +281,8 @@ at_control( int cmd, caddr_t data, struct ifnet *ifp, struct proc *p )
* remove the ifaddr from the interface
*/
ifa0 = (struct ifaddr *)aa;
- if (( ifa = ifp->if_addrlist ) == ifa0 ) {
- ifp->if_addrlist = ifa->ifa_next;
- } else {
- while ( ifa->ifa_next && ( ifa->ifa_next != ifa0 )) {
- ifa = ifa->ifa_next;
- }
+ TAILQ_REMOVE(&ifp->if_addrhead, ifa0, ifa_link);
- /*
- * if we found it, remove it, otherwise we screwed up.
- * decrement the reference count by one.
- */
- if ( ifa->ifa_next ) {
- ifa = ifa->ifa_next = ifa0->ifa_next;
- } else {
- panic( "at_control" );
- }
- }
/*
* refs goes from 1->0 if no external refs. note..
* This will not free it ... looks for -1.
OpenPOWER on IntegriCloud