Skip to content

Commit 408dadf

Browse files
Ian Campbelldavem330
authored andcommitted
net: ipv6: convert to SKB frag APIs
Signed-off-by: Ian Campbell <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Alexey Kuznetsov <[email protected]> Cc: "Pekka Savola (ipv6)" <[email protected]> Cc: James Morris <[email protected]> Cc: Hideaki YOSHIFUJI <[email protected]> Cc: Patrick McHardy <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent aff65da commit 408dadf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

net/ipv6/ip6_output.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,13 +1480,13 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
14801480
if (page && (left = PAGE_SIZE - off) > 0) {
14811481
if (copy >= left)
14821482
copy = left;
1483-
if (page != frag->page) {
1483+
if (page != skb_frag_page(frag)) {
14841484
if (i == MAX_SKB_FRAGS) {
14851485
err = -EMSGSIZE;
14861486
goto error;
14871487
}
1488-
get_page(page);
14891488
skb_fill_page_desc(skb, i, page, sk->sk_sndmsg_off, 0);
1489+
skb_frag_ref(skb, i);
14901490
frag = &skb_shinfo(skb)->frags[i];
14911491
}
14921492
} else if(i < MAX_SKB_FRAGS) {
@@ -1506,7 +1506,8 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
15061506
err = -EMSGSIZE;
15071507
goto error;
15081508
}
1509-
if (getfrag(from, page_address(frag->page)+frag->page_offset+frag->size, offset, copy, skb->len, skb) < 0) {
1509+
if (getfrag(from, skb_frag_address(frag)+frag->size,
1510+
offset, copy, skb->len, skb) < 0) {
15101511
err = -EFAULT;
15111512
goto error;
15121513
}

0 commit comments

Comments
 (0)