Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: nft_tproxy: Move nf_tproxy_assign_sock() to nf_tproxy.h

This function is also necessary to implement nft tproxy support

Fixes: 45ca4e0cf273 ("netfilter: Libify xt_TPROXY")
Signed-off-by: Máté Eckl <ecklm94@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Máté Eckl and committed by
Pablo Neira Ayuso
f286586d e97d9404

+8 -9
+8
include/net/netfilter/nf_tproxy.h
··· 17 17 return false; 18 18 } 19 19 20 + /* assign a socket to the skb -- consumes sk */ 21 + static inline void nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk) 22 + { 23 + skb_orphan(skb); 24 + skb->sk = sk; 25 + skb->destructor = sock_edemux; 26 + } 27 + 20 28 __be32 nf_tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr); 21 29 22 30 /**
-9
net/netfilter/xt_TPROXY.c
··· 36 36 #include <net/netfilter/nf_tproxy.h> 37 37 #include <linux/netfilter/xt_TPROXY.h> 38 38 39 - /* assign a socket to the skb -- consumes sk */ 40 - static void 41 - nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk) 42 - { 43 - skb_orphan(skb); 44 - skb->sk = sk; 45 - skb->destructor = sock_edemux; 46 - } 47 - 48 39 static unsigned int 49 40 tproxy_tg4(struct net *net, struct sk_buff *skb, __be32 laddr, __be16 lport, 50 41 u_int32_t mark_mask, u_int32_t mark_value)