16 May, 2014

1 commit

  • If hard_iface is NULL and goto out is made batadv_hardif_free_ref()
    doesn't check for NULL before dereferencing it to get to refcount.

    Introduced in cb1c92ec37fb70543d133a1fa7d9b54d6f8a1ecd
    ("batman-adv: add debugfs support to view multiif tables").

    Reported-by: Sven Eckelmann
    Signed-off-by: Marek Lindner
    Acked-by: Antonio Quartulli
    Signed-off-by: Antonio Quartulli

    Marek Lindner
     

11 May, 2014

1 commit

  • When an interface is removed separately, all neighbors need to be
    checked if they have a neigh_ifinfo structure for that particular
    interface. If that is the case, remove that ifinfo so any references to
    a hard interface can be freed.

    This is a regression introduced by
    89652331c00f43574515059ecbf262d26d885717
    ("batman-adv: split tq information in neigh_node struct")

    Reported-by: Antonio Quartulli
    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     

10 May, 2014

2 commits

  • The current code will not execute batadv_purge_orig_neighbors() when an
    orig_ifinfo has already been purged. However we need to run it in any
    case. Fix that.

    This is a regression introduced by
    7351a4822d42827ba0110677c0cbad88a3d52585
    ("batman-adv: split out router from orig_node")

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • When an interface is removed from batman-adv, the orig_ifinfo of a
    orig_node may be removed without releasing the router first.
    This will prevent the reference for the neighbor pointed at by the
    orig_ifinfo->router to be released, and this leak may result in
    reference leaks for the interface used by this neighbor. Fix that.

    This is a regression introduced by
    7351a4822d42827ba0110677c0cbad88a3d52585
    ("batman-adv: split out router from orig_node").

    Reported-by: Antonio Quartulli
    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     

22 Mar, 2014

3 commits


18 Feb, 2014

1 commit


12 Jan, 2014

6 commits

  • Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • Show tables for the multi interface operation. Originator tables
    are added per hard interface.

    This patch also changes the API by adding the interface to the
    bat_orig_print() parameters.

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • With the new interface alternating, the first hop may send packets
    in a round robin fashion to it's neighbors because it has multiple
    valid routes built by the multi interface optimization. This patch
    enables the feature if bonding is selected. Note that unlike the
    bonding implemented before, this version is much simpler and may
    even enable multi path routing to a certain degree.

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • For the network wide multi interface optimization there are different
    routers for each outgoing interface (outgoing from the OGM perspective,
    incoming for payload traffic). To reflect this, change the router and
    associated data to a list of routers.

    While at it, rename batadv_orig_node_get_router() to
    batadv_orig_router_get() to follow the new naming scheme.

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • For the network wide multi interface optimization it is required to save
    metrics per outgoing interface in one neighbor. Therefore a new type is
    introduced to keep interface-specific information. This also requires
    some changes in access and list management.

    The compare and equiv_or_better API calls are changed to take the
    outgoing interface into consideration.

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • Remove bonding and interface alternating code - it will be replaced
    by a new, network-wide multi interface optimization which enables
    both bonding and interface alternating in a better way.

    Keep the sysfs and find router function though, this will be needed
    later.

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     

09 Jan, 2014

1 commit


27 Dec, 2013

1 commit

  • It is better to use batadv_compate_eth instead of memcpy for
    concise style.

    Cc: Marek Lindner
    Cc: Simon Wunderlich
    Cc: Antonio Quartulli
    Cc: "David S. Miller"
    Cc: b.a.t.m.a.n@lists.open-mesh.org
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: Tan Xiaojun
    Signed-off-by: Ding Tianhong
    Acked-by: Antonio Quartulli
    Signed-off-by: David S. Miller

    dingtianhong
     

23 Oct, 2013

5 commits


20 Oct, 2013

2 commits

  • Instead of unconditionally removing all the TT entries
    served by a given originator, make tt_global_orig_del()
    remove only entries matching a given VLAN identifier
    provided as argument.

    If such argument is negative all the global entries
    served by the originator are removed.

    This change is used into the BLA code to purge entries
    served by a newly discovered Backbone node, but limiting
    the operation only to those connected to the VLAN where the
    backbone has been discovered.

    Cc: Simon Wunderlich
    Signed-off-by: Antonio Quartulli
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     
  • This change allows nodes to handle the TT table on a
    per-VLAN basis. This is needed because nodes may have to
    store only some of the global entries advertised by another
    node.

    In this scenario such nodes would re-create only a partial
    global table and would not be able to compute a correct CRC
    anymore.

    This patch splits the logic and introduces one CRC per VLAN.
    In this way a node fetching only some entries belonging to
    some VLANs is still able to compute the needed CRCs and
    still check the table correctness.

    With this patch the shape of the TVLV-TT is changed too
    because now a node needs to advertise all the CRCs of all
    the VLANs that it is wired to.

    The debug output of the local Translation Table now shows
    the CRC along with each entry since there is not a common
    value for the entire table anymore.

    Signed-off-by: Antonio Quartulli
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     

19 Oct, 2013

1 commit

  • A TT response may be prepared and sent while the local or
    global translation table is getting updated.

    The worst case is when one of the tables is accessed after
    its content has been recently updated but the metadata
    (TTVN/CRC) has not yet. In this case the reader will get a
    table content which does not match the TTVN/CRC.
    This will lead to an inconsistent state and so to a TT
    recovery.

    To avoid entering this situation, put a lock around those TT
    operations recomputing the metadata and around the TT
    Response creation (the latter is the only reader that
    accesses the metadata together with the table).

    Signed-off-by: Antonio Quartulli
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     

12 Oct, 2013

2 commits

  • Fragments arriving at their destination are buffered for later merge.
    Merged packets are passed to the main receive function as had they never
    been fragmented.

    Fragments are forwarded without merging if the MTU of the outgoing
    interface is smaller than the size of the merged packet.

    Signed-off-by: Martin Hundebøll
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Martin Hundebøll
     
  • Remove the existing fragmentation code before adding the new version
    and delete unicast.{h,c}.

    batadv_unicast_send_skb() is moved to send.c and renamed to
    batadv_send_skb_unicast().

    fragmentation entry in sysfs (bat_priv->fragmentation) is kept for use in
    the new fragmentation code.

    BATADV_UNICAST_FRAG packet type is renamed to BATADV_FRAG for use in the
    new fragmentation code.

    Signed-off-by: Martin Hundebøll
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Martin Hundebøll
     

10 Oct, 2013

1 commit

  • Prior to this patch batman-adv read the advertised uplink bandwidth
    from userspace and compressed this information into a single byte
    called "gateway class".
    Now the download & upload bandwidth information is sent as-is. No
    userspace change is necessary since the sysfs API always allowed
    to specify a bandwidth.

    Signed-off-by: Marek Lindner
    Signed-off-by: Spyros Gasteratos
    Signed-off-by: Antonio Quartulli

    Marek Lindner
     

29 May, 2013

2 commits


17 May, 2013

1 commit

  • rcu_barrier() only waits for the currently scheduled rcu functions
    to finish - it won't wait for any function scheduled via another
    call_rcu() within an rcu scheduled function.

    Unfortunately our batadv_tt_orig_list_entry_free_ref() does just that,
    via a batadv_orig_node_free_ref() call, leading to our rcu_barrier()
    call potentially missing such a batadv_orig_node_free_ref().

    This patch fixes this issue by calling the batadv_orig_node_free_rcu()
    directly from the rcu callback, removing the unnecessary, additional
    call_rcu() layer here.

    Signed-off-by: Linus Lüssing
    Signed-off-by: Marek Lindner
    Acked-by: Antonio Quartulli

    Linus Lüssing
     

27 Mar, 2013

1 commit


14 Mar, 2013

1 commit

  • To use network coding efficiently, a relay must know when neighbor nodes
    are likely to have enough information to be able to decode a network
    coded packet. This is detected by using OGMs from batman-adv to discover
    when one neighbor is in range of another neighbor. The relay check the
    TLL to detect when an OGM is forwarded from one neighbor by another
    neighbor, and thereby knows that the two neighbors are in range and thus
    overhear packets sent by each other.

    This information is saved in the orig_node struct to be used when
    searching for coding opportunities. Two lists are added to the
    orig_node struct: One for neighbors that can hear the orig_node
    (outgoing nc_nodes) and one for neighbors that the orig_node can hear
    (incoming nc_nodes).

    Information about nc_nodes is kept for 10 seconds and is available
    through debugfs in batman_adv/nc_nodes to use when debugging network
    coding.

    Signed-off-by: Martin Hundebøll
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Martin Hundebøll
     

28 Feb, 2013

1 commit

  • I'm not sure why, but the hlist for each entry iterators were conceived

    list_for_each_entry(pos, head, member)

    The hlist ones were greedy and wanted an extra parameter:

    hlist_for_each_entry(tpos, pos, head, member)

    Why did they need an extra pos parameter? I'm not quite sure. Not only
    they don't really need it, it also prevents the iterator from looking
    exactly like the list iterator, which is unfortunate.

    Besides the semantic patch, there was some manual work required:

    - Fix up the actual hlist iterators in linux/list.h
    - Fix up the declaration of other iterators based on the hlist ones.
    - A very small amount of places were using the 'node' parameter, this
    was modified to use 'obj->member' instead.
    - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
    properly, so those had to be fixed up manually.

    The semantic patch which is mostly the work of Peter Senna Tschudin is here:

    @@
    iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;

    type T;
    expression a,c,d,e;
    identifier b;
    statement S;
    @@

    -T b;

    [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
    [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
    [akpm@linux-foundation.org: checkpatch fixes]
    [akpm@linux-foundation.org: fix warnings]
    [akpm@linux-foudnation.org: redo intrusive kvm changes]
    Tested-by: Peter Senna Tschudin
    Acked-by: Paul E. McKenney
    Signed-off-by: Sasha Levin
    Cc: Wu Fengguang
    Cc: Marcelo Tosatti
    Cc: Gleb Natapov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sasha Levin
     

19 Jan, 2013

2 commits


12 Jan, 2013

2 commits


15 Nov, 2012

1 commit

  • tt_poss_change is a node-wide flag which tells whether the node is in a roaming
    state (a client recently moved to/away from it) in order to let it apply special
    re-routing rules. However this flag does not give a clear idea of the current
    state because it is not possible to understand *which client* is actually
    involved in the roaming. For this reason a better approach has been chosen:
    instead of using a node-wide variable, the roaming state is now given by a
    per-tt_entry ROAM flag which, in case of packet coming through the node, tells
    the node whether the real destination is in roaming state or not.

    With this flag change, batadv_check_unicast_ttvn() has also been rearranged in
    order to better fit the new re-routing logic and to be much more readable.

    Signed-off-by: Antonio Quartulli

    Antonio Quartulli
     

08 Nov, 2012

1 commit


29 Oct, 2012

1 commit