]> git.ipfire.org Git - thirdparty/ipset.git/commit
netfilter: ipset: forbid family for hash:mac sets
authorFlorent Fourcot <florent.fourcot@wifirst.fr>
Mon, 4 Jun 2018 14:51:19 +0000 (16:51 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 4 Jun 2018 18:56:47 +0000 (20:56 +0200)
commit46d864d62dac24559ea9cd4c403819157498fdf3
treecb80e085e52ee3ff943e6956a37d5c0bce8e06e9
parentcef553009b5181ae3c9f465c0e300ec8c8b37fbd
netfilter: ipset: forbid family for hash:mac sets

Userspace `ipset` command forbids family option for hash:mac type:

ipset create test hash:mac family inet4
ipset v6.30: Unknown argument: `family'

However, this check is not done in kernel itself. When someone use
external netlink applications (pyroute2 python library for example), one
can create hash:mac with invalid family and inconsistant results from
userspace (`ipset` command cannot read set content anymore).

This patch enforce the logic in kernel, and forbids insertion of
hash:mac with a family set.

Since IP_SET_PROTO_UNDEF is defined only for hash:mac, this patch has no
impact on other hash:* sets

Signed-off-by: Florent Fourcot <florent.fourcot@wifirst.fr>
Signed-off-by: Victorien Molle <victorien.molle@wifirst.fr>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
kernel/net/netfilter/ipset/ip_set_hash_gen.h