From nobody Fri May 29 23:24:32 2026 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 4gRzw06Dmrz6gHQQ for ; Fri, 29 May 2026 23:24:32 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gRzw058mhz3wJn for ; Fri, 29 May 2026 23:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780097072; 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=e+yV82aFoLB2XPMBfMYVK4rL2vlsQ58ikvj53C/gZUc=; b=AmsfGuNIshkhDkBDoTJc3tod4i/51IiaM05j4Hg4l0xlalNjRg72QsTJ4HlrjAQjp9s9Mi KEuKyVEFZTXkVAm6Zr5dnJMQdRX0hDfIoyVmS4bNWvzdkO03UajEmVNrsvqVF9dDgcRaPH pqP17lnBW855Zj+yTZ7GBKdy1pKnzmKwolGn7PmxGF/3yXyId6dvKeKKqmpERXSJ6XpewT NpxkGkhThjsVMIUMFG8/9dH/wY5u/FQRIdPb4rHCySeXa81B08KQFeoFXSmwXYYR5i0iw+ xQtf0TelGgr0SawsCFlyAUxUJQgGdqZzpeFRoZ2ZvzOhcN7rXivSU1vMGcQZTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780097072; a=rsa-sha256; cv=none; b=DuQiDxCXwxoThvjg/8P6M6W05QYySbndFXYdXULTQaFau5ye7HdSMINLYYtfKK34Cg/vvV 3HU5VmsH63M7NUgpr6AmJKOxnCI+g/PMKL7afJ+4otyuaKY3AXwxQH+A77N4ZF9Qzdcz4W a9zGooH/Ap9tfT9UBSuJfwDrR8bkO3J8pBCrfSrrttafcyKdUeVrsjFnZeA9dQULXpoCXW M7ibY1L6WXl01mSWFAU9ed+KdmZzoDvk2xaZj6ATAyJoEWQnvp8JTOU/dyznR2evQmUX1d JGK0vfpkq+WnozKVCv49orJGWYqL9iiEQwAjoUqjov1Pi5RVFLcVItuDYRjv5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780097072; 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=e+yV82aFoLB2XPMBfMYVK4rL2vlsQ58ikvj53C/gZUc=; b=C+fkojYZm/hFelfGOjy6Q7NmK1MJX2fmlbTvRbbjeJ70xNLM27MVZUVJN0Rf9NDJ5/os1+ 3QkJTYRxs5lFLRPwTF4GmIsJ90H396v0ZzUInJeGDsDpmsOCvjo4DC6muzNshKkiYzNMY2 PQDFI/S7BPz4G/8NnWwrAM4FwuiD5GgFEtatMjELoJV6DiETduC3JZE/b4ZJaSW/lbriEo tHPuOHxqY1k9V8FOx9dN4LHepAyP84tcutt5qoar9MNKqLoieCXGsHwJ5Fb1Soy3cWJIc0 C1mpFypZ3KHpfwkuq2NagBH8gBZwtER6uG3Ng+ZY+Bucrysc9KmZv+K/i+I9mQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gRzw04SnwzvTv for ; Fri, 29 May 2026 23:24:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4494d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 29 May 2026 23:24:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Cochard Subject: git: e492ad08fc34 - main - netlink/route: extend pre-2.6.19 Linux compat shim to del/getroute 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olivier X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e492ad08fc347ebf40979d3a6baa9d7b8917c76b Auto-Submitted: auto-generated Date: Fri, 29 May 2026 23:24:32 +0000 Message-Id: <6a1a2030.4494d.65ac4e59@gitrepo.freebsd.org> The branch main has been updated by olivier: URL: https://cgit.FreeBSD.org/src/commit/?id=e492ad08fc347ebf40979d3a6baa9d7b8917c76b commit e492ad08fc347ebf40979d3a6baa9d7b8917c76b Author: Olivier Cochard AuthorDate: 2026-05-29 23:17:28 +0000 Commit: Olivier Cochard CommitDate: 2026-05-29 23:23:12 +0000 netlink/route: extend pre-2.6.19 Linux compat shim to del/getroute Commit f34aca55adef ("netlink/route: provide pre-2.6.19 Linux compat shim", 2024-06) fixed the partial fix for net/bird2 on the netlink path by mapping the legacy 8-bit struct rtmsg::rtm_table field onto the modern 32-bit RTA_TABLE attribute when the latter is absent. That fix, however, was only applied to rtnl_handle_newroute. The two sibling handlers: rtnl_handle_delroute and rtnl_handle_getroute were left looking at attrs.rta_table directly. They are reachable from exactly the same client (bird, in its netlink scan path), so any FIB number that fits in 8 bits silently maps to RT_TABLE_UNSPEC in those handlers. Reviewed by: melifaro (previous version) Approved by: emaste MFC after: 1 week Sponsored by: Netflix --- sys/netlink/route/rt.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/netlink/route/rt.c b/sys/netlink/route/rt.c index 17aae399c10a..39ecb537d365 100644 --- a/sys/netlink/route/rt.c +++ b/sys/netlink/route/rt.c @@ -978,6 +978,14 @@ create_nexthop_from_attrs(struct nl_parsed_route *attrs, return (nh); } +/* pre-2.6.19 Linux API compatibility: prefer RTA_TABLE, fall back to rtm_table */ +static inline void +old_linux_compat(struct nl_parsed_route *attrs) +{ + if (attrs->rtm_table > 0 && attrs->rta_table == 0) + attrs->rta_table = attrs->rtm_table; +} + static int rtnl_handle_newroute(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *npt) @@ -997,9 +1005,7 @@ rtnl_handle_newroute(struct nlmsghdr *hdr, struct nlpcb *nlp, return (EINVAL); } - /* pre-2.6.19 Linux API compatibility */ - if (attrs.rtm_table > 0 && attrs.rta_table == 0) - attrs.rta_table = attrs.rtm_table; + old_linux_compat(&attrs); if (attrs.rta_table >= V_rt_numfibs || attrs.rtm_family > AF_MAX) { NLMSG_REPORT_ERR_MSG(npt, "invalid fib"); return (EINVAL); @@ -1066,6 +1072,7 @@ rtnl_handle_delroute(struct nlmsghdr *hdr, struct nlpcb *nlp, return (ESRCH); } + old_linux_compat(&attrs); if (attrs.rta_table >= V_rt_numfibs || attrs.rtm_family > AF_MAX) { NLMSG_REPORT_ERR_MSG(npt, "invalid fib"); return (EINVAL); @@ -1089,6 +1096,7 @@ rtnl_handle_getroute(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate * if (error != 0) return (error); + old_linux_compat(&attrs); if (attrs.rta_table >= V_rt_numfibs || attrs.rtm_family > AF_MAX) { NLMSG_REPORT_ERR_MSG(npt, "invalid fib"); return (EINVAL);