git: f47e5a92edd6 - stable/14 - ifconfig: Add an allmulti verb
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Sep 2024 11:40:05 UTC
The branch stable/14 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=f47e5a92edd6840fca6267649b1304c39fbbcc8f
commit f47e5a92edd6840fca6267649b1304c39fbbcc8f
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-09-06 16:56:58 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-09-20 11:39:16 +0000
ifconfig: Add an allmulti verb
Similar to "promisc", this allows the IFF_ALLMULTI flag to be toggled
from userspace if it happens to be useful to disable multicast packet
filtering. One use-case is when implementing IPv6 neighbour discovery
over netmap.
Reviewed by: zlei, glebius
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D46525
(cherry picked from commit 00c9a6806c9cf3357b62f6708e5acd1ffd166613)
---
sbin/ifconfig/ifconfig.8 | 4 ++++
sbin/ifconfig/ifconfig.c | 2 ++
sbin/ifconfig/ifconfig_netlink.c | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8
index 259be41bf94b..2f87ae8b8a5f 100644
--- a/sbin/ifconfig/ifconfig.8
+++ b/sbin/ifconfig/ifconfig.8
@@ -502,6 +502,10 @@ Enable driver dependent debugging code; usually, this turns on
extra console error logging.
.It Fl debug
Disable driver dependent debugging code.
+.It Cm allmulti
+Enable promiscuous mode for multicast packets.
+.It Fl allmulti
+Disable promiscuous mode for multicast packets.
.It Cm promisc
Put interface into permanently promiscuous mode.
.It Fl promisc
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c
index 402967d405fd..5cf1ae6b79b7 100644
--- a/sbin/ifconfig/ifconfig.c
+++ b/sbin/ifconfig/ifconfig.c
@@ -2019,6 +2019,8 @@ static struct cmd basic_cmds[] = {
DEF_CMD_ARG("descr", setifdescr),
DEF_CMD("-description", 0, unsetifdescr),
DEF_CMD("-descr", 0, unsetifdescr),
+ DEF_CMD("allmulti", IFF_PALLMULTI, setifflags),
+ DEF_CMD("-allmulti", IFF_PALLMULTI, clearifflags),
DEF_CMD("promisc", IFF_PPROMISC, setifflags),
DEF_CMD("-promisc", IFF_PPROMISC, clearifflags),
DEF_CMD("add", IFF_UP, notealias),
diff --git a/sbin/ifconfig/ifconfig_netlink.c b/sbin/ifconfig/ifconfig_netlink.c
index bb0d242f21f6..03fe1e418082 100644
--- a/sbin/ifconfig/ifconfig_netlink.c
+++ b/sbin/ifconfig/ifconfig_netlink.c
@@ -77,7 +77,7 @@ static const char *IFFBITS[] = {
"STICKYARP", /* 20:0x100000 IFF_STICKYARP*/
"DYING", /* 21:0x200000 IFF_DYING*/
"RENAMING", /* 22:0x400000 IFF_RENAMING*/
- "NOGROUP", /* 23:0x800000 IFF_NOGROUP*/
+ "PALLMULTI", /* 23:0x800000 IFF_PALLMULTI*/
"LOWER_UP", /* 24:0x1000000 IFF_NETLINK_1*/
};