1. 31 3月, 2010 1 次提交
    • Y
      ipv6 fib: Use "Sweezle" to optimize addr_bit_test(). · 02cdce53
      YOSHIFUJI Hideaki / 吉藤英明 提交于
      addr_bit_test() is used in various places in IPv6 routing table
      subsystem.  It checks if the given fn_bit is set,
      where fn_bit counts bits from MSB in words in network-order.
      
       fn_bit        :   0 .... 31 32 .... 64 65 .... 95 96 ....127
      
      fn_bit >> 5 gives offset of word, and (~fn_bit & 0x1f) gives
      count from LSB in the network-endian word in question.
      
       fn_bit >> 5   :       0          1          2          3
       ~fn_bit & 0x1f:  31 ....  0 31 ....  0 31 ....  0 31 ....  0
      
      Thus, the mask was generated as htonl(1 << (~fn_bit & 0x1f)).
      This can be optimized by "sweezle" (See include/asm-generic/bitops/le.h).
      
      In little-endian,
        htonl(1 << bit) = 1 << (bit ^ BITOP_BE32_SWIZZLE)
      where
        BITOP_BE32_SWIZZLE is (0x1f & ~7)
      So,
        htonl(1 << (~fn_bit & 0x1f)) = 1 << ((~fn_bit & 0x1f) ^ (0x1f & ~7))
                                     = 1 << ((~fn_bit ^ ~7) & 0x1f)
                                     = 1 << ((~fn_bit ^ BITOP_BE32_SWIZZLE) & 0x1f)
      
      In big-endian, BITOP_BE32_SWIZZLE is equal to 0.
        1 << ((~fn_bit ^ BITOP_BE32_SWIZZLE) & 0x1f)
                                     = 1 << ((~fn_bit) & 0x1f)
                                     = htonl(1 << (~fn_bit & 0x1f))
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      02cdce53
  2. 26 3月, 2010 2 次提交
  3. 25 3月, 2010 1 次提交
  4. 21 3月, 2010 10 次提交
  5. 20 3月, 2010 2 次提交
  6. 19 3月, 2010 1 次提交
  7. 14 3月, 2010 1 次提交
  8. 09 3月, 2010 1 次提交
  9. 08 3月, 2010 1 次提交
  10. 06 3月, 2010 3 次提交
  11. 04 3月, 2010 4 次提交
  12. 03 3月, 2010 1 次提交
  13. 27 2月, 2010 1 次提交
  14. 26 2月, 2010 2 次提交
  15. 25 2月, 2010 5 次提交
  16. 23 2月, 2010 1 次提交
  17. 20 2月, 2010 2 次提交
    • E
      net: Fix sysctl restarts... · 88af182e
      Eric W. Biederman 提交于
      Yuck.  It turns out that when we restart sysctls we were restarting
      with the values already changed.  Which unfortunately meant that
      the second time through we thought there was no change and skipped
      all kinds of work, despite the fact that there was indeed a change.
      
      I have fixed this the simplest way possible by restoring the changed
      values when we restart the sysctl write.
      
      One of my coworkers spotted this bug when after disabling forwarding
      on an interface pings were still forwarded.
      Signed-off-by: NEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88af182e
    • P
      netfilter: nf_conntrack_reasm: properly handle packets fragmented into a single fragment · 9e2dcf72
      Patrick McHardy 提交于
      When an ICMPV6_PKT_TOOBIG message is received with a MTU below 1280,
      all further packets include a fragment header.
      
      Unlike regular defragmentation, conntrack also needs to "reassemble"
      those fragments in order to obtain a packet without the fragment
      header for connection tracking. Currently nf_conntrack_reasm checks
      whether a fragment has either IP6_MF set or an offset != 0, which
      makes it ignore those fragments.
      
      Remove the invalid check and make reassembly handle fragment queues
      containing only a single fragment.
      Reported-and-tested-by: NUlrich Weber <uweber@astaro.com>
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      9e2dcf72
  18. 19 2月, 2010 1 次提交