1. 23 9月, 2016 2 次提交
    • L
      netfilter: nft_queue: add _SREG_QNUM attr to select the queue number · 8061bb54
      Liping Zhang 提交于
      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: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NLiping Zhang <liping.zhang@spreadtrum.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      8061bb54
    • L
      netfilter: nf_tables: validate maximum value of u32 netlink attributes · 36b701fa
      Laura Garcia Liebana 提交于
      Fetch value and validate u32 netlink attribute. This validation is
      usually required when the u32 netlink attributes are being stored in a
      field whose size is smaller.
      
      This patch revisits 4da449ae ("netfilter: nft_exthdr: Add size check
      on u8 nft_exthdr attributes").
      
      Fixes: 96518518 ("netfilter: add nftables")
      Suggested-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NLaura Garcia Liebana <nevola@gmail.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      36b701fa
  2. 22 9月, 2016 1 次提交
  3. 13 9月, 2016 14 次提交
  4. 09 9月, 2016 2 次提交
  5. 07 9月, 2016 21 次提交