diff options
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f589c9af8cbf..5e1e6f2d98c2 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -2725,7 +2725,7 @@ static inline void nf_reset(struct sk_buff *skb) | |||
2725 | 2725 | ||
2726 | static inline void nf_reset_trace(struct sk_buff *skb) | 2726 | static inline void nf_reset_trace(struct sk_buff *skb) |
2727 | { | 2727 | { |
2728 | #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) | 2728 | #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) || defined(CONFIG_NF_TABLES) |
2729 | skb->nf_trace = 0; | 2729 | skb->nf_trace = 0; |
2730 | #endif | 2730 | #endif |
2731 | } | 2731 | } |
@@ -2742,6 +2742,9 @@ static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) | |||
2742 | dst->nf_bridge = src->nf_bridge; | 2742 | dst->nf_bridge = src->nf_bridge; |
2743 | nf_bridge_get(src->nf_bridge); | 2743 | nf_bridge_get(src->nf_bridge); |
2744 | #endif | 2744 | #endif |
2745 | #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) || defined(CONFIG_NF_TABLES) | ||
2746 | dst->nf_trace = src->nf_trace; | ||
2747 | #endif | ||
2745 | } | 2748 | } |
2746 | 2749 | ||
2747 | static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) | 2750 | static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) |
@@ -2916,5 +2919,22 @@ static inline bool skb_head_is_locked(const struct sk_buff *skb) | |||
2916 | { | 2919 | { |
2917 | return !skb->head_frag || skb_cloned(skb); | 2920 | return !skb->head_frag || skb_cloned(skb); |
2918 | } | 2921 | } |
2922 | |||
2923 | /** | ||
2924 | * skb_gso_network_seglen - Return length of individual segments of a gso packet | ||
2925 | * | ||
2926 | * @skb: GSO skb | ||
2927 | * | ||
2928 | * skb_gso_network_seglen is used to determine the real size of the | ||
2929 | * individual segments, including Layer3 (IP, IPv6) and L4 headers (TCP/UDP). | ||
2930 | * | ||
2931 | * The MAC/L2 header is not accounted for. | ||
2932 | */ | ||
2933 | static inline unsigned int skb_gso_network_seglen(const struct sk_buff *skb) | ||
2934 | { | ||
2935 | unsigned int hdr_len = skb_transport_header(skb) - | ||
2936 | skb_network_header(skb); | ||
2937 | return hdr_len + skb_gso_transport_seglen(skb); | ||
2938 | } | ||
2919 | #endif /* __KERNEL__ */ | 2939 | #endif /* __KERNEL__ */ |
2920 | #endif /* _LINUX_SKBUFF_H */ | 2940 | #endif /* _LINUX_SKBUFF_H */ |