--- zzzz-none-000/linux-4.19.183/include/linux/skbuff.h 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/include/linux/skbuff.h 2023-06-28 08:54:20.000000000 +0000 @@ -250,7 +250,7 @@ }; #endif -#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) +#if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) || defined(CONFIG_BCM_KF_SKB_EXT) struct nf_bridge_info { refcount_t use; enum { @@ -491,6 +491,11 @@ * the end of the header data, ie. at skb->end. */ struct skb_shared_info { +#if defined(CONFIG_BCM_KF_NBUFF) + /* to preserve compat with binary only modules, do not change the + * position of this field relative to the start of the structure. */ + __u8 *dirty_p; +#endif /* defined(CONFIG_BCM_KF_NBUFF) */ __u8 __unused; __u8 meta_len; __u8 nr_frags; @@ -587,6 +592,10 @@ typedef unsigned char *sk_buff_data_t; #endif +#if defined(CONFIG_BCM_KF_SKB_EXT) +#include +#endif + /** * struct sk_buff - socket buffer * @next: Next buffer in list @@ -662,7 +671,14 @@ * @users: User count - see {datagram,tcp}.c */ +#if defined(CONFIG_BCM_KF_SKB_EXT) +/* + * Please note struct sk_buff is moved to bcm_skbuff.h. Here is no longer used. + */ +struct sk_buff_orig { +#else struct sk_buff { +#endif union { struct { /* These two members must be first. */ @@ -697,7 +713,11 @@ * want to keep them across layers you have to do a skb_clone() * first. This is owned by whoever has the skb queued ATM. */ +#if !defined(CONFIG_BCM_KF_MPTCP) || !defined(CONFIG_BCM_MPTCP) char cb[48] __aligned(8); +#else + char cb[80] __aligned(8); +#endif union { struct { @@ -3894,6 +3914,29 @@ atomic_inc(&nfct->use); } #endif + +#if defined(CONFIG_AVM_PA_GENERIC_CT) +static inline void generic_ct_reset(struct sk_buff *skb) +{ + generic_ct_put(SKB_GENERIC_CT(skb)); + SKB_GENERIC_CT(skb) = NULL; +} + +static inline void __generic_ct_copy(struct sk_buff *dst, + const struct sk_buff *src) +{ + SKB_GENERIC_CT(dst) = generic_ct_get(SKB_GENERIC_CT(src)); + SKB_GENERIC_CT_DIR(dst) = SKB_GENERIC_CT_DIR(src); +} + +static inline void generic_ct_copy(struct sk_buff *dst, + const struct sk_buff *src) +{ + generic_ct_put(SKB_GENERIC_CT(dst)); + __generic_ct_copy(dst, src); +} +#endif + #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) { @@ -3906,7 +3949,8 @@ refcount_inc(&nf_bridge->use); } #endif /* CONFIG_BRIDGE_NETFILTER */ -static inline void nf_reset(struct sk_buff *skb) + +static inline void nf_reset_no_generic_ct(struct sk_buff *skb) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) nf_conntrack_put(skb_nfct(skb)); @@ -3918,6 +3962,14 @@ #endif } +static inline void nf_reset(struct sk_buff *skb) +{ + nf_reset_no_generic_ct(skb); +#ifdef CONFIG_AVM_PA_GENERIC_CT + generic_ct_reset(skb); +#endif +} + static inline void nf_reset_trace(struct sk_buff *skb) { #if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE) || defined(CONFIG_NF_TABLES) @@ -3933,8 +3985,9 @@ } /* Note: This doesn't put any conntrack and bridge info in dst. */ -static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src, - bool copy) +static inline void __nf_copy_no_generic_ct(struct sk_buff *dst, + const struct sk_buff *src, + bool copy) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) dst->_nfct = src->_nfct; @@ -3950,7 +4003,18 @@ #endif } -static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) +/* Note: This doesn't put any conntrack and bridge info in dst. */ +static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src, + bool copy) +{ + __nf_copy_no_generic_ct(dst, src, copy); +#ifdef CONFIG_AVM_PA_GENERIC_CT + __generic_ct_copy(dst, src); +#endif +} + +static inline void nf_copy_no_generic_ct(struct sk_buff *dst, + const struct sk_buff *src) { #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) nf_conntrack_put(skb_nfct(dst)); @@ -3958,7 +4022,15 @@ #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER) nf_bridge_put(dst->nf_bridge); #endif - __nf_copy(dst, src, true); + __nf_copy_no_generic_ct(dst, src, true); +} + +static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) +{ + nf_copy_no_generic_ct(dst, src); +#ifdef CONFIG_AVM_PA_GENERIC_CT + generic_ct_copy(dst, src); +#endif } #ifdef CONFIG_NETWORK_SECMARK