Commit 25ef1328 authored by Pravin B Shelar's avatar Pravin B Shelar Committed by David S. Miller

openvswitch: Set flow-key members.

This patch adds missing memset which are required to initialize
flow key member. For example for IP flow we need to initialize
ip.frag for all cases.

Found by inspection.

This bug is introduced by commit 07148121
("openvswitch: Eliminate memset() from flow_extract").
Signed-off-by: default avatarPravin B Shelar <pshelar@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dc8e5416
...@@ -274,6 +274,8 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key) ...@@ -274,6 +274,8 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key)
key->ip.frag = OVS_FRAG_TYPE_LATER; key->ip.frag = OVS_FRAG_TYPE_LATER;
else else
key->ip.frag = OVS_FRAG_TYPE_FIRST; key->ip.frag = OVS_FRAG_TYPE_FIRST;
} else {
key->ip.frag = OVS_FRAG_TYPE_NONE;
} }
nh_len = payload_ofs - nh_ofs; nh_len = payload_ofs - nh_ofs;
...@@ -358,6 +360,7 @@ static int parse_icmpv6(struct sk_buff *skb, struct sw_flow_key *key, ...@@ -358,6 +360,7 @@ static int parse_icmpv6(struct sk_buff *skb, struct sw_flow_key *key,
*/ */
key->tp.src = htons(icmp->icmp6_type); key->tp.src = htons(icmp->icmp6_type);
key->tp.dst = htons(icmp->icmp6_code); key->tp.dst = htons(icmp->icmp6_code);
memset(&key->ipv6.nd, 0, sizeof(key->ipv6.nd));
if (icmp->icmp6_code == 0 && if (icmp->icmp6_code == 0 &&
(icmp->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION || (icmp->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION ||
...@@ -674,9 +677,6 @@ int ovs_flow_key_extract(struct ovs_tunnel_info *tun_info, ...@@ -674,9 +677,6 @@ int ovs_flow_key_extract(struct ovs_tunnel_info *tun_info,
key->ovs_flow_hash = 0; key->ovs_flow_hash = 0;
key->recirc_id = 0; key->recirc_id = 0;
/* Flags are always used as part of stats */
key->tp.flags = 0;
return key_extract(skb, key); return key_extract(skb, key);
} }
......
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