Fixed BUG in if_detach.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5159 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -398,12 +398,20 @@ void if_attach(struct ifnet *ifp)
|
|||||||
|
|
||||||
void if_detach(struct ifnet *ifp)
|
void if_detach(struct ifnet *ifp)
|
||||||
{
|
{
|
||||||
struct ifnet **p = &devices, *q;
|
struct ifnet *p = devices, *q = NULL;
|
||||||
|
|
||||||
for (; (*p)->if_next != ifp ; (*p) = (*p)->if_next)
|
for(; p && p != ifp; p = p->if_next)
|
||||||
continue;
|
q = p;
|
||||||
q = (*p)->if_next->if_next;
|
|
||||||
(*p)->if_next = q;
|
if(!p)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(q)
|
||||||
|
q->if_next = p->if_next;
|
||||||
|
else
|
||||||
|
devices = p->if_next;
|
||||||
|
|
||||||
|
free(p->if_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX - memcpy used as copyin / copyout not available. I did look
|
/* XXX - memcpy used as copyin / copyout not available. I did look
|
||||||
|
|||||||
Reference in New Issue
Block a user