deuna driver problems
Chris Torek
chris at umcp-cs.UUCP
Sun Jul 14 08:21:25 AEST 1985
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 at umcp-cs ARPA: chris at maryland
More information about the Comp.unix.wizards
mailing list