Commit b522ed6e authored by Alexander Aring's avatar Alexander Aring Committed by David S. Miller

act_ife: use registered ife_type as fallback

This patch handles a default IFE type if it's not given by user space
netlink api. The default IFE type will be the registered ethertype by
IEEE for IFE ForCES.
Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
Acked-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2804fd3a
...@@ -435,8 +435,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, ...@@ -435,8 +435,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
struct nlattr *tb[TCA_IFE_MAX + 1]; struct nlattr *tb[TCA_IFE_MAX + 1];
struct nlattr *tb2[IFE_META_MAX + 1]; struct nlattr *tb2[IFE_META_MAX + 1];
struct tcf_ife_info *ife; struct tcf_ife_info *ife;
u16 ife_type = ETH_P_IFE;
struct tc_ife *parm; struct tc_ife *parm;
u16 ife_type = 0;
u8 *daddr = NULL; u8 *daddr = NULL;
u8 *saddr = NULL; u8 *saddr = NULL;
bool exists = false; bool exists = false;
...@@ -456,18 +456,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, ...@@ -456,18 +456,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
if (exists && bind) if (exists && bind)
return 0; return 0;
if (parm->flags & IFE_ENCODE) {
/* Until we get issued the ethertype, we cant have
* a default..
**/
if (!tb[TCA_IFE_TYPE]) {
if (exists)
tcf_hash_release(*a, bind);
pr_info("You MUST pass etherype for encoding\n");
return -EINVAL;
}
}
if (!exists) { if (!exists) {
ret = tcf_hash_create(tn, parm->index, est, a, &act_ife_ops, ret = tcf_hash_create(tn, parm->index, est, a, &act_ife_ops,
bind, false); bind, false);
...@@ -484,7 +472,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, ...@@ -484,7 +472,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
ife->flags = parm->flags; ife->flags = parm->flags;
if (parm->flags & IFE_ENCODE) { if (parm->flags & IFE_ENCODE) {
ife_type = nla_get_u16(tb[TCA_IFE_TYPE]); if (tb[TCA_IFE_TYPE])
ife_type = nla_get_u16(tb[TCA_IFE_TYPE]);
if (tb[TCA_IFE_DMAC]) if (tb[TCA_IFE_DMAC])
daddr = nla_data(tb[TCA_IFE_DMAC]); daddr = nla_data(tb[TCA_IFE_DMAC]);
if (tb[TCA_IFE_SMAC]) if (tb[TCA_IFE_SMAC])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment