diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-13 18:33:35 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-27 15:24:07 -0400 |
commit | 463d018323851a608eef52a9427b0585005c647f (patch) | |
tree | b5ad2ee6115e6b780c264022cbc20b36d22fe80c /include/linux | |
parent | 5061b0c2b9066de426fbc63f1278d2210e789412 (diff) |
cfg80211: make aware of net namespaces
In order to make cfg80211/nl80211 aware of network namespaces,
we have to do the following things:
* del_virtual_intf method takes an interface index rather
than a netdev pointer - simply change this
* nl80211 uses init_net a lot, it changes to use the sender's
network namespace
* scan requests use the interface index, hold a netdev pointer
and reference instead
* we want a wiphy and its associated virtual interfaces to be
in one netns together, so
- we need to be able to change ns for a given interface, so
export dev_change_net_namespace()
- for each virtual interface set the NETIF_F_NETNS_LOCAL
flag, and clear that flag only when the wiphy changes ns,
to disallow breaking this invariant
* when a network namespace goes away, we need to reparent the
wiphy to init_net
* cfg80211 users that support creating virtual interfaces must
create them in the wiphy's namespace, currently this affects
only mac80211
The end result is that you can now switch an entire wiphy into
a different network namespace with the new command
iw phy#<idx> set netns <pid>
and all virtual interfaces will follow (or the operation fails).
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/nl80211.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 962e2232a074..cb3dc6027fd9 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -262,6 +262,9 @@ | |||
262 | * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and | 262 | * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and |
263 | * %NL80211_ATTR_REASON_CODE attributes are used. | 263 | * %NL80211_ATTR_REASON_CODE attributes are used. |
264 | * | 264 | * |
265 | * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices | ||
266 | * associated with this wiphy must be down and will follow. | ||
267 | * | ||
265 | * @NL80211_CMD_MAX: highest used command number | 268 | * @NL80211_CMD_MAX: highest used command number |
266 | * @__NL80211_CMD_AFTER_LAST: internal use | 269 | * @__NL80211_CMD_AFTER_LAST: internal use |
267 | */ | 270 | */ |
@@ -336,6 +339,8 @@ enum nl80211_commands { | |||
336 | NL80211_CMD_ROAM, | 339 | NL80211_CMD_ROAM, |
337 | NL80211_CMD_DISCONNECT, | 340 | NL80211_CMD_DISCONNECT, |
338 | 341 | ||
342 | NL80211_CMD_SET_WIPHY_NETNS, | ||
343 | |||
339 | /* add new commands above here */ | 344 | /* add new commands above here */ |
340 | 345 | ||
341 | /* used to define NL80211_CMD_MAX below */ | 346 | /* used to define NL80211_CMD_MAX below */ |
@@ -573,6 +578,8 @@ enum nl80211_commands { | |||
573 | * and join_ibss(), key information is in a nested attribute each | 578 | * and join_ibss(), key information is in a nested attribute each |
574 | * with %NL80211_KEY_* sub-attributes | 579 | * with %NL80211_KEY_* sub-attributes |
575 | * | 580 | * |
581 | * @NL80211_ATTR_PID: Process ID of a network namespace. | ||
582 | * | ||
576 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 583 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
577 | * @__NL80211_ATTR_AFTER_LAST: internal use | 584 | * @__NL80211_ATTR_AFTER_LAST: internal use |
578 | */ | 585 | */ |
@@ -701,6 +708,8 @@ enum nl80211_attrs { | |||
701 | NL80211_ATTR_KEY, | 708 | NL80211_ATTR_KEY, |
702 | NL80211_ATTR_KEYS, | 709 | NL80211_ATTR_KEYS, |
703 | 710 | ||
711 | NL80211_ATTR_PID, | ||
712 | |||
704 | /* add attributes here, update the policy in nl80211.c */ | 713 | /* add attributes here, update the policy in nl80211.c */ |
705 | 714 | ||
706 | __NL80211_ATTR_AFTER_LAST, | 715 | __NL80211_ATTR_AFTER_LAST, |