Skip to content

Commit adbfb05

Browse files
mcgrofjmberg-intel
authored andcommitted
cfg80211: intersection dfs regions when intersecting regdomains
Only allow DFS to be set if the DFS regions agree. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 4c7d398 commit adbfb05

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎net/wireless/reg.c‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,20 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range,
570570
#undef ONE_GHZ_IN_KHZ
571571
}
572572

573+
/*
574+
* Later on we can perhaps use the more restrictive DFS
575+
* region but we don't have information for that yet so
576+
* for now simply disallow conflicts.
577+
*/
578+
static enum nl80211_dfs_regions
579+
reg_intersect_dfs_region(const enum nl80211_dfs_regions dfs_region1,
580+
const enum nl80211_dfs_regions dfs_region2)
581+
{
582+
if (dfs_region1 != dfs_region2)
583+
return NL80211_DFS_UNSET;
584+
return dfs_region1;
585+
}
586+
573587
/*
574588
* Helper for regdom_intersect(), this does the real
575589
* mathematical intersection fun
@@ -701,6 +715,8 @@ regdom_intersect(const struct ieee80211_regdomain *rd1,
701715
rd->n_reg_rules = num_rules;
702716
rd->alpha2[0] = '9';
703717
rd->alpha2[1] = '8';
718+
rd->dfs_region = reg_intersect_dfs_region(rd1->dfs_region,
719+
rd2->dfs_region);
704720

705721
return rd;
706722
}

0 commit comments

Comments
 (0)