1. 05 3月, 2011 7 次提交
  2. 12 2月, 2011 2 次提交
  3. 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
  4. 31 1月, 2011 3 次提交
    • S
      batman-adv: Update copyright years · 64afe353
      Sven Eckelmann 提交于
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      64afe353
    • S
      batman-adv: Calculate correct size for merged packets · ae361ce1
      Sven Eckelmann 提交于
      The routing algorithm must be able to decide if a fragment can be merged with
      the missing part and still be passed to a forwarding interface. The fragments
      can only differ by one byte in case that the original payload had an uneven
      length. In that situation the sender has to inform all possible receivers that
      the tail is one byte longer using the flag UNI_FRAG_LARGETAIL.
      
      The combination of UNI_FRAG_LARGETAIL and UNI_FRAG_HEAD flag makes it possible
      to calculate the correct length for even and uneven sized payloads.
      
      The original formula missed to add the unicast header at all and forgot to
      remove the fragment header of the second fragment. This made the results highly
      unreliable and only useful for machines with large differences between the
      configured MTUs.
      Reported-by: NRussell Senior <russell@personaltelco.net>
      Reported-by: NMarek Lindner <lindner_marek@yahoo.de>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      ae361ce1
    • S
      batman-adv: Create roughly equal sized fragments · 5c77d8bb
      Sven Eckelmann 提交于
      The routing algorithm must know how large two fragments are to be able to
      decide that it is safe to merge them or if it should resubmit without waiting
      for the second part. When these two fragments have a too different size, it is
      not possible to guess right in every situation.
      
      The user could easily configure the MTU of the attached cards so that one
      fragment is forwarded and the other one is added to the fragments table to wait
      for the missing part.
      
      For even sized packets, it is possible to split it so that the resulting
      packages are equal sized by ignoring the old non-fragment header at the
      beginning of the original packet.
      
      This still creates different sized fragments for uneven sized packets.
      Reported-by: NRussell Senior <russell@personaltelco.net>
      Reported-by: NMarek Lindner <lindner_marek@yahoo.de>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      5c77d8bb
  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. 17 12月, 2010 1 次提交
  7. 30 11月, 2010 11 次提交
  8. 10 11月, 2010 1 次提交
  9. 15 9月, 2010 1 次提交
  10. 05 9月, 2010 4 次提交
    • M
      Staging: batman-adv: multiple mesh clouds · 8c70f138
      Marek Lindner 提交于
      This patch removes all remaining global variables and includes the
      necessary bits into the bat_priv structure. It is the last
      remaining piece to allow multiple concurrent mesh clouds on the
      same device.
      A few global variables have been rendered obsolete during the process
      and have been removed entirely.
      Signed-off-by: NMarek Lindner <lindner_marek@yahoo.de>
      [sven.eckelmann@gmx.de: Rework on top of current version]
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8c70f138
    • S
      Staging: batman-adv: Keep header writable and unshared · 99eed284
      Sven Eckelmann 提交于
      my_skb_push provided an easy way to allocate enough headroom in
      situation were we don't have enough space left and move the data pointer
      to the new position, but we didn't checked wether we are allowed to
      write to the new pushed header. This is for example a problem when the
      skb was cloned and thus doesn't have a private data part.
      
      my_skb_head_push now replaces my_skb_push by using skb_cow_head to
      provide only a large enough, writable header without testing for the
      rest of the (maybe shared) data. It will also move the data pointer
      using skb_push when skb_cow_head doesn't fail.
      
      This should give us enough flexibility in situation were skbs will be
      queued by underlying layers and still doesn't unnecessarily copy the
      data in situations when the skb was consumed right away during
      dev_queue_xmit.
      Reported-by: NMarek Lindner <lindner_marek@yahoo.de>
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      99eed284
    • A
      Staging: batman-adv: layer2 unicast packet fragmentation · e63760e5
      Andreas Langer 提交于
      This patch implements a simple layer2 fragmentation to allow traffic
      exchange over network interfaces with a MTU smaller than 1500 bytes. The
      fragmentation splits the big packets into two parts and marks the frames
      accordingly. The receiving end buffers the packets to reassemble the
      orignal packet before passing it to the higher layers. This feature
      makes it necessary to modify the batman-adv encapsulation for unicast
      packets by adding a sequence number, flags and the originator address.
      This modifcation is part of a seperate packet type for fragemented
      packets to keep the original overhead as low as possible. This patch
      enables the feature by default to ensure the data traffic can travel
      through the network. But it also prints a warning to notify the user
      about the performance implications.
      
      Note: Fragmentation should be avoided at all costs since it has a
      dramatic impact on the performance, especially when it comes wifi
      networks. Instead of a single packet, 2 packets have to be sent! Not
      only valuable airtime is wasted but also packetloss decreases the
      throughput. A link with 50% packetloss and fragmentation enabled is
      pretty much unusable.
      Signed-off-by: NAndreas Langer <an.langer@gmx.de>
      [sven.eckelmann@gmx.de: Rework on top of current version]
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      e63760e5
    • M
      Staging: batman-adv: refactoring unicast payload code · 24c76fc0
      Marek Lindner 提交于
      Signed-off-by: NMarek Lindner <lindner_marek@yahoo.de>
      [sven.eckelmann@gmx.de: Rework on top of current version]
      Signed-off-by: NSven Eckelmann <sven.eckelmann@gmx.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      24c76fc0