Skip to content

Commit 25ef132

Browse files
Pravin B Shelardavem330
authored andcommitted
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 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>
1 parent dc8e541 commit 25ef132

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎net/openvswitch/flow.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ static int parse_ipv6hdr(struct sk_buff *skb, struct sw_flow_key *key)
274274
key->ip.frag = OVS_FRAG_TYPE_LATER;
275275
else
276276
key->ip.frag = OVS_FRAG_TYPE_FIRST;
277+
} else {
278+
key->ip.frag = OVS_FRAG_TYPE_NONE;
277279
}
278280

279281
nh_len = payload_ofs - nh_ofs;
@@ -358,6 +360,7 @@ static int parse_icmpv6(struct sk_buff *skb, struct sw_flow_key *key,
358360
*/
359361
key->tp.src = htons(icmp->icmp6_type);
360362
key->tp.dst = htons(icmp->icmp6_code);
363+
memset(&key->ipv6.nd, 0, sizeof(key->ipv6.nd));
361364

362365
if (icmp->icmp6_code == 0 &&
363366
(icmp->icmp6_type == NDISC_NEIGHBOUR_SOLICITATION ||
@@ -674,9 +677,6 @@ int ovs_flow_key_extract(struct ovs_tunnel_info *tun_info,
674677
key->ovs_flow_hash = 0;
675678
key->recirc_id = 0;
676679

677-
/* Flags are always used as part of stats */
678-
key->tp.flags = 0;
679-
680680
return key_extract(skb, key);
681681
}
682682

0 commit comments

Comments
 (0)