From: Justin Pettit Date: Fri, 28 Jun 2013 00:57:57 +0000 (-0700) Subject: odp-util: Fix converting masked VLAN from flow. X-Git-Tag: sliver-openvswitch-1.10.90-3~6^2~20 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=bed7d6a1b7316db3f0be19c9f2d58cc7d71a24fa odp-util: Fix converting masked VLAN from flow. When converting the VLAN from a flow to an ODP key, the processing logic would always store the VLAN ethertype. However, when handling a mask, it should be a mask, not an ethertype. And since we don't support bit-wise masking of the ethertype, just make it an exact-match mask. Signed-off-by: Justin Pettit Acked-by: Ethan Jackson --- diff --git a/lib/odp-util.c b/lib/odp-util.c index 7724be4ef..5be811804 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -2285,7 +2285,11 @@ odp_flow_key_from_flow__(struct ofpbuf *buf, const struct flow *data, memcpy(eth_key->eth_dst, data->dl_dst, ETH_ADDR_LEN); if (flow->vlan_tci != htons(0) || flow->dl_type == htons(ETH_TYPE_VLAN)) { - nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, htons(ETH_TYPE_VLAN)); + if (is_mask) { + nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, htons(UINT16_MAX)); + } else { + nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, htons(ETH_TYPE_VLAN)); + } nl_msg_put_be16(buf, OVS_KEY_ATTR_VLAN, data->vlan_tci); encap = nl_msg_start_nested(buf, OVS_KEY_ATTR_ENCAP); if (flow->vlan_tci == htons(0)) {