flow: flow_extract() improperly parses IPv6 TOS bits.
authorEthan Jackson <ethan@nicira.com>
Wed, 16 Nov 2011 02:35:26 +0000 (18:35 -0800)
committerEthan Jackson <ethan@nicira.com>
Wed, 16 Nov 2011 18:11:34 +0000 (10:11 -0800)
This problem could cause userspace to automatically evict IPv6
flows from the datapath which had TOS bits set.

Bug #8323.

lib/flow.c

index 8b03e76e9d04b4ec62e4de6a0afa75952d17b607..3f0bea5549d880a7d55a2c21497d57599d989cd9 100644 (file)
@@ -148,7 +148,7 @@ parse_ipv6(struct ofpbuf *packet, struct flow *flow)
     flow->ipv6_dst = nh->ip6_dst;
 
     tc_flow = get_unaligned_be32(&nh->ip6_flow);
-    flow->nw_tos = ntohl(tc_flow) >> 4;
+    flow->nw_tos = ntohl(tc_flow) >> 20;
     flow->ipv6_label = tc_flow & htonl(IPV6_LABEL_MASK);
     flow->nw_ttl = nh->ip6_hlim;
     flow->nw_proto = IPPROTO_NONE;