summaryrefslogtreecommitdiffstats
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorSergey Popovich <popovich_sergei@mail.ru>2013-11-07 12:56:45 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2013-11-11 22:38:09 +0100
commit0e3c7cac897a4436461e1b77bf0b2f870a63be42 (patch)
tree222d954c6b8e4f72a08afab61e32eee7d0ca1a33 /src/Makefile.am
parentfe2f6de44c48d98891454c5ddd64260f7d7ccb9f (diff)
ipset: Follow manual page behavior for SET target on list:set
ipset(8) for list:set says: The match will try to find a matching entry in the sets and the target will try to add an entry to the first set to which it can be added. However real behavior is bit differ from described. Consider example: # ipset create test-1-v4 hash:ip family inet # ipset create test-1-v6 hash:ip family inet6 # ipset create test-1 list:set # ipset add test-1 test-1-v4 # ipset add test-1 test-1-v6 # iptables -A INPUT -p tcp --destination-port 25 -j SET --add-set test-1 src # ip6tables -A INPUT -p tcp --destination-port 25 -j SET --add-set test-1 src And then when iptables/ip6tables rule matches packet IPSET target tries to add src from packet to the list:set test-1 where first entry is test-1-v4 and the second one is test-1-v6. For IPv4, as it first entry in test-1 src added to test-1-v4 correctly, but for IPv6 src not added! Placing test-1-v6 to the first element of list:set makes behavior correct for IPv6, but brokes for IPv4. This is due to result, returned from ip_set_add() and ip_set_del() from net/netfilter/ipset/ip_set_core.c when set in list:set equires more parameters than given or address families do not match (which is this case). It seems wrong returning 0 from ip_set_add() and ip_set_del() in this case, as 0 should be returned only when an element successfuly added/deleted to/from the set, contrary to ip_set_test() which returns 0 when no entry exists and >0 when entry found in set. Signed-off-by: Sergey Popovich <popovich_sergei@mail.ru> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'src/Makefile.am')
0 files changed, 0 insertions, 0 deletions