From 6dd45b13115d77860a8e3b37caa1560cbcfd265c Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 13 Oct 2008 13:30:44 +0200 Subject: helper: explicit helper assignation support This patch adds support for explicit helper assignation. This support will not be of any help without the appropriate kernel support that will go into the Linux kernel 2.6.29 -sic-. Signed-off-by: Pablo Neira Ayuso --- src/conntrack/build.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/conntrack/build.c') diff --git a/src/conntrack/build.c b/src/conntrack/build.c index 1bc87f9..f9d6f8e 100644 --- a/src/conntrack/build.c +++ b/src/conntrack/build.c @@ -308,6 +308,21 @@ void __build_secmark(struct nfnlhdr *req, nfnl_addattr32(&req->nlh, size, CTA_SECMARK, htonl(ct->secmark)); } +void __build_helper_name(struct nfnlhdr *req, + size_t size, + const struct nf_conntrack *ct) +{ + struct nfattr *nest; + + nest = nfnl_nest(&req->nlh, size, CTA_HELP); + nfnl_addattr_l(&req->nlh, + size, + CTA_HELP_NAME, + ct->helper_name, + strlen(ct->helper_name)); + nfnl_nest_end(&req->nlh, nest); +} + int __build_conntrack(struct nfnl_subsys_handle *ssh, struct nfnlhdr *req, size_t size, @@ -417,5 +432,8 @@ int __build_conntrack(struct nfnl_subsys_handle *ssh, test_bit(ATTR_REPL_NAT_SEQ_OFFSET_AFTER, ct->set)) __build_nat_seq_adj(req, size, ct, __DIR_REPL); + if (test_bit(ATTR_HELPER_NAME, ct->set)) + __build_helper_name(req, size, ct); + return 0; } -- cgit v1.2.3