1. 12 2月, 2011 3 次提交
  2. 11 2月, 2011 1 次提交
    • S
      batman-adv: Use successive sequence numbers for fragments · c2f7f0e7
      Sven Eckelmann 提交于
      The two fragments of an unicast packet must have successive sequence numbers to
      allow the receiver side to detect matching fragments and merge them again. The
      current implementation doesn't provide that property because a sequence of two
      atomic_inc_return may be interleaved with another sequence which also changes
      the variable.
      
      The access to the fragment sequence number pool has either to be protected by
      correct locking or it has to reserve two sequence numbers in a single fetch.
      The latter one can easily be done by increasing the value of the last used
      sequence number by 2 in a single step. The generated window of two currently
      unused sequence numbers can now be scattered across the two fragments.
      Reported-by: NLinus Lüssing <linus.luessing@web.de>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      c2f7f0e7
  3. 08 2月, 2011 1 次提交
  4. 31 1月, 2011 8 次提交
  5. 30 1月, 2011 3 次提交
    • S
      batman-adv: Make vis info stack traversal threadsafe · 1181e1da
      Sven Eckelmann 提交于
      The batman-adv vis server has to a stack which stores all information
      about packets which should be send later. This stack is protected
      with a spinlock that is used to prevent concurrent write access to it.
      
      The send_vis_packets function has to take all elements from the stack
      and send them to other hosts over the primary interface. The send will
      be initiated without the lock which protects the stack.
      
      The implementation using list_for_each_entry_safe has the problem that
      it stores the next element as "safe ptr" to allow the deletion of the
      current element in the list. The list may be modified during the
      unlock/lock pair in the loop body which may make the safe pointer
      not pointing to correct next element.
      
      It is safer to remove and use the first element from the stack until no
      elements are available. This does not need reduntant information which
      would have to be validated each time the lock was removed.
      Reported-by: NRussell Senior <russell@personaltelco.net>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      1181e1da
    • S
      batman-adv: Remove vis info element in free_info · dda9fc6b
      Sven Eckelmann 提交于
      The free_info function will be called when no reference to the info
      object exists anymore. It must be ensured that the allocated memory
      gets freed and not only the elements which are managed by the info
      object.
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      dda9fc6b
    • S
      batman-adv: Remove vis info on hashing errors · 2674c158
      Sven Eckelmann 提交于
      A newly created vis info object must be removed when it couldn't be
      added to the hash. The old_info which has to be replaced was already
      removed and isn't related to the hash anymore.
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      2674c158
  6. 26 1月, 2011 1 次提交
  7. 16 1月, 2011 1 次提交
    • S
      batman-adv: Use "__attribute__" shortcut macros · aa0adb1a
      Sven Eckelmann 提交于
      Linux 2.6.21 defines different macros for __attribute__ which are also
      used inside batman-adv. The next version of checkpatch.pl warns about
      the usage of __attribute__((packed))).
      
      Linux 2.6.33 defines an extra macro __always_unused which is used to
      assist source code analyzers and can be used to removed the last
      existing __attribute__ inside the source code.
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      aa0adb1a
  8. 14 1月, 2011 1 次提交
    • J
      batman-adv: Even Batman should not dereference NULL pointers · ed7809d9
      Jesper Juhl 提交于
      There's a problem in net/batman-adv/unicast.c::frag_send_skb().
      dev_alloc_skb() allocates memory and may fail, thus returning NULL. If
      this happens we'll pass a NULL pointer on to skb_split() which in turn
      hands it to skb_split_inside_header() from where it gets passed to
      skb_put() that lets skb_tail_pointer() play with it and that function
      dereferences it. And thus the bat dies.
      
      While I was at it I also moved the call to dev_alloc_skb() above the
      assignment to 'unicast_packet' since there's no reason to do that
      assignment if the memory allocation fails.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      ed7809d9
  9. 21 12月, 2010 1 次提交
  10. 17 12月, 2010 1 次提交