git: b3b5781c1c0b - main - Revert "netlink: Fix IFF_UP flag handling in RTM_NEWLINK's modify_link handler"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 22 Aug 2025 20:43:13 UTC
The branch main has been updated by obiwac:
URL: https://cgit.FreeBSD.org/src/commit/?id=b3b5781c1c0b730f9430983ce241c46dc50504f3
commit b3b5781c1c0b730f9430983ce241c46dc50504f3
Author: Aymeric Wibo <obiwac@FreeBSD.org>
AuthorDate: 2025-08-22 11:03:10 +0000
Commit: Aymeric Wibo <obiwac@FreeBSD.org>
CommitDate: 2025-08-22 20:43:09 +0000
Revert "netlink: Fix IFF_UP flag handling in RTM_NEWLINK's modify_link handler"
This reverts commit 39dbadb7a410f3955540041848d669264266e552.
This broke the
`sys/netlink/test_rtnl_iface.py:TestRtNlIface::test_create_iface_attrs`
testcase.
PR: 288967
Reported by: guest-svmhdvn
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51871
---
sys/netlink/route/iface_drivers.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/sys/netlink/route/iface_drivers.c b/sys/netlink/route/iface_drivers.c
index 5f605b05f7b8..4bf913d9c978 100644
--- a/sys/netlink/route/iface_drivers.c
+++ b/sys/netlink/route/iface_drivers.c
@@ -82,12 +82,9 @@ _nl_modify_ifp_generic(struct ifnet *ifp, struct nl_parsed_link *lattrs,
}
}
- if ((lattrs->ifi_change & IFF_UP) != 0 || lattrs->ifi_change == 0) {
- /* Request to up or down the interface */
- if (lattrs->ifi_flags & IFF_UP)
- if_up(ifp);
- else
- if_down(ifp);
+ if ((lattrs->ifi_change & IFF_UP) && (lattrs->ifi_flags & IFF_UP) == 0) {
+ /* Request to down the interface */
+ if_down(ifp);
}
if (lattrs->ifla_mtu > 0) {
@@ -100,8 +97,7 @@ _nl_modify_ifp_generic(struct ifnet *ifp, struct nl_parsed_link *lattrs,
}
}
- if ((lattrs->ifi_change & IFF_PROMISC) != 0 ||
- lattrs->ifi_change == 0) {
+ if (lattrs->ifi_change & IFF_PROMISC) {
error = ifpromisc(ifp, lattrs->ifi_flags & IFF_PROMISC);
if (error != 0) {
nlmsg_report_err_msg(npt, "unable to set promisc");