09 Jan, 2014

2 commits


28 Dec, 2013

2 commits

  • struct batadv_icmp_header currently has a size of 17, which
    will be padded to 20 on some architectures. Fix this by
    unrolling the header into the parent structures.

    Moreover keep the ICMP parsing functions as generic as they
    are now by using a stub icmp_header struct during packet
    parsing.

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

    Antonio Quartulli
     
  • The size of the batadv_header of 3 is problematic on some architectures
    which automatically pad all structures to a 32 bit boundary. To not lose
    performance by packing this struct, better embed it into the various
    host structures.

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

    Simon Wunderlich
     

23 Oct, 2013

2 commits


19 Oct, 2013

3 commits

  • 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
     
  • Since batman-adv is now fully VLAN-aware, a proper framework
    able to handle per-vlan-interface attributes is needed.

    Those attributes will affect the associated VLAN interface
    only, rather than the real soft_iface (which would result
    in every vlan interface having the same attribute
    configuration).

    To make the code simpler and easier to extend, attributes
    associated to the standalone soft_iface are now treated
    like belonging to yet another vlan having a special vid.
    This vid is different from the others because it is made up
    by all zeros and the VLAN_HAS_TAG bit is not set.

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

    Antonio Quartulli
     
  • To make the translation table code VLAN-aware, each entry
    must carry the VLAN ID which it belongs to. This patch adds
    such attribute to the related TT structures.

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

    Antonio Quartulli
     

12 Oct, 2013

4 commits

  • The module prints a warning when the MTU on the hard interface is too
    small to transfer payload traffic without fragmentation. The required
    MTU is calculated based on the encapsulation header size. If network
    coding is compild into the module its header size is taken into
    account as well.

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

    Marek Lindner
     
  • the icmp and the icmp_rr packets share the same initial
    fields since they use the same code to be processed and
    forwarded.

    Extract the common fields and put them into a separate
    struct so that future ICMP packets can be easily added
    without bloating the packet definition.

    However, keep the seqno field outside of the newly created
    common header because future ICMP types may require a
    bigger sequence number space.

    This change breaks compatibility due to fields reordering
    in the ICMP headers.

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

    Antonio Quartulli
     
  • 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

7 commits

  • Reordering the packet type numbers allows us to handle unicast
    packets in a general way - even if we don't know the specific packet
    type, we can still forward it. There was already code handling
    this for a couple of unicast packets, and this is the more
    generalized version to do that.

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

    Simon Wunderlich
     
  • Since we removed the __packed from most of the packets, we should
    make sure that the offset generated by the compiler are correct for
    sent/received data.

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

    Simon Wunderlich
     
  • This is replaced by a userspace program, we don't need this
    functionality to bloat the kernel.

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

    Simon Wunderlich
     
  • Instead of generating roaming specific packets the TVLV unicast API is
    used to send roaming information.

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

    Marek Lindner
     
  • Instead of generating TT specific packets the TVLV unicast API is used
    to send translation table data.

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

    Marek Lindner
     
  • 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
     
  • The goal is to provide the infrastructure for sending, receiving and
    parsing information 'containers' while preserving backward
    compatibility. TVLV (based on the commonly known Type Length Value
    technique) was chosen as the format for those containers. Even if a
    node does not know the tvlv type of a certain container it can simply
    skip the current container and proceed with the next. Past experience
    has shown features evolve over time, so a 'version' field was added
    right from the start to allow differentiating between feature
    variants - hence the name: T(ype) V(ersion) L(ength) V(alue).

    This patch introduces the basic TVLV infrastructure:
    * register / unregister tvlv containers to be sent with each OGM
    (on primary interfaces only)
    * register / unregister callback handlers to be called upon
    finding the corresponding tvlv type in a tvlv buffer
    * unicast tvlv send / receive API calls

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

    Marek Lindner
     

02 Oct, 2013

1 commit

  • batman-adv saves its table of packet handlers as a global state, so handlers
    must be set up only once (and setting them up a second time will fail).

    The recently-added network coding support tries to set up its handler each time
    a new softif is registered, which obviously fails when more that one softif is
    used (and in consequence, the softif creation fails).

    Fix this by splitting up batadv_nc_init into batadv_nc_init (which is called
    only once) and batadv_nc_mesh_init (which is called for each softif); in
    addition batadv_nc_free is renamed to batadv_nc_mesh_free to keep naming
    consistent.

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

    Matthias Schiffer
     

28 Aug, 2013

1 commit

  • The skb priority field may help the wireless driver to choose the right
    queue (e.g. WMM queues). This should be set in batman-adv, as this
    information is only available here.

    This patch adds support for IPv4/IPv6 DS fields and VLAN PCP. Note that
    only VLAN PCP is used if a VLAN header is present. Also initially set
    TC_PRIO_CONTROL only for self-generated packets, and keep the priority
    set by higher layers.

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

    Simon Wunderlich
     

24 Jun, 2013

1 commit

  • Callers of skb_seq_read() are currently forced to call skb_abort_seq_read()
    even when consuming all the data because the last call to skb_seq_read (the
    one that returns 0 to indicate the end) fails to unmap the last fragment page.

    With this patch callers will be allowed to traverse the SKB data by calling
    skb_prepare_seq_read() once and repeatedly calling skb_seq_read() as originally
    intended (and documented in the original commit 677e90eda), that is, only call
    skb_abort_seq_read() if the sequential read is actually aborted.

    Signed-off-by: Wedson Almeida Filho
    Signed-off-by: David S. Miller

    Wedson Almeida Filho
     

22 May, 2013

1 commit

  • On errors in batadv_mesh_init(), bat_counters will be freed in both
    batadv_mesh_free() and batadv_softif_init_late(). This patch fixes this
    by returning earlier from batadv_softif_init_late() in case of errors in
    batadv_mesh_init() and by setting bat_counters to NULL after freeing.

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

    Martin Hundebøll
     

09 May, 2013

2 commits

  • nc_worker accesses the originator table during its periodic
    work, but since the originator table is freed before
    stopping the worker this leads to a global protection fault.

    Fix this by killing the worker (in nc_free) before freeing
    the originator table.

    Moreover tidy up the entire clean up routine by running all
    the subcomponents freeing procedures first and then killing
    the TT and the originator tables at the end.

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

    Antonio Quartulli
     
  • batadv_param_set_ra() strips the trailing '\n' from the supplied
    string buffer without checking the length of the buffer first. This
    patches avoids random memory access and associated potential
    crashes.

    Reported-by: Sasha Levin
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Marek Lindner
     

23 Apr, 2013

1 commit

  • Conflicts:
    drivers/net/ethernet/emulex/benet/be_main.c
    drivers/net/ethernet/intel/igb/igb_main.c
    drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
    include/net/scm.h
    net/batman-adv/routing.c
    net/ipv4/tcp_input.c

    The e{uid,gid} --> {uid,gid} credentials fix conflicted with the
    cleanup in net-next to now pass cred structs around.

    The be2net driver had a bug fix in 'net' that overlapped with the VLAN
    interface changes by Patrick McHardy in net-next.

    An IGB conflict existed because in 'net' the build_skb() support was
    reverted, and in 'net-next' there was a comment style fix within that
    code.

    Several batman-adv conflicts were resolved by making sure that all
    calls to batadv_is_my_mac() are changed to have a new bat_priv first
    argument.

    Eric Dumazet's TS ECR fix in TCP in 'net' conflicted with the F-RTO
    rewrite in 'net-next', mostly overlapping changes.

    Thanks to Stephen Rothwell and Antonio Quartulli for help with several
    of these merge resolutions.

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Apr, 2013

1 commit


27 Mar, 2013

2 commits


14 Mar, 2013

1 commit

  • Network coding exploits the 802.11 shared medium to allow multiple
    packets to be sent in a single transmission. In brief, a relay can XOR
    two packets, and send the coded packet to two destinations. The
    receivers can decode one of the original packets by XOR'ing the coded
    packet with the other original packet. This will lead to increased
    throughput in topologies where two packets cross one relay.

    In a simple topology with three nodes, it takes four transmissions
    without network coding to get one packet from Node A to Node B and one
    from Node B to Node A:

    1. Node A ---- p1 ---> Node R Node B
    2. Node A Node R Node B

    With network coding, the relay only needs one transmission, which saves
    us one slot of valuable airtime:

    1. Node A ---- p1 ---> Node R Node B
    2. Node A Node R Node B

    The same principle holds for a topology including five nodes. Here the
    packets from Node A and Node B are overheard by Node C and Node D,
    respectively. This allows Node R to send a network coded packet to save
    one transmission:

    Node A Node B

    | \ / |
    | p1 p2 |
    | \ / |
    p1 > Node R < p2
    | |
    | / \ |
    | p1 x p2 p1 x p2 |
    v / \ v
    / \
    Node C < > Node D

    More information is available on the open-mesh.org wiki[1].

    This patch adds the initial code to support network coding in
    batman-adv. It sets up a worker thread to do house keeping and adds a
    sysfs file to enable/disable network coding. The feature is disabled by
    default, as it requires a wifi-driver with working promiscuous mode, and
    also because it adds a small delay at each hop.

    [1] http://www.open-mesh.org/projects/batman-adv/wiki/Catwoman

    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

1 commit


21 Nov, 2012

1 commit


08 Nov, 2012

2 commits

  • Since batman-adv cannot inter-operate with the host ARP table, this patch
    introduces a batman-adv private storage for ARP entries exchanged within DAT.
    This storage will represent the node local cache in the DAT protocol.

    Signed-off-by: Antonio Quartulli

    Antonio Quartulli
     
  • The current unicast packet type does not contain the orig source address. This
    patches add a new unicast packet (called UNICAST_4ADDR) which provides two new
    fields: the originator source address and the subtype (the type of the data
    contained in the packet payload). The former is useful to identify the node
    which injected the packet into the network and the latter is useful to avoid
    creating new unicast packet types in the future: a macro defining a new subtype
    will be enough.

    Signed-off-by: Antonio Quartulli

    Antonio Quartulli
     

29 Oct, 2012

2 commits


23 Aug, 2012

2 commits

  • The structure batadv_priv grows everytime a new feature is introduced. It gets
    hard to find the parts of the struct that belongs to a specific feature. This
    becomes even harder by the fact that not every feature uses a prefix in the
    member name.

    The variables for bridge loop avoidence, gateway handling, translation table
    and visualization server are moved into separate structs that are included in
    the bat_priv main struct.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Antonio Quartulli

    Sven Eckelmann
     
  • As much as I'm happy to see LWN links sprinkled through the kernel by the
    dozen, this one in particular reflects a very old state of reality; the
    associated comment is now incorrect. So just delete it.

    Signed-off-by: Jonathan Corbet
    Signed-off-by: Antonio Quartulli

    Jonathan Corbet