Skip to content

Commit

Permalink
openvswitch: Set flow-key members.
Browse files Browse the repository at this point in the history
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 0714812
("openvswitch: Eliminate memset() from flow_extract").

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pravin B Shelar authored and David S. Miller committed Oct 18, 2014
1 parent dc8e541 commit 25ef132
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/openvswitch/flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key)
key->ip.frag = OVS_FRAG_TYPE_LATER;
else
key->ip.frag = OVS_FRAG_TYPE_FIRST;
} else {
key->ip.frag = OVS_FRAG_TYPE_NONE;
}

nh_len = payload_ofs - nh_ofs;
Expand Down Expand Up @@ -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.dst = htons(icmp->icmp6_code);
memset(&key->ipv6.nd, 0, sizeof(key->ipv6.nd));

if (icmp->icmp6_code == 0 &&
(icmp->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION ||
Expand Down Expand Up @@ -674,9 +677,6 @@ int ovs_flow_key_extract(struct ovs_tunnel_info *tun_info,
key->ovs_flow_hash = 0;
key->recirc_id = 0;

/* Flags are always used as part of stats */
key->tp.flags = 0;

return key_extract(skb, key);
}

Expand Down

0 comments on commit 25ef132

Please sign in to comment.