Skip to contentSkip to conversation

new ipset set type - hash:ip,mac

PATCH Tomasz Chiliński 1 participant 1 message Apr 23, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi All,

Firstly - thanks a lot for excellent ipset toolkit!

I've created lately my own very missed set type hash:ip,mac which stored any ipv4/ipv6 - mac pairs using hashing structures. It allows to create only single set with all addresses and macs used in quite large lans without bothering with separated sets for different ip segments.

I've attached patches for kernel 4.1 and ipset 6.29. I could also prepare for newer kernel versions if one would be interested in it ;-)

Any feedback or reviews would be very appreciated!

--
Bests,
Tomasz Chiliński, Chilan

net/netfilter/ipset/Makefile +1 -0
@@ -18,6 +18,7 @@
 obj-$(CONFIG_IP_SET_HASH_IPPORT) += ip_set_hash_ipport.o
 obj-$(CONFIG_IP_SET_HASH_IPPORTIP) += ip_set_hash_ipportip.o
 obj-$(CONFIG_IP_SET_HASH_IPPORTNET) += ip_set_hash_ipportnet.o
+obj-$(CONFIG_IP_SET_HASH_IPMAC) += ip_set_hash_ipmac.o
 obj-$(CONFIG_IP_SET_HASH_MAC) += ip_set_hash_mac.o
 obj-$(CONFIG_IP_SET_HASH_NET) += ip_set_hash_net.o
 obj-$(CONFIG_IP_SET_HASH_NETPORT) += ip_set_hash_netport.o
net/netfilter/ipset/Kconfig +9 -0
@@ -99,6 +99,15 @@
 
 	  To compile it as a module, choose M here.  If unsure, say N.
 
+config IP_SET_HASH_IPMAC
+	tristate "hash:ip,mac set support"
+	depends on IP_SET
+	help
+	  This option adds the hash:ip,mac set type support, by which
+	  one can store IPv4/IPv6 address and MAC (ethernet address) pairs in a set.
+
+	  To compile it as a module, choose M here.  If unsure, say N.
+
 config IP_SET_HASH_MAC
 	tristate "hash:mac set support"
 	depends on IP_SET
net/netfilter/ipset/ip_set_hash_ipmac.c new file +308 -0

308 lines not on this page · raw message

lib/Makefile.am +1 -0
@@ -14,6 +14,7 @@
 	ipset_hash_netportnet.c \
 	ipset_hash_netport.c \
 	ipset_hash_netiface.c \
+	ipset_hash_ipmac.c \
 	ipset_hash_mac.c \
 	ipset_list_set.c
 
lib/Makefile.in +1 -0
@@ -462,6 +462,7 @@
 	ipset_hash_ipmark.c \
 	ipset_hash_ipportip.c \
 	ipset_hash_ipportnet.c \
+	ipset_hash_ipmac.c \
 	ipset_hash_net.c \
 	ipset_hash_netnet.c \
 	ipset_hash_netportnet.c \
lib/ipset_hash_ipmac.c new file +166 -0

166 lines not on this page · raw message