diff options
-rw-r--r-- | net/ipv4/inet_lro.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c index ef7ae6049a51..8e6be5aad115 100644 --- a/net/ipv4/inet_lro.c +++ b/net/ipv4/inet_lro.c | |||
@@ -433,7 +433,7 @@ static struct sk_buff *__lro_proc_segment(struct net_lro_mgr *lro_mgr, | |||
433 | if (!lro_mgr->get_frag_header || | 433 | if (!lro_mgr->get_frag_header || |
434 | lro_mgr->get_frag_header(frags, (void *)&mac_hdr, (void *)&iph, | 434 | lro_mgr->get_frag_header(frags, (void *)&mac_hdr, (void *)&iph, |
435 | (void *)&tcph, &flags, priv)) { | 435 | (void *)&tcph, &flags, priv)) { |
436 | mac_hdr = page_address(frags->page) + frags->page_offset; | 436 | mac_hdr = skb_frag_address(frags); |
437 | goto out1; | 437 | goto out1; |
438 | } | 438 | } |
439 | 439 | ||
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 8c6563361ab5..ae3bb147affd 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -989,13 +989,13 @@ alloc_new_skb: | |||
989 | if (page && (left = PAGE_SIZE - off) > 0) { | 989 | if (page && (left = PAGE_SIZE - off) > 0) { |
990 | if (copy >= left) | 990 | if (copy >= left) |
991 | copy = left; | 991 | copy = left; |
992 | if (page != frag->page) { | 992 | if (page != skb_frag_page(frag)) { |
993 | if (i == MAX_SKB_FRAGS) { | 993 | if (i == MAX_SKB_FRAGS) { |
994 | err = -EMSGSIZE; | 994 | err = -EMSGSIZE; |
995 | goto error; | 995 | goto error; |
996 | } | 996 | } |
997 | get_page(page); | ||
998 | skb_fill_page_desc(skb, i, page, off, 0); | 997 | skb_fill_page_desc(skb, i, page, off, 0); |
998 | skb_frag_ref(skb, i); | ||
999 | frag = &skb_shinfo(skb)->frags[i]; | 999 | frag = &skb_shinfo(skb)->frags[i]; |
1000 | } | 1000 | } |
1001 | } else if (i < MAX_SKB_FRAGS) { | 1001 | } else if (i < MAX_SKB_FRAGS) { |
@@ -1015,7 +1015,8 @@ alloc_new_skb: | |||
1015 | err = -EMSGSIZE; | 1015 | err = -EMSGSIZE; |
1016 | goto error; | 1016 | goto error; |
1017 | } | 1017 | } |
1018 | if (getfrag(from, page_address(frag->page)+frag->page_offset+frag->size, offset, copy, skb->len, skb) < 0) { | 1018 | if (getfrag(from, skb_frag_address(frag)+frag->size, |
1019 | offset, copy, skb->len, skb) < 0) { | ||
1019 | err = -EFAULT; | 1020 | err = -EFAULT; |
1020 | goto error; | 1021 | goto error; |
1021 | } | 1022 | } |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 46febcacb729..5fe632c763f4 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -3035,7 +3035,8 @@ int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *hp, | |||
3035 | 3035 | ||
3036 | for (i = 0; i < shi->nr_frags; ++i) { | 3036 | for (i = 0; i < shi->nr_frags; ++i) { |
3037 | const struct skb_frag_struct *f = &shi->frags[i]; | 3037 | const struct skb_frag_struct *f = &shi->frags[i]; |
3038 | sg_set_page(&sg, f->page, f->size, f->page_offset); | 3038 | struct page *page = skb_frag_page(f); |
3039 | sg_set_page(&sg, page, f->size, f->page_offset); | ||
3039 | if (crypto_hash_update(desc, &sg, f->size)) | 3040 | if (crypto_hash_update(desc, &sg, f->size)) |
3040 | return 1; | 3041 | return 1; |
3041 | } | 3042 | } |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 882e0b0964d0..0377c061f22f 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1095,7 +1095,7 @@ static void __pskb_trim_head(struct sk_buff *skb, int len) | |||
1095 | k = 0; | 1095 | k = 0; |
1096 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 1096 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
1097 | if (skb_shinfo(skb)->frags[i].size <= eat) { | 1097 | if (skb_shinfo(skb)->frags[i].size <= eat) { |
1098 | put_page(skb_shinfo(skb)->frags[i].page); | 1098 | skb_frag_unref(skb, i); |
1099 | eat -= skb_shinfo(skb)->frags[i].size; | 1099 | eat -= skb_shinfo(skb)->frags[i].size; |
1100 | } else { | 1100 | } else { |
1101 | skb_shinfo(skb)->frags[k] = skb_shinfo(skb)->frags[i]; | 1101 | skb_shinfo(skb)->frags[k] = skb_shinfo(skb)->frags[i]; |