Commit 9aa340a5 authored by David S. Miller's avatar David S. Miller

Merge branch 'cls_flower-act_tunnel_key-fixes'

Or Gerlitz says:

====================
net/sched fixes for cls_flower and act_tunnel_key

This small series contain a fix to the matching flags support
in flower and to the tunnel key action MD prep for IPv6.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 567be786 d9724772
...@@ -134,8 +134,8 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla, ...@@ -134,8 +134,8 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
saddr = nla_get_in6_addr(tb[TCA_TUNNEL_KEY_ENC_IPV6_SRC]); saddr = nla_get_in6_addr(tb[TCA_TUNNEL_KEY_ENC_IPV6_SRC]);
daddr = nla_get_in6_addr(tb[TCA_TUNNEL_KEY_ENC_IPV6_DST]); daddr = nla_get_in6_addr(tb[TCA_TUNNEL_KEY_ENC_IPV6_DST]);
metadata = __ipv6_tun_set_dst(&saddr, &daddr, 0, 0, 0, metadata = __ipv6_tun_set_dst(&saddr, &daddr, 0, 0, dst_port,
dst_port, TUNNEL_KEY, 0, TUNNEL_KEY,
key_id, 0); key_id, 0);
} }
......
...@@ -442,19 +442,16 @@ static void fl_set_key_flag(u32 flower_key, u32 flower_mask, ...@@ -442,19 +442,16 @@ static void fl_set_key_flag(u32 flower_key, u32 flower_mask,
} }
} }
static void fl_set_key_flags(struct nlattr **tb, static int fl_set_key_flags(struct nlattr **tb,
u32 *flags_key, u32 *flags_mask) u32 *flags_key, u32 *flags_mask)
{ {
u32 key, mask; u32 key, mask;
if (!tb[TCA_FLOWER_KEY_FLAGS]) /* mask is mandatory for flags */
return; if (!tb[TCA_FLOWER_KEY_FLAGS_MASK])
return -EINVAL;
key = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS])); key = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS]));
if (!tb[TCA_FLOWER_KEY_FLAGS_MASK])
mask = ~0;
else
mask = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS_MASK])); mask = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS_MASK]));
*flags_key = 0; *flags_key = 0;
...@@ -462,12 +459,15 @@ static void fl_set_key_flags(struct nlattr **tb, ...@@ -462,12 +459,15 @@ static void fl_set_key_flags(struct nlattr **tb,
fl_set_key_flag(key, mask, flags_key, flags_mask, fl_set_key_flag(key, mask, flags_key, flags_mask,
TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT, FLOW_DIS_IS_FRAGMENT); TCA_FLOWER_KEY_FLAGS_IS_FRAGMENT, FLOW_DIS_IS_FRAGMENT);
return 0;
} }
static int fl_set_key(struct net *net, struct nlattr **tb, static int fl_set_key(struct net *net, struct nlattr **tb,
struct fl_flow_key *key, struct fl_flow_key *mask) struct fl_flow_key *key, struct fl_flow_key *mask)
{ {
__be16 ethertype; __be16 ethertype;
int ret = 0;
#ifdef CONFIG_NET_CLS_IND #ifdef CONFIG_NET_CLS_IND
if (tb[TCA_FLOWER_INDEV]) { if (tb[TCA_FLOWER_INDEV]) {
int err = tcf_change_indev(net, tb[TCA_FLOWER_INDEV]); int err = tcf_change_indev(net, tb[TCA_FLOWER_INDEV]);
...@@ -614,9 +614,10 @@ static int fl_set_key(struct net *net, struct nlattr **tb, ...@@ -614,9 +614,10 @@ static int fl_set_key(struct net *net, struct nlattr **tb,
&mask->enc_tp.dst, TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK, &mask->enc_tp.dst, TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK,
sizeof(key->enc_tp.dst)); sizeof(key->enc_tp.dst));
fl_set_key_flags(tb, &key->control.flags, &mask->control.flags); if (tb[TCA_FLOWER_KEY_FLAGS])
ret = fl_set_key_flags(tb, &key->control.flags, &mask->control.flags);
return 0; return ret;
} }
static bool fl_mask_eq(struct fl_flow_mask *mask1, static bool fl_mask_eq(struct fl_flow_mask *mask1,
......
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