Re: Promiscous Mode

Michael Shields (shields@crosslink.net)
04 Aug 1997 05:56:34 +0000


In article <199708040502.BAA28691@piglet.netlite.com>,
"Global Unix Free Net. Inc." <john@unixnet.org> wrote:
> I am looking through the various net card configs in the kernel
> source for the place which I can make it so the net card can not drop
> into promiscious mode. Can someone please point me to the right
> direction here.

This patch is against 2.0.30-pre31-2.

Index: dev.c
===================================================================
RCS file: /usr/src/master/linux/net/core/dev.c,v
retrieving revision 1.1.1.6
retrieving revision 1.7
diff -u -r1.1.1.6 -r1.7
--- dev.c 1997/07/09 01:32:05 1.1.1.6
+++ dev.c 1997/07/09 03:00:21 1.7
@@ -1101,6 +1106,12 @@
case SIOCSIFFLAGS: /* Set interface flags */
{
int old_flags = dev->flags;
+
+ /*
+ * Unfortunately, there is no EFUCKYOU. --Shields 1996-03-15
+ */
+ if (ifr.ifr_flags & IFF_PROMISC)
+ return -EPERM;

/*
* We are not allowed to potentially close/unload
@@ -1116,7 +1127,7 @@
dev->flags = (ifr.ifr_flags & (
IFF_BROADCAST | IFF_DEBUG | IFF_LOOPBACK |
IFF_POINTOPOINT | IFF_NOTRAILERS | IFF_RUNNING |
- IFF_NOARP | IFF_PROMISC | IFF_ALLMULTI | IFF_SLAVE | IFF_MASTER
+ IFF_NOARP /*| IFF_PROMISC*/ | IFF_ALLMULTI | IFF_SLAVE | IFF_MASTER
| IFF_MULTICAST)) | (dev->flags & IFF_UP);
/*
* Load in the correct multicast list now the flags have changed.

-- 
Shields, CrossLink.