[PATCH nf-next 07/19] netfilter: nft_payload: export mangle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Having struct nft_payload_set public already we now acquire the
ability to apply the payload changes separately from nft_payload.c

Signed-off-by: Boris Sukholitko <boris.sukholitko@xxxxxxxxxxxx>
---
 include/net/netfilter/nf_tables.h | 3 +++
 net/netfilter/nft_payload.c       | 7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index b027200caf5b..cba06ea3fedd 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -1729,4 +1729,7 @@ static inline bool nft_reg_track_cmp(struct nft_regs_track *track,
 	       track->regs[dreg].num_reg == 0;
 }
 
+int nft_payload_mangle(const struct nft_payload_set *priv,
+		       const struct nft_pktinfo *pkt,
+		       const u32 *src);
 #endif /* _NET_NF_TABLES_H */
diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c
index ed4a65ac68d5..50109663bb13 100644
--- a/net/netfilter/nft_payload.c
+++ b/net/netfilter/nft_payload.c
@@ -788,9 +788,9 @@ static int nft_payload_csum_inet(struct sk_buff *skb, const u32 *src,
 	return 0;
 }
 
-static int nft_payload_mangle(const struct nft_payload_set *priv,
-			      const struct nft_pktinfo *pkt,
-			      const u32 *src)
+int nft_payload_mangle(const struct nft_payload_set *priv,
+		       const struct nft_pktinfo *pkt,
+		       const u32 *src)
 {
 	struct sk_buff *skb = pkt->skb;
 	int offset, csum_offset;
@@ -854,6 +854,7 @@ static int nft_payload_mangle(const struct nft_payload_set *priv,
 err:
 	return -1;
 }
+EXPORT_SYMBOL_GPL(nft_payload_mangle);
 
 static void nft_payload_set_eval(const struct nft_expr *expr,
 				 struct nft_regs *regs,
-- 
2.32.0

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux