2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

flow: Avoid assertion failure on invalid IPv6 packet.

We compute the length of the IPv6 header by parsing all of the
extension headers that we know about.  However, the final result
is checked using ofpbuf_pull(), which checks the size with an
assertion.  Since the length of the final header is not checked
in any other way an invalid packet can trigger this assertion.
This commit is contained in:
Jesse Gross
2011-03-01 17:56:01 -08:00
parent 0984253939
commit 46aef12ee5

View File

@@ -414,7 +414,7 @@ flow_extract(struct ofpbuf *packet, ovs_be64 tun_id, uint16_t in_port,
return 0;
}
nh = ofpbuf_pull(&b, nh_len);
nh = ofpbuf_try_pull(&b, nh_len);
if (nh) {
packet->l4 = b.data;
if (flow->nw_proto == IPPROTO_TCP) {