Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 327374
b: refs/heads/master
c: 6982163
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Aug 4, 2012
1 parent 02e9484 commit 57944e6
Show file tree
Hide file tree
Showing 3 changed files with 15 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: 4778e0be16c291ba6d9d55eeff3a6764fc84a071
refs/heads/master: 69821638b27407d8648cb04de01b06b30a291bde
12 changes: 12 additions & 0 deletions trunk/drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,12 @@ static int team_nl_fill_one_option_get(struct sk_buff *skb, struct team *team,
nla_put_flag(skb, TEAM_ATTR_OPTION_DATA))
goto nest_cancel;
break;
case TEAM_OPTION_TYPE_S32:
if (nla_put_u8(skb, TEAM_ATTR_OPTION_TYPE, NLA_S32))
goto nest_cancel;
if (nla_put_s32(skb, TEAM_ATTR_OPTION_DATA, ctx.data.s32_val))
goto nest_cancel;
break;
default:
BUG();
}
Expand Down Expand Up @@ -1975,6 +1981,9 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
case NLA_FLAG:
opt_type = TEAM_OPTION_TYPE_BOOL;
break;
case NLA_S32:
opt_type = TEAM_OPTION_TYPE_S32;
break;
default:
goto team_put;
}
Expand Down Expand Up @@ -2031,6 +2040,9 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info)
case TEAM_OPTION_TYPE_BOOL:
ctx.data.bool_val = attr_data ? true : false;
break;
case TEAM_OPTION_TYPE_S32:
ctx.data.s32_val = nla_get_s32(attr_data);
break;
default:
BUG();
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/if_team.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ enum team_option_type {
TEAM_OPTION_TYPE_STRING,
TEAM_OPTION_TYPE_BINARY,
TEAM_OPTION_TYPE_BOOL,
TEAM_OPTION_TYPE_S32,
};

struct team_option_inst_info {
Expand All @@ -146,6 +147,7 @@ struct team_gsetter_ctx {
u32 len;
} bin_val;
bool bool_val;
s32 s32_val;
} data;
struct team_option_inst_info *info;
};
Expand Down

0 comments on commit 57944e6

Please sign in to comment.