1. 09 1月, 2015 17 次提交
  2. 07 1月, 2015 16 次提交
  3. 06 1月, 2015 7 次提交
    • L
      batman-adv: fix potential TT client + orig-node memory leak · 9d31b3ce
      Linus Lüssing 提交于
      This patch fixes a potential memory leak which can occur once an
      originator times out. On timeout the according global translation table
      entry might not get purged correctly. Furthermore, the non purged TT
      entry will cause its orig-node to leak, too. Which additionally can lead
      to the new multicast optimization feature not kicking in because of a
      therefore bogus counter.
      
      In detail: The batadv_tt_global_entry->orig_list holds the reference to
      the orig-node. Usually this reference is released after
      BATADV_PURGE_TIMEOUT through: _batadv_purge_orig()->
      batadv_purge_orig_node()->batadv_update_route()->_batadv_update_route()->
      batadv_tt_global_del_orig() which purges this global tt entry and
      releases the reference to the orig-node.
      
      However, if between two batadv_purge_orig_node() calls the orig-node
      timeout grew to 2*BATADV_PURGE_TIMEOUT then this call path isn't
      reached. Instead the according orig-node is removed from the
      originator hash in _batadv_purge_orig(), the batadv_update_route()
      part is skipped and won't be reached anymore.
      
      Fixing the issue by moving batadv_tt_global_del_orig() out of the rcu
      callback.
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Acked-by: NAntonio Quartulli <antonio@meshcoding.com>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      9d31b3ce
    • L
      batman-adv: fix multicast counter when purging originators · a5164886
      Linus Lüssing 提交于
      When purging an orig_node we should only decrease counter tracking the
      number of nodes without multicast optimizations support if it was
      increased through this orig_node before.
      
      A not yet quite initialized orig_node (meaning it did not have its turn
      in the mcast-tvlv handler so far) which gets purged would not adhere to
      this and will lead to a counter imbalance.
      
      Fixing this by adding a check whether the orig_node is mcast-initalized
      before decreasing the counter in the mcast-orig_node-purging routine.
      
      Introduced by 60432d75
      ("batman-adv: Announce new capability via multicast TVLV")
      Reported-by: NTobias Hachmer <tobias@hachmer.de>
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      a5164886
    • L
      batman-adv: fix counter for multicast supporting nodes · e8829f00
      Linus Lüssing 提交于
      A miscounting of nodes having multicast optimizations enabled can lead
      to multicast packet loss in the following scenario:
      
      If the first OGM a node receives from another one has no multicast
      optimizations support (no multicast tvlv) then we are missing to
      increase the counter. This potentially leads to the wrong assumption
      that we could safely use multicast optimizations.
      
      Fixings this by increasing the counter if the initial OGM has the
      multicast TVLV unset, too.
      
      Introduced by 60432d75
      ("batman-adv: Announce new capability via multicast TVLV")
      Reported-by: NTobias Hachmer <tobias@hachmer.de>
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      e8829f00
    • M
      batman-adv: fix lock class for decoding hash in network-coding.c · f44d5407
      Martin Hundebøll 提交于
      batadv_has_set_lock_class() is called with the wrong hash table as first
      argument (probably due to a copy-paste error), which leads to false
      positives when running with lockdep.
      
      Introduced-by: 612d2b4f
      ("batman-adv: network coding - save overheard and tx packets for decoding")
      Signed-off-by: NMartin Hundebøll <martin@hundeboll.net>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      f44d5407
    • L
      batman-adv: fix delayed foreign originator recognition · 2c667a33
      Linus Lüssing 提交于
      Currently it can happen that the reception of an OGM from a new
      originator is not being accepted. More precisely it can happen that
      an originator struct gets allocated and initialized
      (batadv_orig_node_new()), even the TQ gets calculated and set correctly
      (batadv_iv_ogm_calc_tq()) but still the periodic orig_node purging
      thread will decide to delete it if it has a chance to jump between
      these two function calls.
      
      This is because batadv_orig_node_new() initializes the last_seen value
      to zero and its caller (batadv_iv_ogm_orig_get()) makes it visible to
      other threads by adding it to the hash table already.
      batadv_iv_ogm_calc_tq() will set the last_seen variable to the correct,
      current time a few lines later but if the purging thread jumps in between
      that it will think that the orig_node timed out and will wrongly
      schedule it for deletion already.
      
      If the purging interval is the same as the originator interval (which is
      the default: 1 second), then this game can continue for several rounds
      until the random OGM jitter added enough difference between these
      two (in tests, two to about four rounds seemed common).
      
      Fixing this by initializing the last_seen variable of an orig_node
      to the current time before adding it to the hash table.
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      2c667a33
    • S
      batman-adv: fix and simplify condition when bonding should be used · 329887ad
      Simon Wunderlich 提交于
      The current condition actually does NOT consider bonding when the
      interface the packet came in from is the soft interface, which is the
      opposite of what it should do (and the comment describes). Fix that and
      slightly simplify the condition.
      Reported-by: NRay Gibson <booray@gmail.com>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      329887ad
    • D
      Merge branch 'rt_cong_ctrl' · a918eb9f
      David S. Miller 提交于
      Daniel Borkmann says:
      
      ====================
      net: allow setting congctl via routing table
      
      This is the second part of our work and allows for setting the congestion
      control algorithm via routing table. For details, please see individual
      patches.
      
      Since patch 1 is a bug fix, we suggest applying patch 1 to net, and then
      merging net into net-next, for example, and following up with the remaining
      feature patches wrt dependencies.
      
      Joint work with Florian Westphal, suggested by Hannes Frederic Sowa.
      
      Patch for iproute2 is available under [1], but will be reposted with along
      with the man-page update when this set hits net-next.
      
        [1] http://patchwork.ozlabs.org/patch/418149/
      
      Thanks!
      
      v2 -> v3:
       - Added module auto-loading as suggested by David Miller, thanks!
        - Added patch 2 for handling possible sleeps in fib6
        - While working on this, we discovered a bug, hence fix in patch 1
        - Added auto-loading to patch 4
       - Rebased, retested, rest the same.
      v1 -> v2:
       - Very sorry, I noticed I had decnet disabled during testing.
         Added missing header include in decnet, rest as is.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a918eb9f