get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2229877,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229877/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/hostap/patch/20260428200639.40243-70-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-70-andrei.otcheretianski@intel.com>",
    "date": "2026-04-28T20:06:10",
    "name": "[69/97] wpa_supplicant: Request a deferred NAN schedule if there are active NDPs",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "5baf18d9b74f57a42b13067dfa02627adecfbac1",
    "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-70-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/2229877/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2229877/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=KFnrvrIZ;\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=JBSYFUl2;\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 4g4s8b718lz1xrS\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 06:14:07 +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 1wHooG-00000002KO9-3KGt;\n\tTue, 28 Apr 2026 20:13:32 +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 1wHokY-00000002CcZ-25Y6\n\tfor hostap@lists.infradead.org;\n\tTue, 28 Apr 2026 20:09:54 +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:09:01 -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:09:00 -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=oKvbalLWWNxXxKP2x3ntgFRzlfS/eWHcdP6TczC9+Rs=; b=KFnrvrIZQbuK5z\n\tjRIEite3bfHMLVWwW6hdWWYKxPlSZwimPM6dCL3Pyax2zfEx1dcIvtNnOYJnkhnkUyFtOioZA/r82\n\tRpQwfd3ygNOzRq7sYz1hY4qV3jhhftiXvRqGAtPIigzt6EmPQpmXE+y/2SMgBa5dyaoQQuMfdZe2b\n\t5zqUNUeQDBBQwF4GQTmT0CaPAKmS+Rm5X711FlWTCA2b6lyd/35Kjejv+xiY1sJRleGU9j5C/2Lti\n\t6aGfWjSjd7PWn7adg3xwG67cGMtdk0OwBBROocnjOstgxeSvmFoiTh4pDH29eUqsdGcNsf5+sqan5\n\tykdM1kcbH+iqXReQjfbg==;",
            "v=1; a=rsa-sha256; c=relaxed/simple;\n  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n  t=1777406982; x=1808942982;\n  h=from:to:cc:subject:date:message-id:in-reply-to:\n   references:mime-version:content-transfer-encoding;\n  bh=ZybPj3gQRrPEFQDIs38ctAR5lZGVkMRmkj6kByGVcMg=;\n  b=JBSYFUl2A2Nm+dsqS0Xj0wGIRS7R2yYbtkw794fliD6+1pjfL/zJTdbi\n   1ttxQNybCNp201jxAv6er3sW0VIKpPV2j+e43z/6PSE6IIhI0JsqgJLwK\n   C/6WcKjoA/VEk5HXE/iHC0kvwYbDmUeDyeXmCg0bV7YoUo6w6HZRvgXfy\n   jtGaWjFRPo84iez54JufnKzPb7iGvfpjL7/tnJN9RMvixB7tsdI01g4PQ\n   js3Hmdfxm+zpKO1gY4uBNWrKS9G3909GlqD0Ec3SV44T1pywSfRNyWLhQ\n   elWIl6vNvvxG+TBPDIexpcAMyGx80Vf+aXlyg09oqMH48cHimkVIZYIKe\n   g==;"
        ],
        "X-CSE-ConnectionGUID": [
            "c+HpM7nNRKuEwvyYP+O7Qw==",
            "7fnEC41sTDKkVzUjIMLMxg=="
        ],
        "X-CSE-MsgGUID": [
            "1ahMapAYQHKLs0RN+xfm+g==",
            "WFraXT1hQ1ix+ktLwAXhcw=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6800,10657,11770\"; a=\"78519512\"",
            "E=Sophos;i=\"6.23,204,1770624000\";\n   d=\"scan'208\";a=\"78519512\"",
            "E=Sophos;i=\"6.23,204,1770624000\";\n   d=\"scan'208\";a=\"257610716\""
        ],
        "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\tAvraham Stern <avraham.stern@intel.com>",
        "Subject": "[PATCH 69/97] wpa_supplicant: Request a deferred NAN schedule if\n there are active NDPs",
        "Date": "Tue, 28 Apr 2026 23:06:10 +0300",
        "Message-ID": "<20260428200639.40243-70-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_130942_737072_B018B01F ",
        "X-CRM114-Status": "GOOD (  19.48  )",
        "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:  From: Avraham Stern <avraham.stern@intel.com> When a new\n NAN\n    schedule is configured and there are active NDPs,\n request a deferred schedule.\n    When a deferred NAN schedule is requested,\n the previous schedule will still\n    be used (e.g. when advertising [...]\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": "From: Avraham Stern <avraham.stern@intel.com>\n\nWhen a new NAN schedule is configured and there are active NDPs,\nrequest a deferred schedule. When a deferred NAN schedule\nis requested, the previous schedule will still be used (e.g. when\nadvertising the device availability) until the driver notifies that\nthe new schedule is applied. Handling this notification will be added\nin a later patch.\n\nSigned-off-by: Avraham Stern <avraham.stern@intel.com>\n---\n wpa_supplicant/nan_supplicant.c   | 110 ++++++++++++++++++------------\n wpa_supplicant/wpa_supplicant_i.h |   4 ++\n 2 files changed, 70 insertions(+), 44 deletions(-)",
    "diff": "diff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c\nindex f54304345b..116189fc91 100644\n--- a/wpa_supplicant/nan_supplicant.c\n+++ b/wpa_supplicant/nan_supplicant.c\n@@ -1466,6 +1466,8 @@ void wpas_nan_deinit(struct wpa_supplicant *wpa_s)\n \tos_free(wpa_s->nan_disallowed_freqs.range);\n \tos_memset(&wpa_s->nan_disallowed_freqs, 0,\n \t\t  sizeof(wpa_s->nan_disallowed_freqs));\n+\tclear_sched_config(&wpa_s->nan_sched_update.sched);\n+\n \twpa_s->nan = NULL;\n }\n \n@@ -1890,7 +1892,7 @@ static void wpas_nan_fill_ndp_schedule(struct wpa_supplicant *wpa_s,\n  * If no bitmaps provided - clear the map */\n int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd)\n {\n-\tstruct nan_schedule_config sched_cfg;\n+\tstruct nan_schedule_config *sched_cfg = &wpa_s->nan_sched_update.sched;\n \tstruct nan_schedule_config old_sched_cfg;\n \tstruct nan_schedule sched;\n \tchar *token, *context = NULL;\n@@ -1904,6 +1906,12 @@ int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd)\n \tif (!wpas_nan_ndp_allowed(wpa_s))\n \t\treturn -1;\n \n+\tif (sched_cfg->deferred) {\n+\t\twpa_printf(MSG_DEBUG,\n+\t\t\t   \"NAN: Previous schedule update is still pending\");\n+\t\treturn -1;\n+\t}\n+\n \tif (os_strncmp(cmd, \"map_id=\", 7) != 0) {\n \t\twpa_printf(MSG_INFO, \"NAN: Invalid schedule map format\");\n \t\treturn -1;\n@@ -1933,14 +1941,14 @@ int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd)\n \texpected_bitmap_len = (wpa_s->nan_capa.schedule_period /\n \t\t\t       wpa_s->nan_capa.slot_duration + 7) / 8;\n \n-\tos_memset(&sched_cfg, 0, sizeof(sched_cfg));\n+\tos_memset(sched_cfg, 0, sizeof(*sched_cfg));\n \n \tpos = os_strchr(cmd + 7, ' ');\n \tif (!pos) {\n \t\tclear_sched_config(&wpa_s->nan_sched[map_id - 1]);\n \t\twpa_printf(MSG_INFO,\n \t\t\t   \"NAN: Missing freq:timebitmap pairs - cleanup schedule\");\n-\t\treturn wpa_drv_nan_config_schedule(wpa_s, map_id, &sched_cfg);\n+\t\treturn wpa_drv_nan_config_schedule(wpa_s, map_id, sched_cfg);\n \t}\n \n \tshared_freqs = os_calloc(wpa_s->num_multichan_concurrent,\n@@ -1969,7 +1977,7 @@ int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd)\n \t/* Parse freq:timebitmap pairs */\n \tpos++;\n \twhile ((token = str_token(pos, \" \", &context))) {\n-\t\tint j, i = sched_cfg.num_channels;;\n+\t\tint j, i = sched_cfg->num_channels;\n \t\tstruct bitfield *bf_chan = NULL;\n \t\tchar *colon = os_strchr(token, ':');\n \t\tstruct nan_sched_chan chan;\n@@ -1988,67 +1996,68 @@ int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd)\n \t\t\tgoto out;\n \t\t}\n \n-\t\tsched_cfg.channels[i].freq = atoi(token);\n-\t\tif (sched_cfg.channels[i].freq <= 0) {\n+\t\tsched_cfg->channels[i].freq = atoi(token);\n+\t\tif (sched_cfg->channels[i].freq <= 0) {\n \t\t\twpa_printf(MSG_INFO, \"NAN: Invalid frequency %d\",\n-\t\t\t\t   sched_cfg.channels[i].freq);\n+\t\t\t\t   sched_cfg->channels[i].freq);\n \t\t\tgoto out;\n \t\t}\n \n \t\tfor (j = 0; j < i; j++) {\n-\t\t\tif (sched_cfg.channels[j].freq ==\n-\t\t\t    sched_cfg.channels[i].freq) {\n+\t\t\tif (sched_cfg->channels[j].freq ==\n+\t\t\t    sched_cfg->channels[i].freq) {\n \t\t\t\twpa_printf(MSG_INFO,\n \t\t\t\t\t   \"NAN: Duplicate frequency %d\",\n-\t\t\t\t\t   sched_cfg.channels[i].freq);\n+\t\t\t\t\t   sched_cfg->channels[i].freq);\n \t\t\t\tgoto out;\n \t\t\t}\n \t\t}\n \n \t\tif (wpas_nan_select_channel_params(\n-\t\t\t    wpa_s, sched_cfg.channels[i].freq,\n-\t\t\t    &sched_cfg.channels[i].center_freq1,\n-\t\t\t    &sched_cfg.channels[i].center_freq2,\n-\t\t\t    &sched_cfg.channels[i].bandwidth)) {\n+\t\t\t    wpa_s, sched_cfg->channels[i].freq,\n+\t\t\t    &sched_cfg->channels[i].center_freq1,\n+\t\t\t    &sched_cfg->channels[i].center_freq2,\n+\t\t\t    &sched_cfg->channels[i].bandwidth)) {\n \t\t\twpa_printf(MSG_INFO,\n \t\t\t\t   \"NAN: Failed to select channel params for freq %d\",\n-\t\t\t\t   sched_cfg.channels[i].freq);\n+\t\t\t\t   sched_cfg->channels[i].freq);\n \t\t\tgoto out;\n \t\t}\n \n \t\tif (!int_array_includes(shared_freqs,\n-\t\t\t\t\tsched_cfg.channels[i].freq)) {\n+\t\t\t\t\tsched_cfg->channels[i].freq)) {\n \t\t\tif (!unused_freqs_count) {\n \t\t\t\twpa_printf(MSG_INFO,\n \t\t\t\t\t   \"NAN: No unused radio frequency available for freq %d\",\n-\t\t\t\t\t   sched_cfg.channels[i].freq);\n+\t\t\t\t\t   sched_cfg->channels[i].freq);\n \t\t\t\tgoto out;\n \t\t\t}\n \n \t\t\tunused_freqs_count--;\n \t\t}\n \n-\t\tsched_cfg.channels[i].time_bitmap = wpabuf_parse_bin(colon + 1);\n-\t\tif (!sched_cfg.channels[i].time_bitmap) {\n+\t\tsched_cfg->channels[i].time_bitmap =\n+\t\t\twpabuf_parse_bin(colon + 1);\n+\t\tif (!sched_cfg->channels[i].time_bitmap) {\n \t\t\twpa_printf(MSG_INFO, \"NAN: Invalid time bitmap\");\n \t\t\tgoto out;\n \t\t}\n \n-\t\tsched_cfg.num_channels++;\n+\t\tsched_cfg->num_channels++;\n \n-\t\tif (wpabuf_len(sched_cfg.channels[i].time_bitmap) !=\n+\t\tif (wpabuf_len(sched_cfg->channels[i].time_bitmap) !=\n \t\t    expected_bitmap_len) {\n \t\t\twpa_printf(MSG_INFO,\n \t\t\t\t   \"NAN: Invalid bitmap length (%zu) for period=%d, slot length=%d\",\n-\t\t\t\t   wpabuf_len(sched_cfg.channels[i].time_bitmap),\n+\t\t\t\t   wpabuf_len(sched_cfg->channels[i].time_bitmap),\n \t\t\t\t   wpa_s->nan_capa.schedule_period,\n \t\t\t\t   wpa_s->nan_capa.slot_duration);\n \t\t\tgoto out;\n \t\t}\n \n \t\tbf_chan = bitfield_alloc_data(\n-\t\t\twpabuf_head(sched_cfg.channels[i].time_bitmap),\n-\t\t\twpabuf_len(sched_cfg.channels[i].time_bitmap));\n+\t\t\twpabuf_head(sched_cfg->channels[i].time_bitmap),\n+\t\t\twpabuf_len(sched_cfg->channels[i].time_bitmap));\n \t\tif (!bf_chan) {\n \t\t\twpa_printf(MSG_INFO,\n \t\t\t\t   \"NAN: Failed to allocate bitfield for channel schedule\");\n@@ -2058,34 +2067,34 @@ int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd)\n \t\tif (bitfield_intersects(bf_total, bf_chan)) {\n \t\t\twpa_printf(MSG_INFO,\n \t\t\t\t   \"NAN: Overlapping time bitmap detected for freq %d\",\n-\t\t\t\t   sched_cfg.channels[i].freq);\n+\t\t\t\t   sched_cfg->channels[i].freq);\n \t\t\tbitfield_free(bf_chan);\n \t\t\tgoto out;\n \t\t}\n \n \t\t/* Extract RX NSS from upper nibble of num_antennas */\n-\t\tsched_cfg.channels[i].rx_nss =\n+\t\tsched_cfg->channels[i].rx_nss =\n \t\t\t(wpa_s->nan_capa.num_antennas >> 4) & 0x0f;\n \n \t\tbitfield_union_in_place(bf_total, bf_chan);\n \t\tbitfield_free(bf_chan);\n \n-\t\tchan.freq = sched_cfg.channels[i].freq;\n-\t\tchan.center_freq1 = sched_cfg.channels[i].center_freq1;\n-\t\tchan.center_freq2 = sched_cfg.channels[i].center_freq2;\n-\t\tchan.bandwidth = sched_cfg.channels[i].bandwidth;\n+\t\tchan.freq = sched_cfg->channels[i].freq;\n+\t\tchan.center_freq1 = sched_cfg->channels[i].center_freq1;\n+\t\tchan.center_freq2 = sched_cfg->channels[i].center_freq2;\n+\t\tchan.bandwidth = sched_cfg->channels[i].bandwidth;\n \t\tchan_entry = (struct nan_chan_entry *)\n-\t\t\t&sched_cfg.channels[i].chan_entry;\n+\t\t\t&sched_cfg->channels[i].chan_entry;\n \t\tif (nan_get_chan_entry(wpa_s->nan, &chan, chan_entry)) {\n \t\t\twpa_printf(MSG_INFO,\n \t\t\t\t   \"NAN: Failed to get channel entry for freq %d\",\n-\t\t\t\t   sched_cfg.channels[i].freq);\n+\t\t\t\t   sched_cfg->channels[i].freq);\n \t\t\tgoto out;\n \t\t}\n \t}\n \n-\tsched_cfg.avail_attr = wpabuf_alloc(NAN_AVAIL_ATTR_MAX_LEN);\n-\tif (!sched_cfg.avail_attr) {\n+\tsched_cfg->avail_attr = wpabuf_alloc(NAN_AVAIL_ATTR_MAX_LEN);\n+\tif (!sched_cfg->avail_attr) {\n \t\twpa_printf(MSG_INFO,\n \t\t\t   \"NAN: Failed to allocate memory for Availability attribute\");\n \t\tret = -1;\n@@ -2096,26 +2105,34 @@ int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd)\n \tos_memcpy(&old_sched_cfg, &wpa_s->nan_sched[map_id - 1],\n \t\t  sizeof(old_sched_cfg));\n \n-\tos_memcpy(&wpa_s->nan_sched[map_id - 1], &sched_cfg, sizeof(sched_cfg));\n+\tos_memcpy(&wpa_s->nan_sched[map_id - 1], sched_cfg, sizeof(*sched_cfg));\n \twpas_nan_fill_ndp_schedule(wpa_s, &sched);\n \n \tret = nan_convert_sched_to_avail_attrs(wpa_s->nan,\n \t\t\t\t\t       wpa_s->schedule_sequence_id + 1,\n \t\t\t\t\t       BIT(map_id),\n \t\t\t\t\t       sched.n_chans, sched.chans,\n-\t\t\t\t\t       sched_cfg.avail_attr,\n+\t\t\t\t\t       sched_cfg->avail_attr,\n \t\t\t\t\t       false);\n+\n+\t/* Restore previous schedule configuration */\n+\tos_memcpy(&wpa_s->nan_sched[map_id - 1], &old_sched_cfg,\n+\t\t  sizeof(old_sched_cfg));\n \tif (ret < 0) {\n \t\twpa_printf(MSG_INFO,\n \t\t\t   \"NAN: Failed to convert schedule to Availability Attributes for map_id %d\",\n \t\t\t   map_id);\n-\t\tos_memcpy(&wpa_s->nan_sched[map_id - 1], &old_sched_cfg,\n-\t\t\t  sizeof(old_sched_cfg));\n \t\tgoto out;\n \t}\n \n-\tnan_dump_sched_config(\"NAN: Set schedule config\", &sched_cfg);\n-\tret = wpa_drv_nan_config_schedule(wpa_s, map_id, &sched_cfg);\n+\tif (nan_has_active_ndp(wpa_s->nan)) {\n+\t\twpa_printf(MSG_DEBUG, \"NAN: Set schedule config as deferred\");\n+\t\tsched_cfg->deferred = true;\n+\t\twpa_s->nan_sched_update.map_id = map_id;\n+\t}\n+\n+\tnan_dump_sched_config(\"NAN: Set schedule config\", sched_cfg);\n+\tret = wpa_drv_nan_config_schedule(wpa_s, map_id, sched_cfg);\n \tif (ret < 0) {\n \t\twpa_printf(MSG_INFO,\n \t\t\t   \"NAN: Failed to configure NAN schedule map_id %d\",\n@@ -2125,14 +2142,19 @@ int wpas_nan_sched_config_map(struct wpa_supplicant *wpa_s, const char *cmd)\n \t\tgoto out;\n \t}\n \n-\t/* Free the old schedule and keep the new one (already stored) */\n-\twpa_s->schedule_sequence_id++;\n-\tclear_sched_config(&old_sched_cfg);\n+\tif (!sched_cfg->deferred) {\n+\t\t/* Store the configured schedule */\n+\t\twpa_s->schedule_sequence_id++;\n+\t\tclear_sched_config(&wpa_s->nan_sched[map_id - 1]);\n+\t\tos_memcpy(&wpa_s->nan_sched[map_id - 1], sched_cfg,\n+\t\t\t  sizeof(*sched_cfg));\n+\t\tos_memset(sched_cfg, 0, sizeof(*sched_cfg));\n+\t}\n out:\n \tos_free(bf_total);\n \tos_free(shared_freqs);\n \tif (ret)\n-\t\tclear_sched_config(&sched_cfg);\n+\t\tclear_sched_config(sched_cfg);\n \n \treturn ret;\n }\ndiff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h\nindex 17a55f0db7..45a70fbead 100644\n--- a/wpa_supplicant/wpa_supplicant_i.h\n+++ b/wpa_supplicant/wpa_supplicant_i.h\n@@ -1736,6 +1736,10 @@ struct wpa_supplicant {\n \tu8 schedule_sequence_id;\n \tstruct nan_schedule_config nan_sched[MAX_NAN_RADIOS];\n \tu16 nan_supported_csids;\n+\tstruct nan_schedule_update {\n+\t\tstruct nan_schedule_config sched;\n+\t\tu8 map_id;\n+\t} nan_sched_update;\n \tstruct wpa_freq_range_list nan_disallowed_freqs;\n \tu16 nan_max_bw;\n \tunsigned int nan_ndi_ndp_refcount; /* Active NDP count on this NDI */\n",
    "prefixes": [
        "69/97"
    ]
}