Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: nl80211: ignore cluster id after NAN started

After NAN was started, cluster id updates from the user space should not
happen, since the device already started a cluster with the
previousely provided id.

Since NL80211_CMD_CHANGE_NAN_CONFIG requires to set the full NAN
configuration, we can't require that NL80211_NAN_CONF_CLUSTER_ID won't
be included in this command, and keeping the last confgiured value just
to be able to compare it against the new one seems a bit overkill.

Therefore, just ignore cluster id in this command and clarify the
documentation.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260107142229.fb55e5853269.I10d18c8f69d98b28916596d6da4207c15ea4abb5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

authored by

Miri Korenblit and committed by
Johannes Berg
8a42938a 36e83df3

+9 -6
+3 -1
include/uapi/linux/nl80211.h
··· 11 11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> 12 12 * Copyright 2008 Colin McCabe <colin@cozybit.com> 13 13 * Copyright 2015-2017 Intel Deutschland GmbH 14 - * Copyright (C) 2018-2025 Intel Corporation 14 + * Copyright (C) 2018-2026 Intel Corporation 15 15 * 16 16 * Permission to use, copy, modify, and/or distribute this software for any 17 17 * purpose with or without fee is hereby granted, provided that the above ··· 7454 7454 * address that can take values from 50-6F-9A-01-00-00 to 7455 7455 * 50-6F-9A-01-FF-FF. This attribute is optional. If not present, 7456 7456 * a random Cluster ID will be chosen. 7457 + * This attribute will be ignored in NL80211_CMD_CHANGE_NAN_CONFIG 7458 + * since after NAN was started, the cluster ID can no longer change. 7457 7459 * @NL80211_NAN_CONF_EXTRA_ATTRS: Additional NAN attributes to be 7458 7460 * published in the beacons. This is an optional byte array. 7459 7461 * @NL80211_NAN_CONF_VENDOR_ELEMS: Vendor-specific elements that will
+6 -5
net/wireless/nl80211.c
··· 5 5 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> 6 6 * Copyright 2013-2014 Intel Mobile Communications GmbH 7 7 * Copyright 2015-2017 Intel Deutschland GmbH 8 - * Copyright (C) 2018-2025 Intel Corporation 8 + * Copyright (C) 2018-2026 Intel Corporation 9 9 */ 10 10 11 11 #include <linux/if.h> ··· 15583 15583 static int nl80211_parse_nan_conf(struct wiphy *wiphy, 15584 15584 struct genl_info *info, 15585 15585 struct cfg80211_nan_conf *conf, 15586 - u32 *changed_flags) 15586 + u32 *changed_flags, 15587 + bool start) 15587 15588 { 15588 15589 struct nlattr *attrs[NL80211_NAN_CONF_ATTR_MAX + 1]; 15589 15590 int err, rem; ··· 15631 15630 return err; 15632 15631 15633 15632 changed |= CFG80211_NAN_CONF_CHANGED_CONFIG; 15634 - if (attrs[NL80211_NAN_CONF_CLUSTER_ID]) 15633 + if (attrs[NL80211_NAN_CONF_CLUSTER_ID] && start) 15635 15634 conf->cluster_id = 15636 15635 nla_data(attrs[NL80211_NAN_CONF_CLUSTER_ID]); 15637 15636 ··· 15742 15741 if (!info->attrs[NL80211_ATTR_NAN_MASTER_PREF]) 15743 15742 return -EINVAL; 15744 15743 15745 - err = nl80211_parse_nan_conf(&rdev->wiphy, info, &conf, NULL); 15744 + err = nl80211_parse_nan_conf(&rdev->wiphy, info, &conf, NULL, true); 15746 15745 if (err) 15747 15746 return err; 15748 15747 ··· 16108 16107 if (!wdev_running(wdev)) 16109 16108 return -ENOTCONN; 16110 16109 16111 - err = nl80211_parse_nan_conf(&rdev->wiphy, info, &conf, &changed); 16110 + err = nl80211_parse_nan_conf(&rdev->wiphy, info, &conf, &changed, false); 16112 16111 if (err) 16113 16112 return err; 16114 16113