get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2197838/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2197838,
    "url": "http://patchwork.ozlabs.org/api/patches/2197838/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openvswitch/patch/20260218174827.2241315-1-matteo.perin@canonical.com/",
    "project": {
        "id": 47,
        "url": "http://patchwork.ozlabs.org/api/projects/47/?format=api",
        "name": "Open vSwitch",
        "link_name": "openvswitch",
        "list_id": "ovs-dev.openvswitch.org",
        "list_email": "ovs-dev@openvswitch.org",
        "web_url": "http://openvswitch.org/",
        "scm_url": "git@github.com:openvswitch/ovs.git",
        "webscm_url": "https://github.com/openvswitch/ovs",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260218174827.2241315-1-matteo.perin@canonical.com>",
    "list_archive_url": null,
    "date": "2026-02-18T17:48:27",
    "name": "[ovs-dev] ovs-router: Fix --disable-system-route rules filtering.",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "76968a024296423d9c0d9e177c53c91503bbcef7",
    "submitter": {
        "id": 92284,
        "url": "http://patchwork.ozlabs.org/api/people/92284/?format=api",
        "name": "Matteo Perin",
        "email": "matteo.perin@canonical.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openvswitch/patch/20260218174827.2241315-1-matteo.perin@canonical.com/mbox/",
    "series": [
        {
            "id": 492581,
            "url": "http://patchwork.ozlabs.org/api/series/492581/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/openvswitch/list/?series=492581",
            "date": "2026-02-18T17:48:27",
            "name": "[ovs-dev] ovs-router: Fix --disable-system-route rules filtering.",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/492581/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2197838/comments/",
    "check": "success",
    "checks": "http://patchwork.ozlabs.org/api/patches/2197838/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<ovs-dev-bounces@openvswitch.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "ovs-dev@openvswitch.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "ovs-dev@lists.linuxfoundation.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (4096-bit key;\n unprotected) header.d=canonical.com header.i=@canonical.com\n header.a=rsa-sha256 header.s=20251003 header.b=fYeBWoDD;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org\n (client-ip=140.211.166.136; helo=smtp3.osuosl.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org)",
            "smtp3.osuosl.org;\n\tdkim=fail reason=\"signature verification failed\" (4096-bit key)\n header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256\n header.s=20251003 header.b=fYeBWoDD",
            "smtp4.osuosl.org; dmarc=pass (p=reject dis=none)\n header.from=canonical.com",
            "smtp4.osuosl.org;\n dkim=pass (4096-bit key) header.d=canonical.com header.i=@canonical.com\n header.a=rsa-sha256 header.s=20251003 header.b=fYeBWoDD"
        ],
        "Received": [
            "from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGPC72vHsz1xvq\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 04:49:07 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 6D68160A58;\n\tWed, 18 Feb 2026 17:49:05 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id cTIPSCwSPwRg; Wed, 18 Feb 2026 17:49:03 +0000 (UTC)",
            "from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56])\n\tby smtp3.osuosl.org (Postfix) with ESMTPS id 3FAF860A43;\n\tWed, 18 Feb 2026 17:49:03 +0000 (UTC)",
            "from lf-lists.osuosl.org (localhost [127.0.0.1])\n\tby lists.linuxfoundation.org (Postfix) with ESMTP id 28EDDC0035;\n\tWed, 18 Feb 2026 17:49:03 +0000 (UTC)",
            "from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])\n by lists.linuxfoundation.org (Postfix) with ESMTP id 57B5AC0033\n for <ovs-dev@openvswitch.org>; Wed, 18 Feb 2026 17:49:02 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp4.osuosl.org (Postfix) with ESMTP id A4514408E0\n for <ovs-dev@openvswitch.org>; Wed, 18 Feb 2026 17:48:44 +0000 (UTC)",
            "from smtp4.osuosl.org ([127.0.0.1])\n by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id jHoquJNHXF6f for <ovs-dev@openvswitch.org>;\n Wed, 18 Feb 2026 17:48:43 +0000 (UTC)",
            "from smtp-relay-internal-0.canonical.com\n (smtp-relay-internal-0.canonical.com [185.125.188.122])\n by smtp4.osuosl.org (Postfix) with ESMTPS id A064A408D4\n for <ovs-dev@openvswitch.org>; Wed, 18 Feb 2026 17:48:43 +0000 (UTC)",
            "from mail-pl1-f198.google.com (mail-pl1-f198.google.com\n [209.85.214.198])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 05F2E3F520\n for <ovs-dev@openvswitch.org>; Wed, 18 Feb 2026 17:48:42 +0000 (UTC)",
            "by mail-pl1-f198.google.com with SMTP id\n d9443c01a7336-2a7a98ba326so4329035ad.1\n for <ovs-dev@openvswitch.org>; Wed, 18 Feb 2026 09:48:41 -0800 (PST)",
            "from matperin-thinkpad.ts.net ([2001:67c:1560:8007::aac:c940])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2ad1aae9d73sm125179755ad.77.2026.02.18.09.48.37\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 18 Feb 2026 09:48:39 -0800 (PST)"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.9.56;\n helo=lists.linuxfoundation.org;\n envelope-from=ovs-dev-bounces@openvswitch.org; receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3FAF860A43",
            "OpenDKIM Filter v2.11.0 smtp4.osuosl.org A064A408D4"
        ],
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=185.125.188.122;\n helo=smtp-relay-internal-0.canonical.com;\n envelope-from=matteo.perin@canonical.com; receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp4.osuosl.org A064A408D4",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com;\n s=20251003; t=1771436922;\n bh=Jqdt1sGMMalaPiqUDmBtOtRnOgQ1SGXLayQzh7xcpsg=;\n h=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=fYeBWoDDkojuzGsx943XImu51x386pcklXrI3/PG0rZnG5pEcFevIqay33he+C30a\n ySzKMhAkklKuD7qY4YZkvagtH+hS3yuyk8WG0S5MwV+Snfww3d5G3yeQUXeJPyk76+\n B9Qa04FPB3led3HfHOdcD6UoDn4iligRsO5Jsrv3Ul4mYQgLnLd665LqbhlphMmjVY\n pamj+E37r4lPb+tsSDf+xDy+dZLHk5+UwcAZviEuryGVUyd85Sc+L2mCXOQBqYqah0\n lI7nvBAaa2ASMxlxKGDfqz/vBMjFqACblRN+1luNsUmPzxZHqX+cJel/TNtedFuTQi\n 6xTXkCPbDYVQn0qVYMB6v/YpfmnWR6D4sJQFxZ8vLQp/J3cDp1jejZ9/a9NliyN4/6\n cH5IfTHXGVBjh43sqeJLBXxvdINazAe1WHvx0Z3TPYdRWMOYzlG9vOVeQrM68umpOn\n Kt+xwQsb6wLiA0IHvywZRKAZGO1fBuPAD2I+L0OyhVdK8WIyTcslvLXhs54peH+3dS\n zh5ari7/SyqEtZizZEQQ1YxZOlxUNlXbGr08ySg+PuOUVyfNrvHxb8n5sLH6UfeQeX\n ZWeO2BMWi7cegYDpO3rCneClGAqxhRfndwoODU/cvzbFXg+YsvnF+peCgL1MImp2ET\n C7itVT3qHRfhs6ha9lrRxW1k=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771436920; x=1772041720;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=Jqdt1sGMMalaPiqUDmBtOtRnOgQ1SGXLayQzh7xcpsg=;\n b=lNkn4LUq8M+/EfYN54OQ1b9tcBqhM2rftw/XdImMlzHho0hQj/c9LHoZUbemdYxEEK\n w0/d+bjI1b6o0HHKSncjwMbQGR4Lu1A4+Bzji3bCpFxx3GO8E6Bg8TxtrY/SpjvH1Lew\n cRQTVxYzlqba0+QHWBsWOR+BGvJVY0kMEPjmlaAS+dPlg7ZscJ7rSDNyzPmjPBfpevvf\n STqf0M9b+zqkgHaiMikxbBRfdJ47bq3JkC+vSsIKNrgJkn8CMy1imA3iTJun2HMFT26U\n 1cjHs5vSJopS3/KpSyp4NLma9DJXafvm2CTXeoMiw/c9qmWOBuHqu4VS0UBpo5mzKDVQ\n x3Cw==",
        "X-Gm-Message-State": "AOJu0Yzw71A13zdc6Pzo/CWd8gEcPCfzczHROUgBjeAFU+DUdrpqI6MN\n n9glBkezaa1Kms5J0Re69nJF4EwI4HSlfQj7BNFOMY/XyYUpxn6MgnhHjzHWU7R/I3TJw2q2wEQ\n 7CdK4MbkGcz4dPhcaCaPwoIdGO9szHlVuOp5HnubyUHVMQ6dp6z0cfXUnJOzuGOcIK0SgUd7H5n\n HSYtbzBSw8LYFh",
        "X-Gm-Gg": "AZuq6aJRwsf4OYdX3E16DJXS7HehAdAzc1CVB7+KeVd5YAX5YuulUVTXHiOBzoFaKJO\n vH4V7kqGZlxC8DUJPo4Ak1gVffHoA5Pj8OtvrZbzhU9YvlzstMTXM7erHGPXFbXy7ExABm9O8lj\n oo+FDnIgNl1CuOQdEA1ht7Zyk/NCSVCebVUTkpSfnoOQqSMai9mF6DpAxkX1eivID6gmbl+w90T\n 6ZZo9WhGeeT0t2IRk8vtT3Zk4O1FQle/0hzEVkeTjq6COdrABF4SAqBlj5tRnQlPVQ62ibbddnC\n kRQAlutx3DT4SwzSsQ9MS+5Mf4oyr17HN1Z3Tc+G3fPp5U8tF3qCNTVbpg3bIuB767ZMqGAX315\n mgAXNcWE+c3eRlNG7xerD7uyzz+wLgUIABTvo",
        "X-Received": [
            "by 2002:a17:902:ef52:b0:2aa:e1f0:5481 with SMTP id\n d9443c01a7336-2ad50cba078mr24279195ad.30.1771436920176;\n Wed, 18 Feb 2026 09:48:40 -0800 (PST)",
            "by 2002:a17:902:ef52:b0:2aa:e1f0:5481 with SMTP id\n d9443c01a7336-2ad50cba078mr24279015ad.30.1771436919769;\n Wed, 18 Feb 2026 09:48:39 -0800 (PST)"
        ],
        "To": "ovs-dev@openvswitch.org",
        "Date": "Wed, 18 Feb 2026 18:48:27 +0100",
        "Message-ID": "<20260218174827.2241315-1-matteo.perin@canonical.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "Subject": "[ovs-dev] [PATCH] ovs-router: Fix --disable-system-route rules\n filtering.",
        "X-BeenThere": "ovs-dev@openvswitch.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "<ovs-dev.openvswitch.org>",
        "List-Unsubscribe": "<https://mail.openvswitch.org/mailman/options/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=unsubscribe>",
        "List-Archive": "<http://mail.openvswitch.org/pipermail/ovs-dev/>",
        "List-Post": "<mailto:ovs-dev@openvswitch.org>",
        "List-Help": "<mailto:ovs-dev-request@openvswitch.org?subject=help>",
        "List-Subscribe": "<https://mail.openvswitch.org/mailman/listinfo/ovs-dev>,\n <mailto:ovs-dev-request@openvswitch.org?subject=subscribe>",
        "From": "Matteo Perin via dev <ovs-dev@openvswitch.org>",
        "Reply-To": "Matteo Perin <matteo.perin@canonical.com>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "ovs-dev-bounces@openvswitch.org",
        "Sender": "\"dev\" <ovs-dev-bounces@openvswitch.org>"
    },
    "content": "The --disable-system-route option was not fully preventing system routing\nrules from being cached at startup. When route_table_reset() was called,\nit would query all kernel routing rules via RTM_GETRULE and cache them\nwith user=false, regardless of the use_system_routing_table flag.\n\nThis also caused some unit tests to fail if non-standard system routing\nrules were present in the system and would appear in the cache.\n\nAn internal ovs_router_rule_add__() function that unconditionally\nadds routing rules was added, following the same pattern used\nby ovs_router_insert().\n\novs_router_rule_add() was modified to filter system rules based on\nconfiguration and table type:\n- Always allows user-configured rules (user=true)\n- Always allows standard table rules (local/main/default) even when\n  system routing is disabled\n- Only allows non-standard system rules when use_system_routing_table\n  is true\n\nUpdated internal callers (init_standard_rules() and\novs_router_rule_add_cmd()) to use ovs_router_rule_add__() directly,\nensuring standard rules and user-configured rules bypass the filter.\n\nSigned-off-by: Matteo Perin <matteo.perin@canonical.com>\n---\n lib/ovs-router.c | 53 +++++++++++++++++++++++++++++++++---------------\n 1 file changed, 37 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/lib/ovs-router.c b/lib/ovs-router.c\nindex 496690b46..89e5d80b7 100644\n--- a/lib/ovs-router.c\n+++ b/lib/ovs-router.c\n@@ -91,6 +91,10 @@ struct ovs_router_entry {\n };\n \n static void rt_entry_delete__(const struct cls_rule *, struct classifier *);\n+static void ovs_router_rule_add__(uint32_t prio, bool invert, bool user,\n+                                  uint8_t src_len, const struct in6_addr *from,\n+                                  uint32_t lookup_table, bool ipv4)\n+    OVS_REQUIRES(mutex);\n \n static struct classifier *\n cls_find(uint32_t table)\n@@ -1035,7 +1039,7 @@ ovs_router_rule_add_cmd(struct unixctl_conn *conn, int argc OVS_UNUSED,\n             prev_prio = rule->prio;\n         }\n     }\n-    ovs_router_rule_add(prio, invert, true, src_len, &from, table, ipv4);\n+    ovs_router_rule_add__(prio, invert, true, src_len, &from, table, ipv4);\n     ovs_mutex_unlock(&mutex);\n \n     unixctl_command_reply(conn, \"OK\");\n@@ -1219,19 +1223,20 @@ ovs_router_flush(bool flush_all)\n \n static void\n init_standard_rules(void)\n+    OVS_REQUIRES(mutex)\n {\n     /* Add default rules using same priorities as Linux kernel does. */\n-    ovs_router_rule_add(0, false, false, 0,\n-                        &in6addr_v4mapped_any, CLS_LOCAL, true);\n-    ovs_router_rule_add(0x7FFE, false, false, 0,\n-                        &in6addr_v4mapped_any, CLS_MAIN, true);\n-    ovs_router_rule_add(0x7FFF, false, false, 0,\n-                        &in6addr_v4mapped_any, CLS_DEFAULT, true);\n-\n-    ovs_router_rule_add(0, false, false, 0,\n-                        &in6addr_any, CLS_LOCAL, false);\n-    ovs_router_rule_add(0x7FFE, false, false, 0,\n-                        &in6addr_any, CLS_MAIN, false);\n+    ovs_router_rule_add__(0, false, false, 0,\n+                          &in6addr_v4mapped_any, CLS_LOCAL, true);\n+    ovs_router_rule_add__(0x7FFE, false, false, 0,\n+                          &in6addr_v4mapped_any, CLS_MAIN, true);\n+    ovs_router_rule_add__(0x7FFF, false, false, 0,\n+                          &in6addr_v4mapped_any, CLS_DEFAULT, true);\n+\n+    ovs_router_rule_add__(0, false, false, 0,\n+                          &in6addr_any, CLS_LOCAL, false);\n+    ovs_router_rule_add__(0x7FFE, false, false, 0,\n+                          &in6addr_any, CLS_MAIN, false);\n }\n \n static void\n@@ -1307,10 +1312,10 @@ rule_pvec_prio(uint32_t prio)\n     }\n }\n \n-void\n-ovs_router_rule_add(uint32_t prio, bool invert, bool user, uint8_t src_len,\n-                    const struct in6_addr *from, uint32_t lookup_table,\n-                    bool ipv4)\n+static void\n+ovs_router_rule_add__(uint32_t prio, bool invert, bool user, uint8_t src_len,\n+                     const struct in6_addr *from, uint32_t lookup_table,\n+                     bool ipv4)\n     OVS_REQUIRES(mutex)\n {\n     struct router_rule *rule = xzalloc(sizeof *rule);\n@@ -1327,6 +1332,22 @@ ovs_router_rule_add(uint32_t prio, bool invert, bool user, uint8_t src_len,\n     pvector_publish(&rules);\n }\n \n+void\n+ovs_router_rule_add(uint32_t prio, bool invert, bool user, uint8_t src_len,\n+                    const struct in6_addr *from, uint32_t lookup_table,\n+                    bool ipv4)\n+    OVS_REQUIRES(mutex)\n+{\n+    /* Always add user-configured rules.\n+     * For system (non-user) rules, only add if disable-system-route is false\n+     * or it is a standard table rule (local, main, default).\n+     */\n+    if (user || use_system_routing_table || is_standard_table(lookup_table)) {\n+        ovs_router_rule_add__(prio, invert, user, src_len, from, lookup_table,\n+                              ipv4);\n+    }\n+}\n+\n int\n ovs_router_rule_del(uint32_t prio, bool invert, uint8_t src_len,\n                     const struct in6_addr *from, uint32_t lookup_table,\n",
    "prefixes": [
        "ovs-dev"
    ]
}