14 #ifndef _LINUX_SKBUFF_H
15 #define _LINUX_SKBUFF_H
17 #include <linux/kernel.h>
19 #include <linux/compiler.h>
20 #include <linux/time.h>
25 #include <asm/types.h>
27 #include <linux/net.h>
32 #include <linux/hrtimer.h>
37 #define CHECKSUM_NONE 0
38 #define CHECKSUM_UNNECESSARY 1
39 #define CHECKSUM_COMPLETE 2
40 #define CHECKSUM_PARTIAL 3
42 #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \
43 ~(SMP_CACHE_BYTES - 1))
44 #define SKB_WITH_OVERHEAD(X) \
45 ((X) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
46 #define SKB_MAX_ORDER(X, ORDER) \
47 SKB_WITH_OVERHEAD((PAGE_SIZE << (ORDER)) - (X))
48 #define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0))
49 #define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2))
52 #define SKB_TRUESIZE(X) ((X) + \
53 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \
54 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
112 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
113 struct nf_conntrack {
118 #ifdef CONFIG_BRIDGE_NETFILTER
119 struct nf_bridge_info {
124 unsigned long data[32 /
sizeof(
unsigned long)];
146 #if (65536/PAGE_SIZE + 1) < 16
147 #define MAX_SKB_FRAGS 16UL
149 #define MAX_SKB_FRAGS (65536/PAGE_SIZE + 1)
158 #if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
187 #define HAVE_HW_TIME_STAMP
285 #define SKB_DATAREF_SHIFT 16
286 #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1)
310 #if BITS_PER_LONG > 32
311 #define NET_SKBUFF_DATA_USES_OFFSET 1
314 #ifdef NET_SKBUFF_DATA_USES_OFFSET
320 #if defined(CONFIG_NF_DEFRAG_IPV4) || defined(CONFIG_NF_DEFRAG_IPV4_MODULE) || \
321 defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE)
322 #define NET_SKBUFF_NF_DEFRAG_NEEDED 1
437 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
438 struct nf_conntrack *nfct;
440 #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED
443 #ifdef CONFIG_BRIDGE_NETFILTER
444 struct nf_bridge_info *nf_bridge;
453 #ifdef CONFIG_NET_SCHED
455 #ifdef CONFIG_NET_CLS_ACT
462 #ifdef CONFIG_IPV6_NDISC_NODETYPE
463 __u8 ndisc_nodetype:2;
475 #ifdef CONFIG_NET_DMA
478 #ifdef CONFIG_NETWORK_SECMARK
503 #include <linux/slab.h>
506 #define SKB_ALLOC_FCLONE 0x01
507 #define SKB_ALLOC_RX 0x02
510 static inline bool skb_pfmemalloc(
const struct sk_buff *
skb)
519 #define SKB_DST_NOREF 1UL
520 #define SKB_DST_PTRMASK ~(SKB_DST_NOREF)
534 !rcu_read_lock_held() &&
535 !rcu_read_lock_bh_held());
558 static inline bool skb_dst_is_noref(
const struct sk_buff *skb)
560 return (skb->
_skb_refdst & SKB_DST_NOREF) && skb_dst(skb);
563 static inline struct rtable *skb_rtable(
const struct sk_buff *skb)
565 return (
struct rtable *)skb_dst(skb);
575 bool *fragstolen,
int *delta_truesize);
580 static inline struct sk_buff *alloc_skb(
unsigned int size,
586 static inline struct sk_buff *alloc_skb_fclone(
unsigned int size,
602 int nhead,
int ntail,
605 unsigned int headroom);
607 int newheadroom,
int newtailroom,
615 #define dev_kfree_skb(a) consume_skb(a)
622 struct skb_seq_state {
626 __u32 stepped_offset;
633 unsigned int from,
unsigned int to,
634 struct skb_seq_state *
st);
636 struct skb_seq_state *
st);
652 #ifdef NET_SKBUFF_DATA_USES_OFFSET
653 static inline unsigned char *skb_end_pointer(
const struct sk_buff *skb)
658 static inline unsigned int skb_end_offset(
const struct sk_buff *skb)
663 static inline unsigned char *skb_end_pointer(
const struct sk_buff *skb)
668 static inline unsigned int skb_end_offset(
const struct sk_buff *skb)
675 #define skb_shinfo(SKB) ((struct skb_shared_info *)(skb_end_pointer(SKB)))
679 return &skb_shinfo(skb)->hwtstamps;
733 BUG_ON(skb_queue_is_last(list, skb));
751 BUG_ON(skb_queue_is_first(list, skb));
781 static inline int skb_cloned(
const struct sk_buff *skb)
794 static inline int skb_header_cloned(
const struct sk_buff *skb)
814 static inline void skb_header_release(
struct sk_buff *skb)
828 static inline int skb_shared(
const struct sk_buff *skb)
849 if (skb_shared(skb)) {
885 if (skb_cloned(skb)) {
910 if (skb == (
struct sk_buff *)list_)
929 if (next == (
struct sk_buff *)list_)
951 if (skb == (
struct sk_buff *)list_)
978 static inline void __skb_queue_head_init(
struct sk_buff_head *list)
992 static inline void skb_queue_head_init(
struct sk_buff_head *list)
995 __skb_queue_head_init(list);
998 static inline void skb_queue_head_init_class(
struct sk_buff_head *list,
1001 skb_queue_head_init(list);
1012 static inline void __skb_insert(
struct sk_buff *newsk,
1022 static inline void __skb_queue_splice(
const struct sk_buff_head *list,
1041 static inline void skb_queue_splice(
const struct sk_buff_head *list,
1044 if (!skb_queue_empty(list)) {
1045 __skb_queue_splice(list, (
struct sk_buff *) head, head->
next);
1057 static inline void skb_queue_splice_init(
struct sk_buff_head *list,
1060 if (!skb_queue_empty(list)) {
1061 __skb_queue_splice(list, (
struct sk_buff *) head, head->
next);
1063 __skb_queue_head_init(list);
1072 static inline void skb_queue_splice_tail(
const struct sk_buff_head *list,
1075 if (!skb_queue_empty(list)) {
1076 __skb_queue_splice(list, head->
prev, (
struct sk_buff *) head);
1089 static inline void skb_queue_splice_tail_init(
struct sk_buff_head *list,
1092 if (!skb_queue_empty(list)) {
1093 __skb_queue_splice(list, head->
prev, (
struct sk_buff *) head);
1095 __skb_queue_head_init(list);
1110 static inline void __skb_queue_after(
struct sk_buff_head *list,
1114 __skb_insert(newsk, prev, prev->
next, list);
1120 static inline void __skb_queue_before(
struct sk_buff_head *list,
1124 __skb_insert(newsk, next->
prev, next, list);
1138 static inline void __skb_queue_head(
struct sk_buff_head *list,
1141 __skb_queue_after(list, (
struct sk_buff *)list, newsk);
1155 static inline void __skb_queue_tail(
struct sk_buff_head *list,
1158 __skb_queue_before(list, (
struct sk_buff *)list, newsk);
1189 struct sk_buff *skb = skb_peek(list);
1191 __skb_unlink(skb, list);
1206 struct sk_buff *skb = skb_peek_tail(list);
1208 __skb_unlink(skb, list);
1213 static inline bool skb_is_nonlinear(
const struct sk_buff *skb)
1218 static inline unsigned int skb_headlen(
const struct sk_buff *skb)
1223 static inline int skb_pagelen(
const struct sk_buff *skb)
1227 for (i = (
int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--)
1228 len += skb_frag_size(&skb_shinfo(skb)->frags[i]);
1229 return len + skb_headlen(skb);
1245 static inline void __skb_fill_page_desc(
struct sk_buff *skb,
int i,
1263 skb_frag_size_set(frag, size);
1280 static inline void skb_fill_page_desc(
struct sk_buff *skb,
int i,
1281 struct page *page,
int off,
int size)
1283 __skb_fill_page_desc(skb, i, page, off, size);
1284 skb_shinfo(skb)->nr_frags = i + 1;
1288 int off,
int size,
unsigned int truesize);
1290 #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
1291 #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb))
1292 #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb))
1294 #ifdef NET_SKBUFF_DATA_USES_OFFSET
1295 static inline unsigned char *skb_tail_pointer(
const struct sk_buff *skb)
1300 static inline void skb_reset_tail_pointer(
struct sk_buff *skb)
1305 static inline void skb_set_tail_pointer(
struct sk_buff *skb,
const int offset)
1307 skb_reset_tail_pointer(skb);
1311 static inline unsigned char *skb_tail_pointer(
const struct sk_buff *skb)
1316 static inline void skb_reset_tail_pointer(
struct sk_buff *skb)
1321 static inline void skb_set_tail_pointer(
struct sk_buff *skb,
const int offset)
1331 extern unsigned char *
skb_put(
struct sk_buff *skb,
unsigned int len);
1332 static inline unsigned char *__skb_put(
struct sk_buff *skb,
unsigned int len)
1334 unsigned char *
tmp = skb_tail_pointer(skb);
1335 SKB_LINEAR_ASSERT(skb);
1341 extern unsigned char *
skb_push(
struct sk_buff *skb,
unsigned int len);
1342 static inline unsigned char *__skb_push(
struct sk_buff *skb,
unsigned int len)
1349 extern unsigned char *
skb_pull(
struct sk_buff *skb,
unsigned int len);
1350 static inline unsigned char *__skb_pull(
struct sk_buff *skb,
unsigned int len)
1357 static inline unsigned char *skb_pull_inline(
struct sk_buff *skb,
unsigned int len)
1364 static inline unsigned char *__pskb_pull(
struct sk_buff *skb,
unsigned int len)
1366 if (len > skb_headlen(skb) &&
1373 static inline unsigned char *pskb_pull(
struct sk_buff *skb,
unsigned int len)
1378 static inline int pskb_may_pull(
struct sk_buff *skb,
unsigned int len)
1380 if (
likely(len <= skb_headlen(skb)))
1393 static inline unsigned int skb_headroom(
const struct sk_buff *skb)
1404 static inline int skb_tailroom(
const struct sk_buff *skb)
1406 return skb_is_nonlinear(skb) ? 0 : skb->
end - skb->
tail;
1416 static inline int skb_availroom(
const struct sk_buff *skb)
1418 return skb_is_nonlinear(skb) ? 0 : skb->
avail_size - skb->
len;
1429 static inline void skb_reserve(
struct sk_buff *skb,
int len)
1435 static inline void skb_reset_mac_len(
struct sk_buff *skb)
1440 #ifdef NET_SKBUFF_DATA_USES_OFFSET
1441 static inline unsigned char *skb_transport_header(
const struct sk_buff *skb)
1446 static inline void skb_reset_transport_header(
struct sk_buff *skb)
1451 static inline void skb_set_transport_header(
struct sk_buff *skb,
1454 skb_reset_transport_header(skb);
1458 static inline unsigned char *skb_network_header(
const struct sk_buff *skb)
1463 static inline void skb_reset_network_header(
struct sk_buff *skb)
1468 static inline void skb_set_network_header(
struct sk_buff *skb,
const int offset)
1470 skb_reset_network_header(skb);
1474 static inline unsigned char *skb_mac_header(
const struct sk_buff *skb)
1479 static inline int skb_mac_header_was_set(
const struct sk_buff *skb)
1484 static inline void skb_reset_mac_header(
struct sk_buff *skb)
1489 static inline void skb_set_mac_header(
struct sk_buff *skb,
const int offset)
1491 skb_reset_mac_header(skb);
1497 static inline unsigned char *skb_transport_header(
const struct sk_buff *skb)
1502 static inline void skb_reset_transport_header(
struct sk_buff *skb)
1507 static inline void skb_set_transport_header(
struct sk_buff *skb,
1513 static inline unsigned char *skb_network_header(
const struct sk_buff *skb)
1518 static inline void skb_reset_network_header(
struct sk_buff *skb)
1523 static inline void skb_set_network_header(
struct sk_buff *skb,
const int offset)
1528 static inline unsigned char *skb_mac_header(
const struct sk_buff *skb)
1533 static inline int skb_mac_header_was_set(
const struct sk_buff *skb)
1538 static inline void skb_reset_mac_header(
struct sk_buff *skb)
1543 static inline void skb_set_mac_header(
struct sk_buff *skb,
const int offset)
1549 static inline void skb_mac_header_rebuild(
struct sk_buff *skb)
1551 if (skb_mac_header_was_set(skb)) {
1552 const unsigned char *old_mac = skb_mac_header(skb);
1554 skb_set_mac_header(skb, -skb->
mac_len);
1559 static inline int skb_checksum_start_offset(
const struct sk_buff *skb)
1564 static inline int skb_transport_offset(
const struct sk_buff *skb)
1566 return skb_transport_header(skb) - skb->
data;
1569 static inline u32 skb_network_header_len(
const struct sk_buff *skb)
1574 static inline int skb_network_offset(
const struct sk_buff *skb)
1576 return skb_network_header(skb) - skb->
data;
1579 static inline int pskb_network_may_pull(
struct sk_buff *skb,
unsigned int len)
1581 return pskb_may_pull(skb, skb_network_offset(skb) + len);
1604 #ifndef NET_IP_ALIGN
1605 #define NET_IP_ALIGN 2
1629 #define NET_SKB_PAD max(32, L1_CACHE_BYTES)
1634 static inline void __skb_trim(
struct sk_buff *skb,
unsigned int len)
1636 if (
unlikely(skb_is_nonlinear(skb))) {
1641 skb_set_tail_pointer(skb, len);
1646 static inline int __pskb_trim(
struct sk_buff *skb,
unsigned int len)
1650 __skb_trim(skb, len);
1654 static inline int pskb_trim(
struct sk_buff *skb,
unsigned int len)
1656 return (len < skb->len) ? __pskb_trim(skb, len) : 0;
1668 static inline void pskb_trim_unique(
struct sk_buff *skb,
unsigned int len)
1670 int err = pskb_trim(skb, len);
1682 static inline void skb_orphan(
struct sk_buff *skb)
1715 static inline void __skb_queue_purge(
struct sk_buff_head *list)
1718 while ((skb = __skb_dequeue(list)) !=
NULL)
1748 static inline struct sk_buff *__dev_alloc_skb(
unsigned int length,
1755 static inline struct sk_buff *dev_alloc_skb(
unsigned int length)
1757 return netdev_alloc_skb(
NULL, length);
1772 unsigned int length)
1774 return __netdev_alloc_skb_ip_align(dev, length,
GFP_ATOMIC);
1787 static inline struct page *__skb_alloc_pages(
gfp_t gfp_mask,
1798 page = alloc_pages_node(
NUMA_NO_NODE, gfp_mask, order);
1814 static inline struct page *__skb_alloc_page(
gfp_t gfp_mask,
1817 return __skb_alloc_pages(gfp_mask, skb, 0);
1825 static inline void skb_propagate_pfmemalloc(
struct page *page,
1838 static inline struct page *skb_frag_page(
const skb_frag_t *frag)
1840 return frag->
page.p;
1849 static inline void __skb_frag_ref(
skb_frag_t *frag)
1851 get_page(skb_frag_page(frag));
1861 static inline void skb_frag_ref(
struct sk_buff *skb,
int f)
1863 __skb_frag_ref(&skb_shinfo(skb)->frags[f]);
1872 static inline void __skb_frag_unref(
skb_frag_t *frag)
1884 static inline void skb_frag_unref(
struct sk_buff *skb,
int f)
1886 __skb_frag_unref(&skb_shinfo(skb)->frags[f]);
1896 static inline void *skb_frag_address(
const skb_frag_t *frag)
1908 static inline void *skb_frag_address_safe(
const skb_frag_t *frag)
1924 static inline void __skb_frag_set_page(
skb_frag_t *frag,
struct page *page)
1937 static inline void skb_frag_set_page(
struct sk_buff *skb,
int f,
1940 __skb_frag_set_page(&skb_shinfo(skb)->frags[f], page);
1956 size_t offset,
size_t size,
1966 return __pskb_copy(skb, skb_headroom(skb), gfp_mask);
1977 static inline int skb_clone_writable(
const struct sk_buff *skb,
unsigned int len)
1979 return !skb_header_cloned(skb) &&
1980 skb_headroom(skb) + len <= skb->
hdr_len;
1983 static inline int __skb_cow(
struct sk_buff *skb,
unsigned int headroom,
1988 if (headroom > skb_headroom(skb))
1989 delta = headroom - skb_headroom(skb);
1991 if (delta || cloned)
2009 static inline int skb_cow(
struct sk_buff *skb,
unsigned int headroom)
2011 return __skb_cow(skb, headroom, skb_cloned(skb));
2024 static inline int skb_cow_head(
struct sk_buff *skb,
unsigned int headroom)
2026 return __skb_cow(skb, headroom, skb_header_cloned(skb));
2040 static inline int skb_padto(
struct sk_buff *skb,
unsigned int len)
2042 unsigned int size = skb->
len;
2045 return skb_pad(skb, len - size);
2048 static inline int skb_add_data(
struct sk_buff *skb,
2049 char __user *
from,
int copy)
2051 const int off = skb->
len;
2058 skb->
csum = csum_block_add(skb->
csum, csum, off);
2064 __skb_trim(skb, off);
2068 static inline bool skb_can_coalesce(
struct sk_buff *skb,
int i,
2069 const struct page *page,
int off)
2074 return page == skb_frag_page(frag) &&
2080 static inline int __skb_linearize(
struct sk_buff *skb)
2092 static inline int skb_linearize(
struct sk_buff *skb)
2094 return skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0;
2104 static inline int skb_linearize_cow(
struct sk_buff *skb)
2106 return skb_is_nonlinear(skb) || skb_cloned(skb) ?
2107 __skb_linearize(skb) : 0;
2121 static inline void skb_postpull_rcsum(
struct sk_buff *skb,
2122 const void *
start,
unsigned int len)
2139 static inline int pskb_trim_rcsum(
struct sk_buff *skb,
unsigned int len)
2145 return __pskb_trim(skb, len);
2148 #define skb_queue_walk(queue, skb) \
2149 for (skb = (queue)->next; \
2150 skb != (struct sk_buff *)(queue); \
2153 #define skb_queue_walk_safe(queue, skb, tmp) \
2154 for (skb = (queue)->next, tmp = skb->next; \
2155 skb != (struct sk_buff *)(queue); \
2156 skb = tmp, tmp = skb->next)
2158 #define skb_queue_walk_from(queue, skb) \
2159 for (; skb != (struct sk_buff *)(queue); \
2162 #define skb_queue_walk_from_safe(queue, skb, tmp) \
2163 for (tmp = skb->next; \
2164 skb != (struct sk_buff *)(queue); \
2165 skb = tmp, tmp = skb->next)
2167 #define skb_queue_reverse_walk(queue, skb) \
2168 for (skb = (queue)->prev; \
2169 skb != (struct sk_buff *)(queue); \
2172 #define skb_queue_reverse_walk_safe(queue, skb, tmp) \
2173 for (skb = (queue)->prev, tmp = skb->prev; \
2174 skb != (struct sk_buff *)(queue); \
2175 skb = tmp, tmp = skb->prev)
2177 #define skb_queue_reverse_walk_from_safe(queue, skb, tmp) \
2178 for (tmp = skb->prev; \
2179 skb != (struct sk_buff *)(queue); \
2180 skb = tmp, tmp = skb->prev)
2182 static inline bool skb_has_frag_list(
const struct sk_buff *skb)
2184 return skb_shinfo(skb)->frag_list !=
NULL;
2187 static inline void skb_frag_list_init(
struct sk_buff *skb)
2189 skb_shinfo(skb)->frag_list =
NULL;
2192 static inline void skb_frag_add_head(
struct sk_buff *skb,
struct sk_buff *frag)
2194 frag->
next = skb_shinfo(skb)->frag_list;
2195 skb_shinfo(skb)->frag_list =
frag;
2198 #define skb_walk_frags(skb, iter) \
2199 for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next)
2202 int *
peeked,
int *off,
int *err);
2204 int noblock,
int *err);
2208 int offset,
struct iovec *to,
2215 const struct iovec *from,
2220 const struct iovec *to,
2227 unsigned int flags);
2233 const void *from,
int len);
2235 int offset,
u8 *to,
int len,
2238 unsigned int offset,
2241 unsigned int flags);
2251 static inline void *skb_header_pointer(
const struct sk_buff *skb,
int offset,
2254 int hlen = skb_headlen(skb);
2256 if (hlen - offset >= len)
2265 static inline void skb_copy_from_linear_data(
const struct sk_buff *skb,
2267 const unsigned int len)
2272 static inline void skb_copy_from_linear_data_offset(
const struct sk_buff *skb,
2273 const int offset,
void *to,
2274 const unsigned int len)
2279 static inline void skb_copy_to_linear_data(
struct sk_buff *skb,
2281 const unsigned int len)
2286 static inline void skb_copy_to_linear_data_offset(
struct sk_buff *skb,
2289 const unsigned int len)
2310 static inline void skb_get_timestamp(
const struct sk_buff *skb,
2313 *stamp = ktime_to_timeval(skb->
tstamp);
2316 static inline void skb_get_timestampns(
const struct sk_buff *skb,
2319 *stamp = ktime_to_timespec(skb->
tstamp);
2322 static inline void __net_timestamp(
struct sk_buff *skb)
2332 static inline ktime_t net_invalid_timestamp(
void)
2334 return ktime_set(0, 0);
2339 #ifdef CONFIG_NETWORK_PHY_TIMESTAMPING
2386 static inline void sw_tx_timestamp(
struct sk_buff *skb)
2401 static inline void skb_tx_timestamp(
struct sk_buff *skb)
2404 sw_tx_timestamp(skb);
2419 static inline int skb_csum_unnecessary(
const struct sk_buff *skb)
2442 return skb_csum_unnecessary(skb) ?
2446 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
2447 extern void nf_conntrack_destroy(
struct nf_conntrack *nfct);
2448 static inline void nf_conntrack_put(
struct nf_conntrack *nfct)
2451 nf_conntrack_destroy(nfct);
2453 static inline void nf_conntrack_get(
struct nf_conntrack *nfct)
2459 #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED
2460 static inline void nf_conntrack_get_reasm(
struct sk_buff *skb)
2465 static inline void nf_conntrack_put_reasm(
struct sk_buff *skb)
2471 #ifdef CONFIG_BRIDGE_NETFILTER
2472 static inline void nf_bridge_put(
struct nf_bridge_info *nf_bridge)
2477 static inline void nf_bridge_get(
struct nf_bridge_info *nf_bridge)
2483 static inline void nf_reset(
struct sk_buff *skb)
2485 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
2486 nf_conntrack_put(skb->nfct);
2489 #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED
2490 nf_conntrack_put_reasm(skb->nfct_reasm);
2491 skb->nfct_reasm =
NULL;
2493 #ifdef CONFIG_BRIDGE_NETFILTER
2494 nf_bridge_put(skb->nf_bridge);
2495 skb->nf_bridge =
NULL;
2502 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
2503 dst->nfct = src->nfct;
2504 nf_conntrack_get(src->nfct);
2507 #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED
2508 dst->nfct_reasm = src->nfct_reasm;
2509 nf_conntrack_get_reasm(src->nfct_reasm);
2511 #ifdef CONFIG_BRIDGE_NETFILTER
2512 dst->nf_bridge = src->nf_bridge;
2513 nf_bridge_get(src->nf_bridge);
2519 #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
2520 nf_conntrack_put(dst->nfct);
2522 #ifdef NET_SKBUFF_NF_DEFRAG_NEEDED
2523 nf_conntrack_put_reasm(dst->nfct_reasm);
2525 #ifdef CONFIG_BRIDGE_NETFILTER
2526 nf_bridge_put(dst->nf_bridge);
2528 __nf_copy(dst, src);
2531 #ifdef CONFIG_NETWORK_SECMARK
2532 static inline void skb_copy_secmark(
struct sk_buff *to,
const struct sk_buff *from)
2534 to->secmark = from->secmark;
2537 static inline void skb_init_secmark(
struct sk_buff *skb)
2542 static inline void skb_copy_secmark(
struct sk_buff *to,
const struct sk_buff *from)
2545 static inline void skb_init_secmark(
struct sk_buff *skb)
2554 static inline u16 skb_get_queue_mapping(
const struct sk_buff *skb)
2559 static inline void skb_copy_queue_mapping(
struct sk_buff *to,
const struct sk_buff *from)
2569 static inline u16 skb_get_rx_queue(
const struct sk_buff *skb)
2574 static inline bool skb_rx_queue_recorded(
const struct sk_buff *skb)
2581 unsigned int num_tx_queues);
2595 static inline bool skb_is_gso(
const struct sk_buff *skb)
2597 return skb_shinfo(skb)->gso_size;
2600 static inline bool skb_is_gso_v6(
const struct sk_buff *skb)
2607 static inline bool skb_warn_if_lro(
const struct sk_buff *skb)
2613 if (skb_is_nonlinear(skb) && shinfo->
gso_size != 0 &&
2621 static inline void skb_forward_csum(
struct sk_buff *skb)
2636 static inline void skb_checksum_none_assert(
const struct sk_buff *skb)
2654 static inline bool skb_head_is_locked(
const struct sk_buff *skb)
2656 return !skb->
head_frag || skb_cloned(skb);