From nobody Sat Jan 11 08:40:02 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YVX5Z57fYz5jqmJ; Sat, 11 Jan 2025 08:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YVX5Z4bdDz40yq; Sat, 11 Jan 2025 08:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736584802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FTYg8psPUAQCmlHeXWjFS4/Q7HwqPPUmccT37++aQs=; b=egfJsL9nJMF5ZfOyrjMgGgNKAOzNKJkaSfCMxM5y3ET70nRNycmPsL1KYMcgeN7fqXkNZ7 w+n6GNw4mrrhYrXLUJTwrssHHFAqTqgh9RD7Hh1ZolAqk/aeW+neMMRRmyMGeLR9Olu34E C1vUhmyE/9sDhEVatfZGBUrk3zo+UQnBWWTa7bayq5DPO9zLSnq44Bk14vB97R0fix3uT6 Xzs4vzm2YLEVX9b8m4TxvvLnR/zGbvLcMRBpOJNzRHT4hqUfrY0e1RjVNihHaJAbYFSUP0 C3kxJ85dCbGMpHqrkj4sieByCexg5sOfu0hJAXan976wuFabDUHj0+trFtuVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736584802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0FTYg8psPUAQCmlHeXWjFS4/Q7HwqPPUmccT37++aQs=; b=v3p/0NHxpw5zNEGUnmINO1jC71556kQ9/awIlNx6GOWoWKIRrmyge8ooxbX6AtKgxm7yKk wtPJkQf+JMv2yrfena/7YLnc52G6Z9Vfs0IpFiXvKNOEgXXF4br1j4G1af0gSNW5ETXQb9 bWxAvJf6n7/1TxlnNnTuTORBPcSPlEEDGlT+Thcl/+G3jNFXs5C9+ImTo7qZpGRQ/vp7oH HuxKOIo5/5P/NvHU0f9JOLmbR/9LHYPJb8CZ4JSCHh3GXV7Ko2pom9EOR0r/+zmWLqSwiP 8N2np0KBWGXyEkEScel0O88Ir2mMwP2q49dBYDu5aDT9vYQtBvY5DBk/Kef1Pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736584802; a=rsa-sha256; cv=none; b=F2VZv1F/eMG5B9bV4oYgxnom4UpTQs1qezOuXjah5d+xgoTcUW3JU+8Mg6pkdx9lZQARGB Bj3MRQfM64xn/NRuvcob/+9DDjsYJoiCn3IG8HqrnLrjC/HVoMQO1xw/g2v0oiSOMix2jS GuGmrDX50iN8gPuydfsFjAXp+0wuiRHeX251rpo4iTCRL0YMu3Xom77elYagln6JvqCHLA +fFtgnWVNssuazawwpRbpMwea6gbjUrSjcID8hPrmLtCqe2crSq/C+J/vz9y7KSLXqxLNg epYdKtcIJITxRQa0EHmjtSXD6+ZXjdkpbWVfbIoVoBvquq8CE73Una88g+sAjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YVX5Z47xhzrjY; Sat, 11 Jan 2025 08:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50B8e2jL026031; Sat, 11 Jan 2025 08:40:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50B8e2f4026026; Sat, 11 Jan 2025 08:40:02 GMT (envelope-from git) Date: Sat, 11 Jan 2025 08:40:02 GMT Message-Id: <202501110840.50B8e2f4026026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Andrey V. Elsukov" Subject: git: 3ce003c8b615 - main - netlink: restore the ability to delete PINNED routes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ae X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3ce003c8b6151f7764b7934de11c789d6b84ee5c Auto-Submitted: auto-generated The branch main has been updated by ae: URL: https://cgit.FreeBSD.org/src/commit/?id=3ce003c8b6151f7764b7934de11c789d6b84ee5c commit 3ce003c8b6151f7764b7934de11c789d6b84ee5c Author: Andrey V. Elsukov AuthorDate: 2025-01-11 08:25:50 +0000 Commit: Andrey V. Elsukov CommitDate: 2025-01-11 08:25:50 +0000 netlink: restore the ability to delete PINNED routes route(8) had such ability before migration to netlink. To be able to delete PINNED routes we pass RTM_F_FORCE to rib_del_route_px() when userland uses RTF_PINNED flag with RTM_DELETE command. This is hackish way for route(8) tool, that third-party software usually doesn't use. PR: 279988 Tested by: franco at opnsense org Discussed with: glebius MFC after: 10 days Differential Revision: https://reviews.freebsd.org/D46301 --- sys/netlink/route/rt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index e90debee46da..79ecd066aa72 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -1012,7 +1012,8 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp, } error = rib_del_route_px(attrs.rta_table, attrs.rta_dst, - attrs.rtm_dst_len, path_match_func, &attrs, 0, &rc); + attrs.rtm_dst_len, path_match_func, &attrs, + (attrs.rta_rtflags & RTF_PINNED) ? RTM_F_FORCE : 0, &rc); if (error == 0) report_operation(attrs.rta_table, &rc, nlp, hdr); return (error);