12 Jun, 2014

1 commit

  • There are several instances where a pskb_copy or __pskb_copy is
    immediately followed by an skb_clone.

    Add a couple of new functions to allow the copy skb to be allocated
    from the fclone cache and thus speed up subsequent skb_clone calls.

    Cc: Alexander Smirnov
    Cc: Dmitry Eremin-Solenikov
    Cc: Marek Lindner
    Cc: Simon Wunderlich
    Cc: Antonio Quartulli
    Cc: Marcel Holtmann
    Cc: Gustavo Padovan
    Cc: Johan Hedberg
    Cc: Arvid Brodin
    Cc: Patrick McHardy
    Cc: Pablo Neira Ayuso
    Cc: Jozsef Kadlecsik
    Cc: Lauro Ramos Venancio
    Cc: Aloisio Almeida Jr
    Cc: Samuel Ortiz
    Cc: Jon Maloy
    Cc: Allan Stephens
    Cc: Andrew Hendry
    Cc: Eric Dumazet
    Reviewed-by: Christoph Paasch
    Signed-off-by: Octavian Purdila
    Signed-off-by: David S. Miller

    Octavian Purdila
     

04 Jun, 2014

1 commit


31 May, 2014

1 commit

  • Was introduced with 4c8755d69cbde2ec464a39c932aed0a83f9ff89f
    ("batman-adv: Send multicast packets to nodes with a WANT_ALL flag")

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

    Marek Lindner
     

24 May, 2014

1 commit

  • Conflicts:
    drivers/net/bonding/bond_alb.c
    drivers/net/ethernet/altera/altera_msgdma.c
    drivers/net/ethernet/altera/altera_sgdma.c
    net/ipv6/xfrm6_output.c

    Several cases of overlapping changes.

    The xfrm6_output.c has a bug fix which overlaps the renaming
    of skb->local_df to skb->ignore_df.

    In the Altera TSE driver cases, the register access cleanups
    in net-next overlapped with bug fixes done in net.

    Similarly a bug fix to send ALB packets in the bonding driver using
    the right source address overlaps with cleanups in net-next.

    Signed-off-by: David S. Miller

    David S. Miller
     

23 May, 2014

1 commit

  • batman tries to search dev->iflink to check if it's a batman interface,
    but ->iflink could be 0, which is not a valid ifindex. It should just
    avoid iflink == 0 case.

    Reported-by: Jet Chen
    Tested-by: Jet Chen
    Cc: David S. Miller
    Cc: Steffen Klassert
    Cc: Antonio Quartulli
    Cc: Marek Lindner
    Signed-off-by: Cong Wang
    Signed-off-by: Cong Wang
    Signed-off-by: David S. Miller

    Cong Wang
     

18 May, 2014

3 commits


16 May, 2014

4 commits

  • Change introduced by 88e48d7b3340ef07b108eb8a8b3813dd093cc7f7
    ("batman-adv: make DAT drop ARP requests targeting local clients")
    implements a check that prevents DAT from using the caching
    mechanism when the client that is supposed to provide a reply
    to an arp request is local.

    However change brought by be1db4f6615b5e6156c807ea8985171c215c2d57
    ("batman-adv: make the Distributed ARP Table vlan aware")
    has not converted the above check into its vlan aware version
    thus making it useless when the local client is behind a vlan.

    Fix the behaviour by properly specifying the vlan when
    checking for a client being local or not.

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

    Antonio Quartulli
     
  • A pointer to the orig_node representing a bat-gateway is
    stored in the gw_node->orig_node member, but the refcount
    for such orig_node is never increased.
    This leads to memory faults when gw_node->orig_node is accessed
    and the originator has already been freed.

    Fix this by increasing the refcount on gw_node creation
    and decreasing it on gw_node free.

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

    Antonio Quartulli
     
  • In the new fragmentation code the batadv_frag_send_packet()
    function obtains a reference to the primary_if, but it does
    not release it upon return.

    This reference imbalance prevents the primary_if (and then
    the related netdevice) to be properly released on shut down.

    Fix this by releasing the primary_if in batadv_frag_send_packet().

    Introduced by ee75ed88879af88558818a5c6609d85f60ff0df4
    ("batman-adv: Fragment and send skbs larger than mtu")

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

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

14 May, 2014

1 commit

  • net: get rid of SET_ETHTOOL_OPS

    Dave Miller mentioned he'd like to see SET_ETHTOOL_OPS gone.
    This does that.

    Mostly done via coccinelle script:
    @@
    struct ethtool_ops *ops;
    struct net_device *dev;
    @@
    - SET_ETHTOOL_OPS(dev, ops);
    + dev->ethtool_ops = ops;

    Compile tested only, but I'd seriously wonder if this broke anything.

    Suggested-by: Dave Miller
    Signed-off-by: Wilfried Klaebe
    Acked-by: Felipe Balbi
    Signed-off-by: David S. Miller

    Wilfried Klaebe
     

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

3 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
     
  • The neigh_ifinfo object must be freed if it has been used in
    batadv_iv_ogm_process_per_outif().

    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
     

22 Mar, 2014

16 commits

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

    Simon Wunderlich
     
  • Add missing documentation for BATADV_DAT_ADDR_MAX and
    convert an existing documentation to kerneldoc

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

    Antonio Quartulli
     
  • Convert the current documentation for the TT flags in proper
    kerneldoc and improve it by adding an explanation for each
    of the flags.

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

    Antonio Quartulli
     
  • With this patch a node sends IPv4 multicast packets to nodes which
    have a BATADV_MCAST_WANT_ALL_IPV4 flag set and IPv6 multicast packets
    to nodes which have a BATADV_MCAST_WANT_ALL_IPV6 flag set, too.

    Why is this needed? There are scenarios involving bridges where
    multicast report snooping and multicast TT announcements are not
    sufficient, which would lead to packet loss for some nodes otherwise:

    MLDv1 and IGMPv1/IGMPv2 have a suppression mechanism
    for multicast listener reports. When we have an MLDv1/IGMPv1/IGMPv2
    querier behind a bridge then our snooping bridge is potentially not
    going to see any reports even though listeners exist because according
    to RFC4541 such reports are only forwarded to multicast routers:

    -----------------------------------------------------------
    ---------------
    {Querier}---|Snoop. Switch|----{Listener}
    ---------------
    \ ^
    -------
    | br0 | < ???
    -------
    \
    _-~---~_
    _-~/ ~-_
    ~ batman-adv \-----{Sender}
    \~_ cloud ~/
    -~~__-__-~_/

    I) MLDv1 Query: {Querier} -> flooded
    II) MLDv1 Report: {Listener} -> {Querier}

    -> br0 cannot detect the {Listener}
    => Packets from {Sender} need to be forwarded to all
    detected listeners and MLDv1/IGMPv1/IGMPv2 queriers.

    -----------------------------------------------------------

    Note that we do not need to explicitly forward to MLDv2/IGMPv3 queriers,
    because these protocols have no report suppression: A bridge has no
    trouble detecting MLDv2/IGMPv3 listeners.

    Even though we do not support bridges yet we need to provide the
    according infrastructure already to not break compatibility later.

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

    Linus Lüssing
     
  • With this patch a node may additionally perform the dropping or
    unicasting behaviour for a link-local IPv4 and link-local-all-nodes
    IPv6 multicast packet, too.

    The extra counter and BATADV_MCAST_WANT_ALL_UNSNOOPABLES flag is needed
    because with a future bridge snooping support integration a node with a
    bridge on top of its soft interface is not able to reliably detect its
    multicast listeners for IPv4 link-local and the IPv6
    link-local-all-nodes addresses anymore (see RFC4541, section 2.1.2.2
    and section 3).

    Even though this new flag does make "no difference" now, it'll ensure
    a seamless integration of multicast bridge support without needing to
    break compatibility later.

    Also note, that even with multicast bridge support it won't be possible
    to optimize 224.0.0.x and ff02::1 towards nodes with bridges, they will
    always receive these ranges.

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

    Linus Lüssing
     
  • With this patch a multicast packet is not always simply flooded anymore,
    the behaviour for the following cases is changed to reduce
    unnecessary overhead:

    If all nodes within the horizon of a certain node have signalized
    multicast listener announcement capability then an IPv6 multicast packet
    with a destination of IPv6 link-local scope (excluding ff02::1) coming
    from the upstream of this node...

    * ...is dropped if there is no according multicast listener in the
    translation table,
    * ...is forwarded via unicast if there is a single node with interested
    multicast listeners
    * ...and otherwise still gets flooded.

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

    Linus Lüssing
     
  • If the soft interface of a node is not part of a bridge then a node
    announces a new multicast TVLV: The existence of this TVLV
    signalizes that this node is announcing all of its multicast listeners
    via the translation table infrastructure.

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

    Linus Lüssing
     
  • The new bitfield allows us to keep track whether capability subsets of
    an originator have gone through their initialization phase yet.

    The translation table is the only user right now, but a new one will be
    added soon.

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

    Linus Lüssing
     
  • With this patch a node which has no bridge interface on top of its soft
    interface announces its local multicast listeners via the translation
    table.

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

    Linus Lüssing
     
  • Some helper functions used along the TX path have now a new
    "dst_hint" argument but the kerneldoc was missing.

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

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

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

    Simon Wunderlich
     
  • On some architectures ether_addr_copy() is slightly faster
    than memcpy() therefore use the former when possible.

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

    Antonio Quartulli
     
  • Our .ndo_start_xmit handler (batadv_interface_tx()) can rely on having
    the skb mac header pointer set correctly since the following commit
    present in kernels >= 3.9:

    "net: reset mac header in dev_start_xmit()" (6d1ccff627)

    Therefore this commit removes the according, now redundant,
    skb_reset_mac_header() call in batadv_bla_tx().

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

    Linus Lüssing
     
  • Our .ndo_start_xmit handler (batadv_interface_tx()) can rely on having
    the skb mac header pointer set correctly since the following commit
    present in kernels >= 3.9:

    "net: reset mac header in dev_start_xmit()" (6d1ccff627)

    Therefore we can safely use eth_hdr() and vlan_eth_hdr() instead of
    skb->data now, which spares us some ugly type casts.

    At the same time set the mac_header in batadv_dat_snoop_incoming_arp_request()
    before sending the skb along the TX path.

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

    Linus Lüssing
     
  • net/batman-adv/network-coding.c:1535:1-7: Replace memcpy with struct assignment

    Generated by: coccinelle/misc/memcpy-assign.cocci
    Signed-off-by: Fengguang Wu
    Signed-off-by: Martin Hundebøll
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Fengguang Wu
     

19 Feb, 2014

1 commit


18 Feb, 2014

6 commits

  • batadv_send_skb_prepare_unicast(_4addr) might reallocate the
    skb's data. If it does then our ethhdr pointer is not valid
    anymore in batadv_send_skb_unicast(), resulting in a kernel
    paging error.

    Fixing this by refetching the ethhdr pointer after the
    potential reallocation.

    Signed-off-by: Linus Lüssing
    Signed-off-by: Antonio Quartulli

    Antonio Quartulli
     
  • In the failure path of the orig_node initialization routine
    the orig_node->bat_iv.bcast_own field is free'd twice: first
    in batadv_iv_ogm_orig_get() and then later in
    batadv_orig_node_free_rcu().

    Fix it by removing the kfree in batadv_iv_ogm_orig_get().

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

    Antonio Quartulli
     
  • When the TVLV parsing routine succeed the skb is left
    untouched thus leading to a memory leak.

    Fix this by consuming the skb in case of success.

    Introduced by ef26157747d42254453f6b3ac2bd8bd3c53339c3
    ("batman-adv: tvlv - basic infrastructure")

    Reported-by: Russel Senior
    Signed-off-by: Antonio Quartulli
    Tested-by: Russell Senior
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     
  • When computing the CRC on a 2byte variable the order of
    the bytes obviously alters the final result. This means
    that computing the CRC over the same value on two archs
    having different endianess leads to different numbers.

    The global and local translation table CRC computation
    routine makes this mistake while processing the clients
    VIDs. The result is a continuous CRC mismatching between
    nodes having different endianess.

    Fix this by converting the VID to Network Order before
    processing it. This guarantees that every node uses the same
    byte order.

    Introduced by 7ea7b4a142758deaf46c1af0ca9ceca6dd55138b
    ("batman-adv: make the TT CRC logic VLAN specific")

    Reported-by: Russel Senior
    Signed-off-by: Antonio Quartulli
    Tested-by: Russell Senior
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     
  • Since batadv_orig_node_new() sets the refcount to two, assuming that
    the calling function will use a reference for putting the orig_node into
    a hash or similar, both references must be freed if initialization of
    the orig_node fails. Otherwise that object may be leaked in that error
    case.

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

    Simon Wunderlich
     
  • When adding a new neighbour it is important to atomically
    perform the following:
    - check if the neighbour already exists
    - append the neighbour to the proper list

    If the two operations are not performed in an atomic context
    it is possible that two concurrent insertions add the same
    neighbour twice.

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

    Antonio Quartulli