aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2002-08-19 15:16:38 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2002-08-19 15:16:38 +0000
commitffb079be0c99ee646d51ffd744daaa50fd86b886 (patch)
tree2e1436eccf89dbd4a420091b15a0d5dd78911874 /sbin
parent5a155b405e954207b870900889cabf117029c1d6 (diff)
downloadsrc-ffb079be0c99ee646d51ffd744daaa50fd86b886.tar.gz
src-ffb079be0c99ee646d51ffd744daaa50fd86b886.zip
Implement user-setable promiscuous mode (a new `promisc' flag for ifconfig(8)).
Also, for all interfaces in this mode pass all ethernet frames to upper layer, even those not addressed to our own MAC, which allows packets encapsulated in those frames be processed with packet filters (ipfw(8) et al). Emphatically requested by: Anton Turygin <pa3op@ukr-link.net> Valuable suggestions by: fenner
Notes
Notes: svn path=/head/; revision=102099
Diffstat (limited to 'sbin')
-rw-r--r--sbin/ifconfig/ifconfig.84
-rw-r--r--sbin/ifconfig/ifconfig.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index be8fd5064631..39761fbe5803 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -237,6 +237,10 @@ Enable driver dependent debugging code; usually, this turns on
extra console error logging.
.It Fl debug
Disable driver dependent debugging code.
+.It Cm promisc
+Put interface into permanently promiscuous mode.
+.It Fl promisc
+Disable permanently promiscuous mode.
.It Cm delete
Another name for the
.Fl alias
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 67c293eb9b5c..c9ab382b42f5 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -202,6 +202,8 @@ struct cmd {
{ "-arp", IFF_NOARP, setifflags },
{ "debug", IFF_DEBUG, setifflags },
{ "-debug", -IFF_DEBUG, setifflags },
+ { "promisc", IFF_PPROMISC, setifflags },
+ { "-promisc", -IFF_PPROMISC, setifflags },
{ "add", IFF_UP, notealias },
{ "alias", IFF_UP, notealias },
{ "-alias", -IFF_UP, notealias },
@@ -999,7 +1001,7 @@ setifflags(const char *vname, int value, int s, const struct afswtch *afp)
exit(1);
}
strncpy(my_ifr.ifr_name, name, sizeof (my_ifr.ifr_name));
- flags = (my_ifr.ifr_flags & 0xffff) | (my_ifr.ifr_flagshigh << 16);
+ flags = (my_ifr.ifr_flags & 0xffff) | (my_ifr.ifr_flagshigh << 16);
if (value < 0) {
value = -value;