Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171684
b: refs/heads/master
c: 8b78764
h: refs/heads/master
v: v3
  • Loading branch information
Felix Fietkau authored and John W. Linville committed Nov 11, 2009
1 parent d6f2ffb commit 796e329
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1460dd158a520447b87661aea4afda1997d69cde
refs/heads/master: 8b787643ca0a5130c647109d77fe512f89cfa611
4 changes: 4 additions & 0 deletions trunk/include/linux/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ enum nl80211_commands {
* changed then the list changed and the dump should be repeated
* completely from scratch.
*
* @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface
*
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
Expand Down Expand Up @@ -714,6 +716,8 @@ enum nl80211_attrs {

NL80211_ATTR_PID,

NL80211_ATTR_4ADDR,

/* add attributes here, update the policy in nl80211.c */

__NL80211_ATTR_AFTER_LAST,
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,12 @@ struct ieee80211_supported_band {
* struct vif_params - describes virtual interface parameters
* @mesh_id: mesh ID to use
* @mesh_id_len: length of the mesh ID
* @use_4addr: use 4-address frames
*/
struct vif_params {
u8 *mesh_id;
int mesh_id_len;
int use_4addr;
};

/**
Expand Down
11 changes: 11 additions & 0 deletions trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ static struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] __read_mostly = {
[NL80211_ATTR_CIPHER_SUITE_GROUP] = { .type = NLA_U32 },
[NL80211_ATTR_WPA_VERSIONS] = { .type = NLA_U32 },
[NL80211_ATTR_PID] = { .type = NLA_U32 },
[NL80211_ATTR_4ADDR] = { .type = NLA_U8 },
};

/* policy for the attributes */
Expand Down Expand Up @@ -987,6 +988,13 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
change = true;
}

if (info->attrs[NL80211_ATTR_4ADDR]) {
params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]);
change = true;
} else {
params.use_4addr = -1;
}

if (info->attrs[NL80211_ATTR_MNTR_FLAGS]) {
if (ntype != NL80211_IFTYPE_MONITOR) {
err = -EINVAL;
Expand Down Expand Up @@ -1053,6 +1061,9 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info)
params.mesh_id_len = nla_len(info->attrs[NL80211_ATTR_MESH_ID]);
}

if (info->attrs[NL80211_ATTR_4ADDR])
params.use_4addr = !!nla_get_u8(info->attrs[NL80211_ATTR_4ADDR]);

err = parse_monitor_flags(type == NL80211_IFTYPE_MONITOR ?
info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL,
&flags);
Expand Down

0 comments on commit 796e329

Please sign in to comment.