Subject: Re: ifconfig vlan
To: None <thorpej@zembu.com>
From: None <itojun@iijlab.net>
List: current-users
Date: 11/10/2000 03:02:24
> > 	4) ifconfig vlan0 destroy
> > 	I saw "panic".
> > 	Is anyone saw this?
>Can you provide a little more information?  What was the panic message?

	i was able to reproduce this on 1.5J/i386 (wow, we already are in
	1.5J...), with the following sequence.
	(single user boot)
	# ifconfig vlan0 create
	# ifconfig vlan0 vlan 1 vlanif fxp0
	# ifconfig vlan0 destroy

	it panics near if_vlan.c line 660 (in vlan_ether_purgemulti).
	still have no time to track it down.

itojun


/*
 * Delete any multicast address we have asked to add form parent
 * interface.  Called when the vlan is being unconfigured.
 */
static void
vlan_ether_purgemulti(struct ifvlan *ifv)
{
	struct ifnet *ifp = ifv->ifv_p;		/* Parent. */
	struct vlan_mc_entry *mc;
	union {
		struct ifreq ifreq;
		struct {
			char ifr_name[IFNAMSIZ];
			struct sockaddr_storage;
		} ifreq_storage;
	} ifreq;
	struct ifreq *ifr = &ifreq.ifreq;

	memcpy(ifr->ifr_name, ifp->if_xname, IFNAMSIZ);
	while ((mc = LIST_FIRST(&ifv->ifv_mc_listhead)) != NULL) {
		memcpy(&ifr->ifr_addr, &mc->mc_addr, mc->mc_addr.ss_len);
		(void)(*ifp->if_ioctl)(ifp, SIOCDELMULTI, (caddr_t)ifr);
		LIST_REMOVE(mc->mc_enm, enm_list);
		free(mc->mc_enm, M_IFMADDR);
		LIST_REMOVE(mc, mc_entries);	<-- somewhere around here
		FREE(mc, M_DEVBUF);		<-- somewhere around here
	}

	KASSERT(LIST_FIRST(&ifv->ifv_ec.ec_multiaddrs) == NULL);
}