The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1e4ec01603c4b1e0b0eb524f28f731eb5cb5f6dc
commit 1e4ec01603c4b1e0b0eb524f28f731eb5cb5f6dc Author: Bjoern A. Zeeb <[email protected]> AuthorDate: 2026-02-03 22:13:24 +0000 Commit: Bjoern A. Zeeb <[email protected]> CommitDate: 2026-07-17 15:48:53 +0000 LinuxKPI: skbuff: add support for frags in linuxkpi_skb_copy() Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_skbuff.c | 14 ++++++++++---- 1 file 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. */
