Skip to content

Commit

Permalink
netfilter: nft_tproxy: Move nf_tproxy_assign_sock() to nf_tproxy.h
Browse files Browse the repository at this point in the history
This function is also necessary to implement nft tproxy support

Fixes: 45ca4e0 ("netfilter: Libify xt_TPROXY")
Signed-off-by: Máté Eckl <ecklm94@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Máté Eckl authored and Pablo Neira Ayuso committed Jul 16, 2018
1 parent e97d940 commit f286586
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 8 additions & 0 deletions include/net/netfilter/nf_tproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ static inline bool nf_tproxy_sk_is_transparent(struct sock *sk)
return false;
}

/* assign a socket to the skb -- consumes sk */
static inline void nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk)
{
skb_orphan(skb);
skb->sk = sk;
skb->destructor = sock_edemux;
}

__be32 nf_tproxy_laddr4(struct sk_buff *skb, __be32 user_laddr, __be32 daddr);

/**
Expand Down
9 changes: 0 additions & 9 deletions net/netfilter/xt_TPROXY.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@
#include <net/netfilter/nf_tproxy.h>
#include <linux/netfilter/xt_TPROXY.h>

/* assign a socket to the skb -- consumes sk */
static void
nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk)
{
skb_orphan(skb);
skb->sk = sk;
skb->destructor = sock_edemux;
}

static unsigned int
tproxy_tg4(struct net *net, struct sk_buff *skb, __be32 laddr, __be16 lport,
u_int32_t mark_mask, u_int32_t mark_value)
Expand Down

0 comments on commit f286586

Please sign in to comment.