Skip to content
  1. Dec 27, 2011
  2. Dec 26, 2011
  3. Dec 25, 2011
  4. Dec 24, 2011
  5. Dec 23, 2011
    • Florian Westphal's avatar
      netfilter: xt_connbytes: handle negation correctly · 0354b48f
      Florian Westphal authored
      
      
      "! --connbytes 23:42" should match if the packet/byte count is not in range.
      
      As there is no explict "invert match" toggle in the match structure,
      userspace swaps the from and to arguments
      (i.e., as if "--connbytes 42:23" were given).
      
      However, "what <= 23 && what >= 42" will always be false.
      
      Change things so we use "||" in case "from" is larger than "to".
      
      This change may look like it breaks backwards compatibility when "to" is 0.
      However, older iptables binaries will refuse "connbytes 42:0",
      and current releases treat it to mean "! --connbytes 0:42",
      so we should be fine.
      
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      0354b48f