opnsense-src/sys/netlink
Aymeric Wibo 431856c868
netlink: Bypass refcounting when setting promiscuity
When asking for IFF_PROMISC when modifying interfaces with netlink, set
permanent flag instead (IFF_PPROMISC) as netlink interface modification
has no way of doing promiscuity reference counting through ifpromisc().
We can't do reference counting because every netlink interface
modification necessarily either sets or unsets IFF_PROMISC in ifi_flags,
and ifi_change is usually set to 0xFFFFFFFF.

This logic was the same between this and SIOCSIFFLAGS, so factor out
if_setppromisc() function.

Reviewed by:	melifaro, saheed, kp, mckusick (mentor)
Approved by:	melifaro, saheed, mckusick (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D52056
2025-08-26 00:40:17 +02:00
..
route netlink: Bypass refcounting when setting promiscuity 2025-08-26 00:40:17 +02:00
ktest_netlink_message_writer.c netlink: use protocol specific receive buffer 2024-01-02 13:04:01 -08:00
ktest_netlink_message_writer.h netlink: use size_t through the allocation KPI 2024-12-03 12:04:27 -08:00
netlink.h netlink.h: Align macro declarations with tabs 2024-12-10 21:12:38 +03:00
netlink_bitset.h netlink: dump interface capabilities with other interface data. 2023-06-16 15:33:49 +00:00
netlink_ctl.h netlink: provide genl_unregister_group() 2025-02-05 10:09:06 -08:00
netlink_debug.h netlink: Wrap long lines 2024-07-14 14:29:15 -04:00
netlink_domain.c netlink: refuse a send(2) that is larger than socket buffer 2025-02-28 15:39:15 -08:00
netlink_generic.c netlink: provide genl_unregister_group() 2025-02-05 10:09:06 -08:00
netlink_generic.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_glue.c netlink: don't store an extra pointer to so_cred 2025-02-04 16:54:21 -08:00
netlink_io.c netlink: do not pass writer to the Linux translation layer 2025-08-22 09:23:38 -07:00
netlink_linux.h netlink: do not pass writer to the Linux translation layer 2025-08-22 09:23:38 -07:00
netlink_message_parser.c machine/stdarg.h -> sys/stdarg.h 2025-06-11 17:39:02 +01:00
netlink_message_parser.h nlmsg_report_err_msg: add __printflike annotation 2025-07-15 06:12:45 +01:00
netlink_message_writer.c netlink: augment group writer with priv(9) argument 2025-01-10 20:55:39 -08:00
netlink_message_writer.h netlink: augment group writer with priv(9) argument 2025-01-10 20:55:39 -08:00
netlink_module.c netlink: initialize VNET context with VNET_SYSINIT() 2025-02-04 16:54:21 -08:00
netlink_route.c sys: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:00 -07:00
netlink_route.h netlink: dump interface capabilities with other interface data. 2023-06-16 15:33:49 +00:00
netlink_snl.h netlink: Move static arrays of parsers into tests that use them 2025-04-11 09:52:39 -04:00
netlink_snl_generic.h netlink: Move static arrays of parsers into tests that use them 2025-04-11 09:52:39 -04:00
netlink_snl_route.h netlink: Fix C++ compile errors 2024-05-24 22:31:42 -06:00
netlink_snl_route_compat.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
netlink_snl_route_parsers.h netlink: Move static arrays of parsers into tests that use them 2025-04-11 09:52:39 -04:00
netlink_sysevent.c netlink: refactor KPI for generic Netlink modules 2025-02-05 10:09:06 -08:00
netlink_sysevent.h nlsysevent: add default command to the events 2023-06-02 14:22:10 +02:00
netlink_var.h netlink: provide genl_unregister_group() 2025-02-05 10:09:06 -08:00