1. 08 2月, 2011 1 次提交
  2. 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
  3. 26 1月, 2011 1 次提交
  4. 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
  5. 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
  6. 21 12月, 2010 2 次提交
  7. 20 12月, 2010 4 次提交
  8. 19 12月, 2010 2 次提交
  9. 18 12月, 2010 7 次提交
  10. 17 12月, 2010 18 次提交