diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2012-02-13 15:51:38 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-02-13 17:24:56 +0100 |
commit | 7085edaa788877805504a2167168b283b0ebca01 (patch) | |
tree | 5e9f47b213e203960943ec7f89243a9cb29448e0 /src/iptables.c | |
parent | a6ee11110de48437421e9fec666c0c45d78fde67 (diff) | |
download | connman-7085edaa788877805504a2167168b283b0ebca01.tar.gz connman-7085edaa788877805504a2167168b283b0ebca01.tar.bz2 connman-7085edaa788877805504a2167168b283b0ebca01.zip |
iptables: Mask address when parsing ip/prefixlen
Netfilter likes to have the address properly masked.
Diffstat (limited to 'src/iptables.c')
-rw-r--r-- | src/iptables.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/iptables.c b/src/iptables.c index 80f63ec2..7c62ec3d 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -1498,6 +1498,7 @@ static int parse_ip_and_mask(const char *str, struct in_addr *ip, struct in_addr } mask->s_addr = htonl(tmp); + ip->s_addr = ip->s_addr & mask->s_addr; err = 0; out: g_strfreev(tokens); |