aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2026-02-03 22:13:24 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2026-07-17 15:48:53 +0000
commit1e4ec01603c4b1e0b0eb524f28f731eb5cb5f6dc (patch)
tree87c23045ae3539e4a034349e39753f6d561fb60b
parent9de11cc26ab61d7f80e8af84dbc55d8cbd6f832d (diff)
LinuxKPI: skbuff: add support for frags in linuxkpi_skb_copy()
Sponsored by: The FreeBSD Foundation MFC after: 3 days
-rw-r--r--sys/compat/linuxkpi/common/src/linux_skbuff.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_skbuff.c b/sys/compat/linuxkpi/common/src/linux_skbuff.c
index a2aa601d594e..5af9633691a6 100644
--- a/sys/compat/linuxkpi/common/src/linux_skbuff.c
+++ b/sys/compat/linuxkpi/common/src/linux_skbuff.c
@@ -191,6 +191,7 @@ linuxkpi_skb_copy(const struct sk_buff *skb, gfp_t gfp)
struct skb_shared_info *shinfo;
size_t len;
unsigned int headroom;
+ uint16_t fragno, count;
/* Full buffer size + any fragments. */
len = skb->end - skb->head + skb->data_len;
@@ -209,10 +210,15 @@ linuxkpi_skb_copy(const struct sk_buff *skb, gfp_t gfp)
/* Deal with fragments. */
shinfo = skb->shinfo;
- if (shinfo->nr_frags > 0) {
- printf("%s:%d: NOT YET SUPPORTED; missing %d frags\n",
- __func__, __LINE__, shinfo->nr_frags);
- SKB_TODO();
+ for (count = fragno = 0;
+ count < shinfo->nr_frags && fragno < nitems(shinfo->frags);
+ fragno++) {
+ if (shinfo->frags[fragno].page != NULL) {
+ skb_put_data(new,
+ skb_frag_address(&shinfo->frags[fragno]),
+ shinfo->frags[fragno].size);
+ count++;
+ }
}
/* Deal with header fields. */