* Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
* Copyright 2008 Colin McCabe <colin@cozybit.com>
* Copyright 2015-2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2025 Intel Corporation
+ * Copyright (C) 2018-2026 Intel Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* address that can take values from 50-6F-9A-01-00-00 to
* 50-6F-9A-01-FF-FF. This attribute is optional. If not present,
* a random Cluster ID will be chosen.
+ * This attribute will be ignored in NL80211_CMD_CHANGE_NAN_CONFIG
+ * since after NAN was started, the cluster ID can no longer change.
* @NL80211_NAN_CONF_EXTRA_ATTRS: Additional NAN attributes to be
* published in the beacons. This is an optional byte array.
* @NL80211_NAN_CONF_VENDOR_ELEMS: Vendor-specific elements that will
* Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
* Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright 2015-2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2025 Intel Corporation
+ * Copyright (C) 2018-2026 Intel Corporation
*/
#include <linux/if.h>
static int nl80211_parse_nan_conf(struct wiphy *wiphy,
struct genl_info *info,
struct cfg80211_nan_conf *conf,
- u32 *changed_flags)
+ u32 *changed_flags,
+ bool start)
{
struct nlattr *attrs[NL80211_NAN_CONF_ATTR_MAX + 1];
int err, rem;
return err;
changed |= CFG80211_NAN_CONF_CHANGED_CONFIG;
- if (attrs[NL80211_NAN_CONF_CLUSTER_ID])
+ if (attrs[NL80211_NAN_CONF_CLUSTER_ID] && start)
conf->cluster_id =
nla_data(attrs[NL80211_NAN_CONF_CLUSTER_ID]);
if (!info->attrs[NL80211_ATTR_NAN_MASTER_PREF])
return -EINVAL;
- err = nl80211_parse_nan_conf(&rdev->wiphy, info, &conf, NULL);
+ err = nl80211_parse_nan_conf(&rdev->wiphy, info, &conf, NULL, true);
if (err)
return err;
if (!wdev_running(wdev))
return -ENOTCONN;
- err = nl80211_parse_nan_conf(&rdev->wiphy, info, &conf, &changed);
+ err = nl80211_parse_nan_conf(&rdev->wiphy, info, &conf, &changed, false);
if (err)
return err;