Skip to content

Commit 1a4e2d0

Browse files
Arnaldo Carvalho de MeloDavid S. Miller
authored andcommitted
[SK_BUFF]: Some more conversions to skb_copy_from_linear_data
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
1 parent 27d7ff4 commit 1a4e2d0

5 files changed

Lines changed: 15 additions & 6 deletions

File tree

‎net/ax25/ax25_in.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ static int ax25_rx_fragment(ax25_cb *ax25, struct sk_buff *skb)
6666

6767
/* Copy data from the fragments */
6868
while ((skbo = skb_dequeue(&ax25->frag_queue)) != NULL) {
69-
memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len);
69+
skb_copy_from_linear_data(skbo,
70+
skb_put(skbn, skbo->len),
71+
skbo->len);
7072
kfree_skb(skbo);
7173
}
7274

‎net/decnet/netfilter/dn_rtmsg.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static struct sk_buff *dnrmg_build_message(struct sk_buff *rt_skb, int *errp)
4848
rtm = (struct nf_dn_rtmsg *)NLMSG_DATA(nlh);
4949
rtm->nfdn_ifindex = rt_skb->dev->ifindex;
5050
ptr = NFDN_RTMSG(rtm);
51-
memcpy(ptr, rt_skb->data, rt_skb->len);
51+
skb_copy_from_linear_data(rt_skb, ptr, rt_skb->len);
5252
nlh->nlmsg_len = skb->tail - old_tail;
5353
return skb;
5454

‎net/ipv4/tcp_output.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,9 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
16451645
/* Ok. We will be able to collapse the packet. */
16461646
tcp_unlink_write_queue(next_skb, sk);
16471647

1648-
memcpy(skb_put(skb, next_skb_size), next_skb->data, next_skb_size);
1648+
skb_copy_from_linear_data(next_skb,
1649+
skb_put(skb, next_skb_size),
1650+
next_skb_size);
16491651

16501652
if (next_skb->ip_summed == CHECKSUM_PARTIAL)
16511653
skb->ip_summed = CHECKSUM_PARTIAL;

‎net/netrom/nr_in.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
5454
skb_reset_transport_header(skbn);
5555

5656
while ((skbo = skb_dequeue(&nr->frag_queue)) != NULL) {
57-
memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len);
57+
skb_copy_from_linear_data(skbo,
58+
skb_put(skbn, skbo->len),
59+
skbo->len);
5860
kfree_skb(skbo);
5961
}
6062

‎net/x25/x25_in.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,17 @@ static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
5656
skb_reset_transport_header(skbn);
5757

5858
skbo = skb_dequeue(&x25->fragment_queue);
59-
memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len);
59+
skb_copy_from_linear_data(skbo, skb_put(skbn, skbo->len),
60+
skbo->len);
6061
kfree_skb(skbo);
6162

6263
while ((skbo =
6364
skb_dequeue(&x25->fragment_queue)) != NULL) {
6465
skb_pull(skbo, (x25->neighbour->extended) ?
6566
X25_EXT_MIN_LEN : X25_STD_MIN_LEN);
66-
memcpy(skb_put(skbn, skbo->len), skbo->data, skbo->len);
67+
skb_copy_from_linear_data(skbo,
68+
skb_put(skbn, skbo->len),
69+
skbo->len);
6770
kfree_skb(skbo);
6871
}
6972

0 commit comments

Comments
 (0)