My rwhod don't - Part II

Chris Torek chris at mimsy.UUCP
Tue Feb 28 21:47:42 AEST 1989


In article <516 at qvax2.UUCP> israel at qvax2.UUCP (Renegade at ex2564) writes:
>   In examining the driver code, it appears that the IFF_BROADCAST flag
>is supposed to be set during ioctl SIOCIFADDR calls ...

No: it is supposed to be set at boot time, then never cleared.

>   If any of you wizard types out there can tell me where I'm losing my
>IFF_BROADCAST flag, please drop me a line.

You must still be running 4.2BSD.  (Astounding.)  There is a bug in
/sys/net/if.c ifioctl().  Under case SIOCSIFFLAGS, there is a line
like

		ifp->if_flags = ifr->ifr_flags;

which should in fact read

		ifp->if_flags = (ifp->if_flags & IFF_CANTCHANGE) |
			(ifr->ifr_flags &~ IFF_CANTCHANGE);

where IFF_CANTCHANGE is

#define	IFF_CANTCHANGE	(IFF_BROADCAST | IFF_POINTOPOINT | IFF_RUNNING)

so that /etc/ifconfig (and anyone else) cannot alter these flags.
(There should also be a suser() check; I seem to recall that 4.2BSD
let anyone configure an interface down.)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list