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 list set type.

Add skbinfo extension kernel support for the list set type.
Introduce the new revision of the list set type.

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
cbee93d7 af331419

+17 -2
+17 -2
net/netfilter/ipset/ip_set_list_set.c
··· 17 17 18 18 #define IPSET_TYPE_REV_MIN 0 19 19 /* 1 Counters support added */ 20 - #define IPSET_TYPE_REV_MAX 2 /* Comments support added */ 20 + /* 2 Comments support added */ 21 + #define IPSET_TYPE_REV_MAX 3 /* skbinfo support added */ 21 22 22 23 MODULE_LICENSE("GPL"); 23 24 MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>"); ··· 74 73 ip_set_update_counter(ext_counter(e, set), 75 74 ext, &opt->ext, 76 75 cmdflags); 76 + if (SET_WITH_SKBINFO(set)) 77 + ip_set_get_skbinfo(ext_skbinfo(e, set), 78 + ext, &opt->ext, 79 + cmdflags); 77 80 return ret; 78 81 } 79 82 } ··· 202 197 ip_set_init_counter(ext_counter(e, set), ext); 203 198 if (SET_WITH_COMMENT(set)) 204 199 ip_set_init_comment(ext_comment(e, set), ext); 200 + if (SET_WITH_SKBINFO(set)) 201 + ip_set_init_skbinfo(ext_skbinfo(e, set), ext); 205 202 return 0; 206 203 } 207 204 ··· 314 307 ip_set_init_counter(ext_counter(e, set), ext); 315 308 if (SET_WITH_COMMENT(set)) 316 309 ip_set_init_comment(ext_comment(e, set), ext); 310 + if (SET_WITH_SKBINFO(set)) 311 + ip_set_init_skbinfo(ext_skbinfo(e, set), ext); 317 312 /* Set is already added to the list */ 318 313 ip_set_put_byindex(map->net, d->id); 319 314 return 0; ··· 387 378 !ip_set_optattr_netorder(tb, IPSET_ATTR_TIMEOUT) || 388 379 !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS) || 389 380 !ip_set_optattr_netorder(tb, IPSET_ATTR_PACKETS) || 390 - !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES))) 381 + !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES) || 382 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBMARK) || 383 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBPRIO) || 384 + !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBQUEUE))) 391 385 return -IPSET_ERR_PROTOCOL; 392 386 393 387 if (tb[IPSET_ATTR_LINENO]) ··· 679 667 [IPSET_ATTR_BYTES] = { .type = NLA_U64 }, 680 668 [IPSET_ATTR_PACKETS] = { .type = NLA_U64 }, 681 669 [IPSET_ATTR_COMMENT] = { .type = NLA_NUL_STRING }, 670 + [IPSET_ATTR_SKBMARK] = { .type = NLA_U64 }, 671 + [IPSET_ATTR_SKBPRIO] = { .type = NLA_U32 }, 672 + [IPSET_ATTR_SKBQUEUE] = { .type = NLA_U16 }, 682 673 }, 683 674 .me = THIS_MODULE, 684 675 };