summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_nat_sip.c
diff options
context:
space:
mode:
authorLiping Zhang2016-09-14 17:41:46 +0200
committerPablo Neira Ayuso2016-09-23 09:29:50 +0200
commit8061bb54436c19fd16b7c734a69ff60bac26e3e9 (patch)
treedc741bf1d2d48f5645dc42dcdbc20a5b1678c3f4 /net/netfilter/nf_nat_sip.c
parentnetfilter: nf_tables: validate maximum value of u32 netlink attributes (diff)
downloadkernel-qcow2-linux-8061bb54436c19fd16b7c734a69ff60bac26e3e9.tar.gz
kernel-qcow2-linux-8061bb54436c19fd16b7c734a69ff60bac26e3e9.tar.xz
kernel-qcow2-linux-8061bb54436c19fd16b7c734a69ff60bac26e3e9.zip
netfilter: nft_queue: add _SREG_QNUM attr to select the queue number
Currently, the user can specify the queue numbers by _QUEUE_NUM and _QUEUE_TOTAL attributes, this is enough in most situations. But acctually, it is not very flexible, for example: tcp dport 80 mapped to queue0 tcp dport 81 mapped to queue1 tcp dport 82 mapped to queue2 In order to do this thing, we must add 3 nft rules, and more mapping meant more rules ... So take one register to select the queue number, then we can add one simple rule to mapping queues, maybe like this: queue num tcp dport map { 80:0, 81:1, 82:2 ... } Florian Westphal also proposed wider usage scenarios: queue num jhash ip saddr . ip daddr mod ... queue num meta cpu ... queue num meta mark ... The last point is how to load a queue number from sreg, although we can use *(u16*)&regs->data[reg] to load the queue number, just like nat expr to load its l4port do. But we will cooperate with hash expr, meta cpu, meta mark expr and so on. They all store the result to u32 type, so cast it to u16 pointer and dereference it will generate wrong result in the big endian system. So just keep it simple, we treat queue number as u32 type, although u16 type is already enough. Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_nat_sip.c')
0 files changed, 0 insertions, 0 deletions