FreeBSD Bugzilla – Attachment 15891 Details for
Bug 29345
freebsd can crash after removing a network card
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.63 KB, created by
inoue
on 2001-07-31 09:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
inoue
Created:
2001-07-31 09:30:01 UTC
Size:
2.63 KB
patch
obsolete
>diff -uNr netinet/in.c /usr/src/sys/netinet/in.c >--- netinet/in.c Tue Jul 31 14:04:40 2001 >+++ /usr/src/sys/netinet/in.c Tue Jul 31 12:54:46 2001 >@@ -48,6 +48,7 @@ > > #include <netinet/in.h> > #include <netinet/in_var.h> >+#include <netinet/in_pcb.h> > > #include <netinet/igmp_var.h> > >@@ -68,6 +69,9 @@ > > struct in_multihead in_multihead; /* XXX BSS initialization */ > >+extern struct inpcbinfo ripcbinfo; >+extern struct inpcbinfo udbinfo; >+ > /* > * Return 1 if an internet address is for a ``local'' host > * (one to which we have a connection). If subnetsarelocal >@@ -402,6 +406,14 @@ > * a routing process they will come back. > */ > in_ifadown(&ia->ia_ifa, 1); >+ /* >+ * XXX horrible hack to detect that we are being called >+ * from if_detach() >+ */ >+ if (!ifnet_addrs[ifp->if_index - 1]) { >+ in_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp); >+ in_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp); >+ } > > /* > * Protect from ipintr() traversing address list >diff -uNr netinet/in_pcb.c /usr/src/sys/netinet/in_pcb.c >--- netinet/in_pcb.c Tue Jul 31 14:04:40 2001 >+++ /usr/src/sys/netinet/in_pcb.c Tue Jul 31 12:53:05 2001 >@@ -689,6 +689,44 @@ > splx(s); > } > >+void >+in_pcbpurgeif0(head, ifp) >+ struct inpcb *head; >+ struct ifnet *ifp; >+{ >+ struct inpcb *inp; >+ struct ip_moptions *imo; >+ int i, gap; >+ >+ for (inp = head; inp != NULL; inp = LIST_NEXT(inp, inp_list)) { >+ imo = inp->inp_moptions; >+ if ((inp->inp_vflag & INP_IPV4) && >+ imo != NULL) { >+ /* >+ * Unselect the outgoing interface if it is being >+ * detached. >+ */ >+ if (imo->imo_multicast_ifp == ifp) >+ imo->imo_multicast_ifp = NULL; >+ >+ /* >+ * Drop multicast group membership if we joined >+ * through the interface being detached. >+ */ >+ for (i = 0, gap = 0; i < imo->imo_num_memberships; >+ i++) { >+ if (imo->imo_membership[i]->inm_ifp == ifp) { >+ in_delmulti(imo->imo_membership[i]); >+ gap++; >+ } else if (gap != 0) >+ imo->imo_membership[i - gap] = >+ imo->imo_membership[i]; >+ } >+ imo->imo_num_memberships -= gap; >+ } >+ } >+} >+ > /* > * Check for alternatives when higher level complains > * about service problems. For now, invalidate cached >diff -uNr netinet/in_pcb.h /usr/src/sys/netinet/in_pcb.h >--- netinet/in_pcb.h Tue Jul 31 14:04:40 2001 >+++ /usr/src/sys/netinet/in_pcb.h Tue Jul 31 12:53:05 2001 >@@ -275,6 +275,7 @@ > extern int ipport_hifirstauto; > extern int ipport_hilastauto; > >+void in_pcbpurgeif0 __P((struct inpcb *, struct ifnet *)); > void in_losing __P((struct inpcb *)); > void in_rtchange __P((struct inpcb *, int)); > int in_pcballoc __P((struct socket *, struct inpcbinfo *, struct proc *)); >--- netinet.patch ---
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 29345
: 15891 |
15892