summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-02-13 15:51:37 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2012-02-13 17:24:56 +0100
commita6ee11110de48437421e9fec666c0c45d78fde67 (patch)
tree8e260b336c2af910b76b27a69af782090f6c4c44 /tools
parent9217798bd9f0f4af617fe9337987f42c5cefd108 (diff)
downloadconnman-a6ee11110de48437421e9fec666c0c45d78fde67.tar.gz
connman-a6ee11110de48437421e9fec666c0c45d78fde67.tar.bz2
connman-a6ee11110de48437421e9fec666c0c45d78fde67.zip
iptables-test: Mask address when parsing ip/prefixlen
Netfilter likes to have the address properly masked.
Diffstat (limited to 'tools')
-rw-r--r--tools/iptables-test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/iptables-test.c b/tools/iptables-test.c
index feefc535..5411bd1d 100644
--- a/tools/iptables-test.c
+++ b/tools/iptables-test.c
@@ -1488,6 +1488,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);