projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6ee111
)
iptables: Mask address when parsing ip/prefixlen
author
Daniel Wagner
<daniel.wagner@bmw-carit.de>
Mon, 13 Feb 2012 14:51:38 +0000
(15:51 +0100)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Mon, 13 Feb 2012 16:24:56 +0000
(17:24 +0100)
Netfilter likes to have the address properly masked.
src/iptables.c
patch
|
blob
|
history
diff --git
a/src/iptables.c
b/src/iptables.c
index 80f63ec2bd6c812bedf5665d375781a8ee249259..7c62ec3d74f87417c6d107729f48eb37e60b229a 100644
(file)
--- 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);