1. 30 Jan, 2011 3 commits
    • Sven Eckelmann's avatar
      batman-adv: Make vis info stack traversal threadsafe · 1181e1da
      Sven Eckelmann authored
      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: default avatarRussell Senior <russell@personaltelco.net>
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      1181e1da
    • Sven Eckelmann's avatar
      batman-adv: Remove vis info element in free_info · dda9fc6b
      Sven Eckelmann authored
      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: default avatarSven Eckelmann <sven@narfation.org>
      dda9fc6b
    • Sven Eckelmann's avatar
      batman-adv: Remove vis info on hashing errors · 2674c158
      Sven Eckelmann authored
      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: default avatarSven Eckelmann <sven@narfation.org>
      2674c158
  2. 25 Jan, 2011 1 commit
  3. 16 Jan, 2011 1 commit
    • Sven Eckelmann's avatar
      batman-adv: Use "__attribute__" shortcut macros · aa0adb1a
      Sven Eckelmann authored
      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: default avatarSven Eckelmann <sven@narfation.org>
      aa0adb1a
  4. 13 Jan, 2011 1 commit
    • Jesper Juhl's avatar
      batman-adv: Even Batman should not dereference NULL pointers · ed7809d9
      Jesper Juhl authored
      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: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      ed7809d9
  5. 20 Dec, 2010 6 commits
  6. 19 Dec, 2010 2 commits
  7. 17 Dec, 2010 8 commits
  8. 16 Dec, 2010 18 commits