We check the refcount of each page in a fragmented skb
to see if we need to do a linearize before computing the
checksum.  However, although we iterate over the list of
pages, we always check the first one.

Reported-by: Ben Pfaff <b...@nicira.com>
Signed-off-by: Jesse Gross <je...@nicira.com>
---
 datapath/tunnel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/datapath/tunnel.c b/datapath/tunnel.c
index 40577fb..95492f7 100644
--- a/datapath/tunnel.c
+++ b/datapath/tunnel.c
@@ -1021,7 +1021,7 @@ static inline bool need_linearize(const struct sk_buff 
*skb)
         * change them from underneath us and we can skip the linearization.
         */
        for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
-               if (unlikely(page_count(skb_shinfo(skb)->frags[0].page) > 1))
+               if (unlikely(page_count(skb_shinfo(skb)->frags[i].page) > 1))
                        return true;
 
        return false;
-- 
1.7.1


_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev_openvswitch.org

Reply via email to