Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: ipset: Add skbinfo extension kernel support for the bitmap set types.

Add skbinfo extension kernel support for the bitmap set types.
Inroduce the new revisions of bitmap_ip, bitmap_ipmac and bitmap_port set types.

Signed-off-by: Anton Danilov <littlesmilingcloud@gmail.com>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>

authored by

Anton Danilov and committed by
Jozsef Kadlecsik
39d1ecf1 0e9871e3

+31 -6
+4
net/netfilter/ipset/ip_set_bitmap_gen.h
··· 128 128 return 0; 129 129 if (SET_WITH_COUNTER(set)) 130 130 ip_set_update_counter(ext_counter(x, set), ext, mext, flags); 131 + if (SET_WITH_SKBINFO(set)) 132 + ip_set_get_skbinfo(ext_skbinfo(x, set), ext, mext, flags); 131 133 return 1; 132 134 } 133 135 ··· 163 161 ip_set_init_counter(ext_counter(x, set), ext); 164 162 if (SET_WITH_COMMENT(set)) 165 163 ip_set_init_comment(ext_comment(x, set), ext); 164 + if (SET_WITH_SKBINFO(set)) 165 + ip_set_init_skbinfo(ext_skbinfo(x, set), ext); 166 166 return 0; 167 167 } 168 168
+9 -2
net/netfilter/ipset/ip_set_bitmap_ip.c
··· 27 27 28 28 #define IPSET_TYPE_REV_MIN 0 29 29 /* 1 Counter support added */ 30 - #define IPSET_TYPE_REV_MAX 2 /* Comment support added */ 30 + /* 2 Comment support added */ 31 + #define IPSET_TYPE_REV_MAX 3 /* skbinfo support added */ 31 32 32 33 MODULE_LICENSE("GPL"); 33 34 MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); ··· 140 139 if (unlikely(!tb[IPSET_ATTR_IP] || 141 140 !ip_set_optattr_netorder(tb, IPSET_ATTR_TIMEOUT) || 142 141 !ip_set_optattr_netorder(tb, IPSET_ATTR_PACKETS) || 143 - !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES))) 142 + !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES) || 143 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBMARK) || 144 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBPRIO) || 145 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBQUEUE))) 144 146 return -IPSET_ERR_PROTOCOL; 145 147 146 148 if (tb[IPSET_ATTR_LINENO]) ··· 361 357 [IPSET_ATTR_BYTES] = { .type = NLA_U64 }, 362 358 [IPSET_ATTR_PACKETS] = { .type = NLA_U64 }, 363 359 [IPSET_ATTR_COMMENT] = { .type = NLA_NUL_STRING }, 360 + [IPSET_ATTR_SKBMARK] = { .type = NLA_U64 }, 361 + [IPSET_ATTR_SKBPRIO] = { .type = NLA_U32 }, 362 + [IPSET_ATTR_SKBQUEUE] = { .type = NLA_U16 }, 364 363 }, 365 364 .me = THIS_MODULE, 366 365 };
+9 -2
net/netfilter/ipset/ip_set_bitmap_ipmac.c
··· 27 27 28 28 #define IPSET_TYPE_REV_MIN 0 29 29 /* 1 Counter support added */ 30 - #define IPSET_TYPE_REV_MAX 2 /* Comment support added */ 30 + /* 2 Comment support added */ 31 + #define IPSET_TYPE_REV_MAX 3 /* skbinfo support added */ 31 32 32 33 MODULE_LICENSE("GPL"); 33 34 MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); ··· 241 240 if (unlikely(!tb[IPSET_ATTR_IP] || 242 241 !ip_set_optattr_netorder(tb, IPSET_ATTR_TIMEOUT) || 243 242 !ip_set_optattr_netorder(tb, IPSET_ATTR_PACKETS) || 244 - !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES))) 243 + !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES) || 244 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBMARK) || 245 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBPRIO) || 246 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBQUEUE))) 245 247 return -IPSET_ERR_PROTOCOL; 246 248 247 249 if (tb[IPSET_ATTR_LINENO]) ··· 398 394 [IPSET_ATTR_BYTES] = { .type = NLA_U64 }, 399 395 [IPSET_ATTR_PACKETS] = { .type = NLA_U64 }, 400 396 [IPSET_ATTR_COMMENT] = { .type = NLA_NUL_STRING }, 397 + [IPSET_ATTR_SKBMARK] = { .type = NLA_U64 }, 398 + [IPSET_ATTR_SKBPRIO] = { .type = NLA_U32 }, 399 + [IPSET_ATTR_SKBQUEUE] = { .type = NLA_U16 }, 401 400 }, 402 401 .me = THIS_MODULE, 403 402 };
+9 -2
net/netfilter/ipset/ip_set_bitmap_port.c
··· 22 22 23 23 #define IPSET_TYPE_REV_MIN 0 24 24 /* 1 Counter support added */ 25 - #define IPSET_TYPE_REV_MAX 2 /* Comment support added */ 25 + /* 2 Comment support added */ 26 + #define IPSET_TYPE_REV_MAX 3 /* skbinfo support added */ 26 27 27 28 MODULE_LICENSE("GPL"); 28 29 MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); ··· 140 139 !ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO) || 141 140 !ip_set_optattr_netorder(tb, IPSET_ATTR_TIMEOUT) || 142 141 !ip_set_optattr_netorder(tb, IPSET_ATTR_PACKETS) || 143 - !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES))) 142 + !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES) || 143 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBMARK) || 144 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBPRIO) || 145 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBQUEUE))) 144 146 return -IPSET_ERR_PROTOCOL; 145 147 146 148 if (tb[IPSET_ATTR_LINENO]) ··· 295 291 [IPSET_ATTR_BYTES] = { .type = NLA_U64 }, 296 292 [IPSET_ATTR_PACKETS] = { .type = NLA_U64 }, 297 293 [IPSET_ATTR_COMMENT] = { .type = NLA_NUL_STRING }, 294 + [IPSET_ATTR_SKBMARK] = { .type = NLA_U64 }, 295 + [IPSET_ATTR_SKBPRIO] = { .type = NLA_U32 }, 296 + [IPSET_ATTR_SKBQUEUE] = { .type = NLA_U16 }, 298 297 }, 299 298 .me = THIS_MODULE, 300 299 };