diff options
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r-- | net/ipv4/ip_output.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 | } |