summaryrefslogtreecommitdiffstats
path: root/src/statement.c
diff options
context:
space:
mode:
authorShivani Bhardwaj <shivanib134@gmail.com>2016-01-23 02:25:55 +0530
committerPablo Neira Ayuso <pablo@netfilter.org>2016-03-03 19:54:30 +0100
commitcf8e0db8aacbafac5acb1f42afd62d8215ca5863 (patch)
tree7202b75c39b68c1a6c553a3102c7b40dce10a702 /src/statement.c
parent45e5e4e92a2c882b22e95a807026611612d57729 (diff)
src: Add support for masquerade port selection
Provide full support for masquerading by allowing port range selection, eg. # nft add rule nat postrouting ip protocol tcp masquerade to :1024-10024 Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/statement.c')
-rw-r--r--src/statement.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/statement.c b/src/statement.c
index ca924410..2a6f19f8 100644
--- a/src/statement.c
+++ b/src/statement.c
@@ -385,13 +385,24 @@ static void masq_stmt_print(const struct stmt *stmt)
{
printf("masquerade");
+ if (stmt->masq.proto) {
+ printf(" to :");
+ expr_print(stmt->masq.proto);
+ }
+
print_nf_nat_flags(stmt->masq.flags);
}
+static void masq_stmt_destroy(struct stmt *stmt)
+{
+ expr_free(stmt->masq.proto);
+}
+
static const struct stmt_ops masq_stmt_ops = {
.type = STMT_MASQ,
.name = "masq",
.print = masq_stmt_print,
+ .destroy = masq_stmt_destroy,
};
struct stmt *masq_stmt_alloc(const struct location *loc)