[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: The patch of gnumach to enable the user to set the network device in
Re: The patch of gnumach to enable the user to set the network device into the promiscuous mode
Sat, 9 Aug 2008 14:51:20 +0100
Zheng Da, le Fri 08 Aug 2008 23:13:02 +0200, a écrit :
> I copied the code from http://perso.hurdfr.org/mmenal/promisc.patch.
> I think only the root should be able to set the flags.
> On Fri, Aug 8, 2008 at 9:33 PM, Samuel Thibault <firstname.lastname@example.org>
> zhengda, le Fri 08 Aug 2008 06:44:16 +0200, a écrit :
> > + dev->flags = (flags &
> > + (IFF_BROADCAST | IFF_DEBUG | IFF_LOOPBACK |
> > + IFF_POINTOPOINT | IFF_NOTRAILERS | IFF_RUNNING |
> > + IFF_NOARP | IFF_PROMISC | IFF_ALLMULTI | IFF_SLAVE
> > + | IFF_MASTER | IFF_MULTICAST))
> > + | (dev->flags & (IFF_SOFTHEADERS|IFF_UP));
I had a look in if_hdr.h, there's a IFF_CANTCHANGE macro, which includes
BROADCAST, POINTOPOINT and RUNNING, shouldn't at least these be excluded
from set_flags then? When I look at the corresponding nowaday's linux
dev->flags = (flags & (IFF_DEBUG | IFF_NOTRAILERS | IFF_NOARP |
IFF_DYNAMIC | IFF_MULTICAST | IFF_PORTSEL |
(dev->flags & (IFF_UP | IFF_VOLATILE | IFF_PROMISC |
(plus IFF_UP, IFF_PROMISC and IFF_ALLMULTI which are handled
it looks so.