diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2010-11-06 01:21:44 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-11-06 01:21:44 +0100 |
commit | 8f124fea0748a0b05e39a461ee04e2ecdb979c6c (patch) | |
tree | 6fe05b46e403629aa3a1e88d96b901aaebe6acc1 /src | |
parent | 5b30f2b086715158c5a7940577f551862bfc391d (diff) | |
download | connman-8f124fea0748a0b05e39a461ee04e2ecdb979c6c.tar.gz connman-8f124fea0748a0b05e39a461ee04e2ecdb979c6c.tar.bz2 connman-8f124fea0748a0b05e39a461ee04e2ecdb979c6c.zip |
iptables: Add support for interface and IP option inversion
Diffstat (limited to 'src')
-rw-r--r-- | src/iptables.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/iptables.c b/src/iptables.c index 1252d792..b978d5e9 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -910,6 +910,9 @@ static int iptables_command(int argc, char *argv[]) ip.dst = dst; inet_pton(AF_INET, "255.255.255.255", &ip.dmsk); + if (invert) + ip.invflags |= IPT_INV_DSTIP; + break; case 'i': @@ -921,6 +924,9 @@ static int iptables_command(int argc, char *argv[]) strcpy(ip.iniface, optarg); memset(ip.iniface_mask, 0xff, in_len + 1); + if (invert) + ip.invflags |= IPT_INV_VIA_IN; + break; case 'j': @@ -984,6 +990,9 @@ static int iptables_command(int argc, char *argv[]) strcpy(ip.outiface, optarg); memset(ip.outiface_mask, 0xff, out_len + 1); + if (invert) + ip.invflags |= IPT_INV_VIA_OUT; + break; case 's': @@ -993,6 +1002,9 @@ static int iptables_command(int argc, char *argv[]) ip.src = src; inet_pton(AF_INET, "255.255.255.255", &ip.smsk); + if (invert) + ip.invflags |= IPT_INV_SRCIP; + break; case 't': @@ -1024,6 +1036,8 @@ static int iptables_command(int argc, char *argv[]) break; } + + invert = FALSE; } if (table_name == NULL) |