get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2229810,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229810/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/hostap/patch/20260428200639.40243-11-andrei.otcheretianski@intel.com/",
    "project": {
        "id": 22,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/22/?format=api",
        "name": "HostAP Development",
        "link_name": "hostap",
        "list_id": "hostap.lists.infradead.org",
        "list_email": "hostap@lists.infradead.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20260428200639.40243-11-andrei.otcheretianski@intel.com>",
    "date": "2026-04-28T20:05:11",
    "name": "[10/97] NAN: Only remove NDI station when no other NDP uses the same peer NDI",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "593cc340d8956c7473777dfc2232bcb94646b34b",
    "submitter": {
        "id": 62065,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/62065/?format=api",
        "name": "Andrei Otcheretianski",
        "email": "andrei.otcheretianski@intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/hostap/patch/20260428200639.40243-11-andrei.otcheretianski@intel.com/mbox/",
    "series": [
        {
            "id": 501927,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501927/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/hostap/list/?series=501927",
            "date": "2026-04-28T20:05:05",
            "name": "NAN: Group keys support, schedule update and more",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501927/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2229810/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2229810/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "\n <hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=xmah1jq3;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256\n header.s=Intel header.b=E/sPIiJf;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\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 4g4s1b0pp5z1yHv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 06:08:03 +1000 (AEST)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wHoiT-00000002CSl-3dhc;\n\tTue, 28 Apr 2026 20:07:33 +0000",
            "from mgamail.intel.com ([198.175.65.16])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wHoiQ-00000002CHj-0xot\n\tfor hostap@lists.infradead.org;\n\tTue, 28 Apr 2026 20:07:32 +0000",
            "from fmviesa001.fm.intel.com ([10.60.135.141])\n  by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 28 Apr 2026 13:07:31 -0700",
            "from iapp347.iil.intel.com (HELO 87c02287900a.iil.intel.com)\n ([10.167.28.6])\n  by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 28 Apr 2026 13:07:29 -0700"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=hTTGQ6InNcG98LrEhlCbhCGo81Rp8lNTcTf3YTL5Cqw=; b=xmah1jq3Z3wLVM\n\tw7crwk1nLIrzFk/DZzOrT12kcs9Go7NfY6w5kpFMCuIPclmGxAr5VU6Ar16K1wwxh+R7SdvlrmVv4\n\tsepIvzA2YNTGCKJFJzwjlnwxfO9wBYf8P1pqSIpPUxwaGLwIKG2/QyAk9Fo2ZVZhZo5ubrlZaF+x5\n\tbGJ6cOyykDOD1fsBn5pjtfmvWWt0aOVQfTZZ14kSXeK+11Jbft2WnMBxbsxa9xoEv4vjrStgiRPSs\n\tbFbu88VO+J+xk7ykU3iy79JRp++nSfbTJjyRNwAEIuNIYgRpAefkTCUPbOcsQqiLK5kAdbf2PsO1h\n\t9cKqjZyunCoKdekZfnTA==;",
            "v=1; a=rsa-sha256; c=relaxed/simple;\n  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n  t=1777406851; x=1808942851;\n  h=from:to:cc:subject:date:message-id:in-reply-to:\n   references:mime-version:content-transfer-encoding;\n  bh=n0GptkwNW0kohnk3r6AwLX3490uoTLRqHSV4MhTolo0=;\n  b=E/sPIiJf/fkCQNA9fin1V4+fTRvig+x3b3JSV+3rQyJT0V1wMbVkroP8\n   gzhnQWOfmLQN02vsdimt44Ryb4E46Nu7L+DuUpmlyo0cQ6mDmzOnOD9Hc\n   eNW5YuBA+MepIVlL4fxQZE26hjokKoM7OPRyp+Z2+C69dog1Kcv5JmEmN\n   4xbWYUq+UtQwLbClGlDcbUhaZVnVPxqHO+rMXsA8gToZumGvFISsF8sSi\n   zeYUbNC8Ouv0K12jESmpeCJeOg7z0cePDYWDFr8mNfZmxzY/aFaH57mVN\n   /yEnZ4VU5j29UkbL0TpPscC0ln1f/U+TibLxFdVCTrHTktPQHGdxpIfgu\n   g==;"
        ],
        "X-CSE-ConnectionGUID": [
            "1SJqXQguTR+TjwCuWqUp3Q==",
            "yZsIyhz5QEqoIbMyYRfNaA=="
        ],
        "X-CSE-MsgGUID": [
            "d/O9Q3PcTzugiW7HKGYohA==",
            "LNuacfjpSeeybmuvAIYmKg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6800,10657,11770\"; a=\"78519292\"",
            "E=Sophos;i=\"6.23,204,1770624000\";\n   d=\"scan'208\";a=\"78519292\"",
            "E=Sophos;i=\"6.23,204,1770624000\";\n   d=\"scan'208\";a=\"257609971\""
        ],
        "X-ExtLoop1": "1",
        "From": "Andrei Otcheretianski <andrei.otcheretianski@intel.com>",
        "To": "hostap@lists.infradead.org",
        "Cc": "vamsin@qti.qualcomm.com,\n\tmaheshkkv@google.com,\n\tAndrei Otcheretianski <andrei.otcheretianski@intel.com>",
        "Subject": "[PATCH 10/97] NAN: Only remove NDI station when no other NDP uses the\n same peer NDI",
        "Date": "Tue, 28 Apr 2026 23:05:11 +0300",
        "Message-ID": "<20260428200639.40243-11-andrei.otcheretianski@intel.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260428200639.40243-1-andrei.otcheretianski@intel.com>",
        "References": "<20260428200639.40243-1-andrei.otcheretianski@intel.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260428_130730_401716_29C385EC ",
        "X-CRM114-Status": "GOOD (  19.03  )",
        "X-Spam-Score": "-4.5 (----)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  When multiple NDPs share the same peer NDI address,\n terminating\n    one NDP should not remove the NDI station if other NDPs still use it. The\n    nan_peer_ndi_in_use() function is used to check if any other N [...]\n Content analysis details:   (-4.5 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -2.3 RCVD_IN_DNSWL_MED      RBL: Sender listed at https://www.dnswl.org/,\n                             medium trust\n                             [198.175.65.16 listed in list.dnswl.org]\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS               SPF: sender matches SPF record\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n -0.1 DKIMWL_WL_HIGH         DKIMwl.org - High trust sender",
        "X-BeenThere": "hostap@lists.infradead.org",
        "X-Mailman-Version": "2.1.34",
        "Precedence": "list",
        "List-Id": "<hostap.lists.infradead.org>",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/hostap>,\n <mailto:hostap-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/hostap/>",
        "List-Post": "<mailto:hostap@lists.infradead.org>",
        "List-Help": "<mailto:hostap-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/hostap>,\n <mailto:hostap-request@lists.infradead.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Sender": "\"Hostap\" <hostap-bounces@lists.infradead.org>",
        "Errors-To": "hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"
    },
    "content": "When multiple NDPs share the same peer NDI address, terminating one NDP\nshould not remove the NDI station if other NDPs still use it. The\nnan_peer_ndi_in_use() function is used to check if any other NDP is\nusing the same peer NDI address before removing the station.\n\nAdd a remove_sta parameter to the ndp_disconnected callback to indicate\nwhether the NDI station should be removed. This is determined in nan.c\nby checking if any other NDP is using the same peer NDI address.\n\nSigned-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>\n---\n src/nan/nan.c                   | 20 ++++++++++++++++++--\n src/nan/nan.h                   |  4 +++-\n src/nan/nan_module_tests.c      |  4 +++-\n wpa_supplicant/nan_supplicant.c | 30 ++++++++++++++++++------------\n 4 files changed, 42 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/src/nan/nan.c b/src/nan/nan.c\nindex d8d7af8c1d..a885804e8f 100644\n--- a/src/nan/nan.c\n+++ b/src/nan/nan.c\n@@ -1506,6 +1506,7 @@ static void nan_ndp_disconnected(struct nan_data *nan, struct nan_peer *peer,\n {\n \tconst u8 *local_ndi, *peer_ndi;\n \tstruct nan_ndp_id ndp_id;\n+\tbool remove_sta;\n \n \tos_memset(&ndp_id, 0, sizeof(ndp_id));\n \n@@ -1525,10 +1526,17 @@ static void nan_ndp_disconnected(struct nan_data *nan, struct nan_peer *peer,\n \t\tpeer_ndi = peer->ndp_setup.ndp->init_ndi;\n \t}\n \n+\t/*\n+\t * Remove the NDI station only if no other NDP is using the same\n+\t * peer NDI address. The disconnecting NDP is in ndp_setup.ndp\n+\t * (not in peer->ndps), so checking peer->ndps is sufficient.\n+\t */\n+\tremove_sta = !nan_peer_ndi_in_use(peer, peer_ndi);\n+\n \tif (nan->cfg->ndp_disconnected)\n \t\tnan->cfg->ndp_disconnected(nan->cfg->cb_ctx, &ndp_id,\n \t\t\t\t\t   local_ndi, peer_ndi, reason,\n-\t\t\t\t\t   locally_generated);\n+\t\t\t\t\t   locally_generated, remove_sta);\n \n \tnan_ndp_setup_stop(nan, peer);\n }\n@@ -2094,9 +2102,17 @@ void nan_ndp_terminated(struct nan_data *nan, struct nan_peer *peer,\n \t\t\tstruct nan_ndp_id *ndp_id, const u8 *local_ndi,\n \t\t\tconst u8 *peer_ndi, enum nan_reason reason)\n {\n+\t/*\n+\t * Remove the NDI station only if no other NDP is using the same\n+\t * peer NDI address. The terminated NDP has already been removed\n+\t * from peer->ndps before this function is called.\n+\t */\n+\tbool remove_sta = !nan_peer_ndi_in_use(peer, peer_ndi);\n+\n \tif (nan->cfg->ndp_disconnected)\n \t\tnan->cfg->ndp_disconnected(nan->cfg->cb_ctx, ndp_id, local_ndi,\n-\t\t\t\t\t   peer_ndi, reason, false);\n+\t\t\t\t\t   peer_ndi, reason, false,\n+\t\t\t\t\t   remove_sta);\n \n \t/* Need to also remove the NDL if it is not needed */\n \tif (dl_list_empty(&peer->ndps) && !peer->ndp_setup.ndp)\ndiff --git a/src/nan/nan.h b/src/nan/nan.h\nindex d53c7c54d7..1188ffac77 100644\n--- a/src/nan/nan.h\n+++ b/src/nan/nan.h\n@@ -493,6 +493,8 @@ struct nan_config {\n \t * @reason: Disconnection reason\n \t * @locally_generated: true if the disconnection was locally generated,\n \t *     false if triggered by the peer\n+\t * @remove_sta: true if the NDI station should be removed (no other NDPs\n+\t *     using the same peer NDI)\n \t *\n \t * This callback notifies that an NDP has been disconnected. It can be\n \t * called both during NDP establishment (indicating failure) or after\n@@ -501,7 +503,7 @@ struct nan_config {\n \tvoid (*ndp_disconnected)(void *ctx, struct nan_ndp_id *ndp_id,\n \t\t\t\t const u8 *local_ndi, const u8 *peer_ndi,\n \t\t\t\t enum nan_reason reason,\n-\t\t\t\t bool locally_generated);\n+\t\t\t\t bool locally_generated, bool remove_sta);\n \n \t/**\n \t * get_chans - Get the prioritized allowed channel information to be\ndiff --git a/src/nan/nan_module_tests.c b/src/nan/nan_module_tests.c\nindex 30d559642b..9f376278d1 100644\n--- a/src/nan/nan_module_tests.c\n+++ b/src/nan/nan_module_tests.c\n@@ -640,6 +640,7 @@ static int nan_test_ndp_connected_cb(void *ctx,\n  * @peer_ndi: Peer NDI address\n  * @reason: Reason for disconnection\n  * @locally_generated: true if locally generated, false if triggered by peer\n+ * @remove_sta: true if the NDI station should be removed\n  *\n  * The handling of the event is done asynchronously through the NAN test actions\n  * processing.\n@@ -648,7 +649,8 @@ static void nan_test_ndp_disconnected_cb(void *ctx, struct nan_ndp_id *ndp_id,\n \t\t\t\t\t const u8 *local_ndi,\n \t\t\t\t\t const u8 *peer_ndi,\n \t\t\t\t\t enum nan_reason reason,\n-\t\t\t\t\t bool locally_generated)\n+\t\t\t\t\t bool locally_generated,\n+\t\t\t\t\t bool remove_sta)\n {\n \tstruct nan_device *dev = ctx;\n \ndiff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c\nindex 70470a8c9e..e8c5b25c4c 100644\n--- a/wpa_supplicant/nan_supplicant.c\n+++ b/wpa_supplicant/nan_supplicant.c\n@@ -571,7 +571,8 @@ remove_sta:\n \n static void wpas_nan_remove_ndi_sta(struct wpa_supplicant *wpa_s,\n \t\t\t\t    const u8 *local_ndi,\n-\t\t\t\t    const u8 *peer_ndi)\n+\t\t\t\t    const u8 *peer_ndi,\n+\t\t\t\t    bool remove_sta)\n {\n \tstruct wpa_supplicant *ndi_wpa_s;\n \n@@ -583,14 +584,6 @@ static void wpas_nan_remove_ndi_sta(struct wpa_supplicant *wpa_s,\n \t\treturn;\n \t}\n \n-\tif (wpa_drv_sta_set_flags(ndi_wpa_s, peer_ndi, WPA_STA_AUTHORIZED,\n-\t\t\t\t  0, ~WPA_STA_AUTHORIZED))\n-\t\twpa_printf(MSG_DEBUG,\n-\t\t\t   \"NAN: Failed to clear authorized flag for NDI station\");\n-\n-\twpas_nan_remove_ndi_keys(ndi_wpa_s, peer_ndi);\n-\twpa_drv_sta_remove(ndi_wpa_s, peer_ndi);\n-\n \tif (!ndi_wpa_s->nan_ndi_ndp_refcount)\n \t\treturn;\n \n@@ -599,8 +592,20 @@ static void wpas_nan_remove_ndi_sta(struct wpa_supplicant *wpa_s,\n \t\t   MACSTR \")\", ndi_wpa_s->nan_ndi_ndp_refcount,\n \t\t   MAC2STR(peer_ndi));\n \n-\t/* Set operstate DORMANT only when the last NDP is removed from this NDI\n+\t/* Only remove the NDI station if no other NDP is using the same\n+\t * peer NDI address\n \t */\n+\tif (remove_sta) {\n+\t\tif (wpa_drv_sta_set_flags(ndi_wpa_s, peer_ndi, WPA_STA_AUTHORIZED,\n+\t\t\t\t\t  0, ~WPA_STA_AUTHORIZED))\n+\t\t\twpa_printf(MSG_DEBUG,\n+\t\t\t\t   \"NAN: Failed to clear authorized flag for NDI station\");\n+\n+\t\twpas_nan_remove_ndi_keys(ndi_wpa_s, peer_ndi);\n+\t\twpa_drv_sta_remove(ndi_wpa_s, peer_ndi);\n+\t}\n+\n+\t/* Set operstate DORMANT only when last NDP is removed from this NDI */\n \tif (!ndi_wpa_s->nan_ndi_ndp_refcount)\n \t\twpa_drv_set_operstate(ndi_wpa_s, 0);\n }\n@@ -633,11 +638,12 @@ static void wpas_nan_ndp_disconnected_cb(void *ctx, struct nan_ndp_id *ndp_id,\n \t\t\t\t\t const u8 *local_ndi,\n \t\t\t\t\t const u8 *peer_ndi,\n \t\t\t\t\t enum nan_reason reason,\n-\t\t\t\t\t bool locally_generated)\n+\t\t\t\t\t bool locally_generated,\n+\t\t\t\t\t bool remove_sta)\n {\n \tstruct wpa_supplicant *wpa_s = ctx;\n \n-\twpas_nan_remove_ndi_sta(wpa_s, local_ndi, peer_ndi);\n+\twpas_nan_remove_ndi_sta(wpa_s, local_ndi, peer_ndi, remove_sta);\n \twpas_notify_nan_ndp_disconnected(wpa_s, ndp_id->peer_nmi,\n \t\t\t\t\t ndp_id->id, local_ndi, peer_ndi,\n \t\t\t\t\t reason, locally_generated);\n",
    "prefixes": [
        "10/97"
    ]
}