From: Jesse Gross Date: Mon, 7 Feb 2011 21:05:34 +0000 (-0800) Subject: tunneling: Check refcount of each page in frags. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a992ec0b06bfddc4e8c2a50d79362b3dfb286dd5;p=openvswitch tunneling: Check refcount of each page in frags. 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 Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/tunnel.c b/datapath/tunnel.c index 40577fbd..95492f76 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;