Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP
Path: utzoo!linus!decvax!genrad!panda!talcott!harvard!seismo!umcp-cs!chris
From: chris@umcp-cs.UUCP (Chris Torek)
Newsgroups: net.unix,net.lan,net.dcom,net.unix-wizards
Subject: Re: deuna driver problems
Message-ID: <839@umcp-cs.UUCP>
Date: Sat, 13-Jul-85 18:21:25 EDT
Article-I.D.: umcp-cs.839
Posted: Sat Jul 13 18:21:25 1985
Date-Received: Mon, 15-Jul-85 02:20:48 EDT
References: <127@rpics.UUCP> <1003@ulysses.UUCP> <811@umcp-cs.UUCP> <1009@ulysses.UUCP>
Distribution: net
Organization: U of Maryland, Computer Science Dept., College Park, MD
Lines: 45
Xref: linus net.unix:4443 net.lan:770 net.dcom:914 net.unix-wizards:11015

Eek!  You're right.  I stand corrected.  (Sorry about that, Lou....)
The bug is not in the DEUNA driver, it's in the 4.2BSD kernel.

In sys/net/if.c, you will find the following code:
	.
	.
	.
	/*
	 * Interface ioctls.
	 */
	ifioctl(cmd, data)
		.
		.
		.
	case SIOCSIFFLAGS:
		if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
			int s = splimp();
			if_down(ifp);
			splx(s);
		}
		ifp->if_flags = ifr->ifr_flags;
		break;
		.
		.
		.

The code under "case SIOCSIFFLAGS" should be changed to read as follows:

	case SIOCSIFFLAGS:
		if (ifp->if_flags & IFF_UP && (ifr->ifr_flags & IFF_UP) == 0) {
			int s = splimp();
			if_down(ifp);
			splx(s);
		}
#define IFF_CANTCHANGE	(IFF_BROADCAST | IFF_POINTOPOINT | IFF_RUNNING)
		ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) |
		    (ifr->ifr_flags & ~IFF_CANTCHANGE);
		break;

This will prevent you from accidently doing nasty things like turning
a point to point link into a broadcast interface....
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland