[ovs-dev] [PATCH] flow: Fix IPv6 fragment packet handling

Ken Ajiro ajiro at mxw.nes.nec.co.jp
Thu May 9 17:39:34 UTC 2013


From: Takashi Kawaguchi <kawaguchi-takashi at mxd.nes.nec.co.jp>

IPv6 fragmented packet (except first fragment) will not be handled
correctly. When extracting packet at parse_ipv6(), although nw_frag
should have both of FLOW_NW_FRAG_ANY and FLOW_NW_FRAG_LATER for
later fragment, only FLOW_NW_FRAG_LATER is set.

Signed-off-by: Takashi Kawaguchi <kawaguchi-takashi at mxd.nes.nec.co.jp>
Signed-off-by: Ken Ajiro <ajiro at mxw.nes.nec.co.jp>
---
 lib/flow.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/flow.c b/lib/flow.c
index 678b8f0..e4154a7 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -229,9 +229,8 @@ parse_ipv6(struct ofpbuf *packet, struct flow *flow)
 
             /* We only process the first fragment. */
             if (frag_hdr->ip6f_offlg != htons(0)) {
-                if ((frag_hdr->ip6f_offlg & IP6F_OFF_MASK) == htons(0)) {
-                    flow->nw_frag = FLOW_NW_FRAG_ANY;
-                } else {
+                flow->nw_frag = FLOW_NW_FRAG_ANY;
+                if ((frag_hdr->ip6f_offlg & IP6F_OFF_MASK) != htons(0)) {
                     flow->nw_frag |= FLOW_NW_FRAG_LATER;
                     nexthdr = IPPROTO_FRAGMENT;
                     break;
-- 
1.7.0.4




More information about the dev mailing list