From 57375281c749806c5a5533a665cb823131aba37d Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 1 Jul 2013 10:43:18 -0700 Subject: [PATCH] odp-util: Always encode mask of 0xffff for dl_type < ETH_TYPE_MIN. For non-Ethernet II packets, we don't set an EtherType netlink attribute and set the Ethertype mask attribute to 0xffff. The code was encoding whatever mask was passed in, which could lead to bugs if the caller didn't know the userspace-kernel interface. Found by inspection. Signed-off-by: Justin Pettit Acked-by: Andy Zhou --- lib/odp-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/odp-util.c b/lib/odp-util.c index e239e56d1..57393fb40 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -2369,7 +2369,7 @@ odp_flow_key_from_flow__(struct ofpbuf *buf, const struct flow *data, * 802.3 SNAP packet with valid eth_type). */ if (is_mask) { - nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, data->dl_type); + nl_msg_put_be16(buf, OVS_KEY_ATTR_ETHERTYPE, htons(UINT16_MAX)); } goto unencap; } -- 2.20.1