1. 09 11月, 2016 3 次提交
  2. 30 10月, 2016 1 次提交
    • L
      batman-adv: Simple (re)broadcast avoidance · 3111beed
      Linus Lüssing 提交于
      With this patch, (re)broadcasting on a specific interfaces is avoided:
      
      * No neighbor: There is no need to broadcast on an interface if there
        is no node behind it.
      
      * Single neighbor is source: If there is just one neighbor on an
        interface and if this neighbor is the one we actually got this
        broadcast packet from, then we do not need to echo it back.
      
      * Single neighbor is originator: If there is just one neighbor on
        an interface and if this neighbor is the originator of this
        broadcast packet, then we do not need to echo it back.
      
      Goodies for BATMAN V:
      
      ("Upgrade your BATMAN IV network to V now to get these for free!")
      
      Thanks to the split of OGMv1 into two packet types, OGMv2 and ELP
      that is, we can now apply the same optimizations stated above to OGMv2
      packets, too.
      
      Furthermore, with BATMAN V, rebroadcasts can be reduced in certain
      multi interface cases, too, where BATMAN IV cannot. This is thanks to
      the removal of the "secondary interface originator" concept in BATMAN V.
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      3111beed
  3. 10 5月, 2016 1 次提交
  4. 23 2月, 2016 1 次提交
  5. 10 2月, 2016 2 次提交
  6. 02 2月, 2016 1 次提交
  7. 16 1月, 2016 1 次提交
    • S
      batman-adv: Drop immediate batadv_hard_iface free function · b4d922cf
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_hardif_free_ref.
      
      Fixes: 89652331 ("batman-adv: split tq information in neigh_node struct")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      b4d922cf
  8. 07 6月, 2015 1 次提交
    • S
      batman-adv: Add required includes to all files · 1e2c2a4f
      Sven Eckelmann 提交于
      The header files could not be build indepdent from each other. This is
      happened because headers didn't include the files for things they've used.
      This was problematic because the success of a build depended on the
      knowledge about the right order of local includes.
      
      Also source files were not including everything they've used explicitly.
      Instead they required that transitive includes are always stable. This is
      problematic because some transitive includes are not obvious, depend on
      config settings and may not be stable in the future.
      
      The order for include blocks are:
      
       * primary headers (main.h and the *.h file of a *.c file)
       * global linux headers
       * required local headers
       * extra forward declarations for pointers in function/struct declarations
      
      The only exceptions are linux/bitops.h and linux/if_ether.h in packet.h.
      This header file is shared with userspace applications like batctl and must
      therefore build together with userspace applications. The header
      linux/bitops.h is not part of the uapi headers and linux/if_ether.h
      conflicts with the musl implementation of netinet/if_ether.h. The
      maintainers rejected the use of __KERNEL__ preprocessor checks and thus
      these two headers are only in main.h. All files using packet.h first have
      to include main.h to work correctly.
      Reported-by: NMarkus Pargmann <mpa@pengutronix.de>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      1e2c2a4f
  9. 29 5月, 2015 1 次提交
  10. 12 1月, 2014 3 次提交
  11. 09 1月, 2014 1 次提交
  12. 23 10月, 2013 1 次提交
  13. 27 3月, 2013 1 次提交
  14. 19 1月, 2013 1 次提交
  15. 02 7月, 2012 2 次提交
  16. 25 6月, 2012 1 次提交
  17. 21 6月, 2012 2 次提交
  18. 17 2月, 2012 1 次提交
  19. 22 8月, 2011 1 次提交
  20. 10 6月, 2011 1 次提交
    • S
      batman-adv: Use enums for related constants · e8958dbf
      Sven Eckelmann 提交于
      CodingStyle "Chapter 12: Macros, Enums and RTL" recommends to use enums
      for several related constants. Internal states can be used without
      defining the actual value, but all values which are visible to the
      outside must be defined as before. Normal values are assigned as usual
      and flags are defined by shifts of a bit.
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      e8958dbf
  21. 30 5月, 2011 1 次提交
  22. 02 5月, 2011 1 次提交
  23. 05 3月, 2011 2 次提交
  24. 31 1月, 2011 2 次提交
  25. 17 12月, 2010 1 次提交
  26. 30 11月, 2010 2 次提交
  27. 21 9月, 2010 1 次提交
    • S
      Staging: batman-adv: Use refcnt to track usage count of batman_if · 47f621dd
      Sven Eckelmann 提交于
      get_batman_if_by_netdev and get_active_batman_if may leak data from the
      rcu protected list of interfaces. The rcu protected list of all gateway
      nodes leaks the actual data outside the read-side critical area. This is
      not valid as we may free the data using a call_rcu created callback
      after we unlock using rcu_read_unlock. A workaround is to provide a
      reference count to be sure that the memory isn't freed to early.
      
      It is currently only to implement the already existing functionality and
      doesn't provide the full tracking of all usage cases.
      
      Additionally, we must hardif_hold inside the
      rcu_read_lock()..rcu_read_unlock() before we attach to the structure
      which "leaks" it. When another function now removed it from its usage
      context (primary_if, usage on stack, ...) then we must hardif_put it. If
      it is decremented to zero then we can issue the call_rcu to the freeing
      function. So "put" is not allowed inside an rcu_read_lock.
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      47f621dd
  28. 05 9月, 2010 1 次提交
  29. 09 7月, 2010 1 次提交
  30. 12 5月, 2010 1 次提交
    • M
      Staging: batman-adv: move /proc interface handling to /sys · 208e13e4
      Marek Lindner 提交于
      Instead of having a single /proc file "interfaces" in which you have
      to echo the wanted interface batman-adv will create a subfolder in each
      suitable /sys/class/net folder. This subfolder contains files for the
      interface specific settings. For example, mesh_iface to add/remove an
      interface from a virtual mesh network (at the moment only bat0 is
      supported).
      
      Example:
      echo bat0 > /sys/class/net/eth0/batman-adv/mesh_iface
      
      to deactivate:
      echo none > /sys/class/net/eth0/batman-adv/mesh_iface
      
      Interfaces which are not compatible with batman-adv won't contain the
      batman-adv folder, therefore can't be activated. Not supported are:
      loopback, non-ethernet, non-ARP and virtual mesh network interfaces
      Signed-off-by: NMarek Lindner <lindner_marek@yahoo.de>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      208e13e4