View | Details | Raw Unified | Return to bug 29345 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/src/sys/netinet/in.c (+12 lines)
Lines 48-53 Link Here
48
48
49
#include <netinet/in.h>
49
#include <netinet/in.h>
50
#include <netinet/in_var.h>
50
#include <netinet/in_var.h>
51
#include <netinet/in_pcb.h>
51
52
52
#include <netinet/igmp_var.h>
53
#include <netinet/igmp_var.h>
53
54
Lines 68-73 Link Here
68
69
69
struct in_multihead in_multihead; /* XXX BSS initialization */
70
struct in_multihead in_multihead; /* XXX BSS initialization */
70
71
72
extern struct inpcbinfo ripcbinfo;
73
extern struct inpcbinfo udbinfo;
74
71
/*
75
/*
72
 * Return 1 if an internet address is for a ``local'' host
76
 * Return 1 if an internet address is for a ``local'' host
73
 * (one to which we have a connection).  If subnetsarelocal
77
 * (one to which we have a connection).  If subnetsarelocal
Lines 402-407 Link Here
402
		 * a routing process they will come back.
406
		 * a routing process they will come back.
403
		 */
407
		 */
404
		in_ifadown(&ia->ia_ifa, 1);
408
		in_ifadown(&ia->ia_ifa, 1);
409
		/*
410
		 * XXX horrible hack to detect that we are being called
411
		 * from if_detach()
412
		 */
413
		if (!ifnet_addrs[ifp->if_index - 1]) {
414
			in_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp);
415
			in_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp);
416
		}
405
417
406
		/*
418
		/*
407
		 * Protect from ipintr() traversing address list
419
		 * Protect from ipintr() traversing address list
(-)/usr/src/sys/netinet/in_pcb.c (+38 lines)
Lines 689-694 Link Here
689
	splx(s);
689
	splx(s);
690
}
690
}
691
691
692
void
693
in_pcbpurgeif0(head, ifp)
694
	struct inpcb *head;
695
	struct ifnet *ifp;
696
{
697
	struct inpcb *inp;
698
	struct ip_moptions *imo;
699
	int i, gap;
700
701
	for (inp = head; inp != NULL; inp = LIST_NEXT(inp, inp_list)) {
702
		imo = inp->inp_moptions;
703
		if ((inp->inp_vflag & INP_IPV4) &&
704
		    imo != NULL) {
705
			/*
706
			 * Unselect the outgoing interface if it is being
707
			 * detached.
708
			 */
709
			if (imo->imo_multicast_ifp == ifp)
710
				imo->imo_multicast_ifp = NULL;
711
712
			/*
713
			 * Drop multicast group membership if we joined
714
			 * through the interface being detached.
715
			 */
716
			for (i = 0, gap = 0; i < imo->imo_num_memberships;
717
			    i++) {
718
				if (imo->imo_membership[i]->inm_ifp == ifp) {
719
					in_delmulti(imo->imo_membership[i]);
720
					gap++;
721
				} else if (gap != 0)
722
					imo->imo_membership[i - gap] =
723
					    imo->imo_membership[i];
724
			}
725
			imo->imo_num_memberships -= gap;
726
		}
727
	}
728
}
729
692
/*
730
/*
693
 * Check for alternatives when higher level complains
731
 * Check for alternatives when higher level complains
694
 * about service problems.  For now, invalidate cached
732
 * about service problems.  For now, invalidate cached
(-)/usr/src/sys/netinet/in_pcb.h (+1 lines)
Lines 275-280 Link Here
275
extern int	ipport_hifirstauto;
275
extern int	ipport_hifirstauto;
276
extern int	ipport_hilastauto;
276
extern int	ipport_hilastauto;
277
277
278
void	in_pcbpurgeif0 __P((struct inpcb *, struct ifnet *));
278
void	in_losing __P((struct inpcb *));
279
void	in_losing __P((struct inpcb *));
279
void	in_rtchange __P((struct inpcb *, int));
280
void	in_rtchange __P((struct inpcb *, int));
280
int	in_pcballoc __P((struct socket *, struct inpcbinfo *, struct proc *));
281
int	in_pcballoc __P((struct socket *, struct inpcbinfo *, struct proc *));

Return to bug 29345