| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) ST-Ericsson AB 2010 |
|---|
| 3 | 4 | * Author: Sjur Brendeland |
|---|
| 4 | | - * License terms: GNU General Public License (GPL) version 2 |
|---|
| 5 | 5 | */ |
|---|
| 6 | 6 | |
|---|
| 7 | 7 | #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__ |
|---|
| .. | .. |
|---|
| 319 | 319 | if (tmppkt == NULL) |
|---|
| 320 | 320 | return NULL; |
|---|
| 321 | 321 | tmp = pkt_to_skb(tmppkt); |
|---|
| 322 | | - skb_set_tail_pointer(tmp, dstlen); |
|---|
| 323 | | - tmp->len = dstlen; |
|---|
| 324 | | - memcpy(tmp->data, dst->data, dstlen); |
|---|
| 322 | + skb_put_data(tmp, dst->data, dstlen); |
|---|
| 325 | 323 | cfpkt_destroy(dstpkt); |
|---|
| 326 | 324 | dst = tmp; |
|---|
| 327 | 325 | } |
|---|
| 328 | | - memcpy(skb_tail_pointer(dst), add->data, skb_headlen(add)); |
|---|
| 326 | + skb_put_data(dst, add->data, skb_headlen(add)); |
|---|
| 329 | 327 | cfpkt_destroy(addpkt); |
|---|
| 330 | | - dst->tail += addlen; |
|---|
| 331 | | - dst->len += addlen; |
|---|
| 332 | 328 | return skb_to_pkt(dst); |
|---|
| 333 | 329 | } |
|---|
| 334 | 330 | |
|---|
| .. | .. |
|---|
| 359 | 355 | if (skb2 == NULL) |
|---|
| 360 | 356 | return NULL; |
|---|
| 361 | 357 | |
|---|
| 362 | | - /* Reduce the length of the original packet */ |
|---|
| 363 | | - skb_set_tail_pointer(skb, pos); |
|---|
| 364 | | - skb->len = pos; |
|---|
| 358 | + skb_put_data(skb2, split, len2nd); |
|---|
| 365 | 359 | |
|---|
| 366 | | - memcpy(skb2->data, split, len2nd); |
|---|
| 367 | | - skb2->tail += len2nd; |
|---|
| 368 | | - skb2->len += len2nd; |
|---|
| 360 | + /* Reduce the length of the original packet */ |
|---|
| 361 | + skb_trim(skb, pos); |
|---|
| 362 | + |
|---|
| 369 | 363 | skb2->priority = skb->priority; |
|---|
| 370 | 364 | return skb_to_pkt(skb2); |
|---|
| 371 | 365 | } |
|---|