From 46aef12ee5fcb028d20bac654c8a08cf993cfac8 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Tue, 1 Mar 2011 17:56:01 -0800 Subject: [PATCH] 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. --- lib/flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/flow.c b/lib/flow.c index 879e462f0..6928f74ec 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -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) { -- 2.43.0