14 Oct, 2014

1 commit

  • The kernel used to contain two functions for length-delimited,
    case-insensitive string comparison, strnicmp with correct semantics and
    a slightly buggy strncasecmp. The latter is the POSIX name, so strnicmp
    was renamed to strncasecmp, and strnicmp made into a wrapper for the new
    strncasecmp to avoid breaking existing users.

    To allow the compat wrapper strnicmp to be removed at some point in the
    future, and to avoid the extra indirection cost, do
    s/strnicmp/strncasecmp/g.

    Signed-off-by: Rasmus Villemoes
    Cc: Marek Lindner
    Acked-by: Antonio Quartulli
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rasmus Villemoes
     

17 Aug, 2014

1 commit

  • 1d023284c31a4e40a94d5bbcb7dbb7a35ee0bcbc ("list: fix order of arguments for
    hlist_add_after(_rcu)") was incorrectly rebased on top of
    d9124268d84a836f14a6ead54ff9d8eee4c43be5 ("batman-adv: Fix out-of-order
    fragmentation support"). The parameter order change of the rebased patch was
    not re-applied as expected. This causes a memory leak and can cause crashes
    when out-of-order packets are received. hlist_add_behind will try to access the
    uninitalized list pointers of frag_entry_new to find the previous/next entry
    and may modify/read random memory locations.

    Signed-off-by: Sven Eckelmann
    Cc: Andrew Morton
    Signed-off-by: David S. Miller

    Sven Eckelmann
     

08 Aug, 2014

1 commit


07 Aug, 2014

1 commit

  • All other add functions for lists have the new item as first argument
    and the position where it is added as second argument. This was changed
    for no good reason in this function and makes using it unnecessary
    confusing.

    The name was changed to hlist_add_behind() to cause unconverted code to
    generate a compile error instead of using the wrong parameter order.

    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Ken Helias
    Cc: "Paul E. McKenney"
    Acked-by: Jeff Kirsher [intel driver bits]
    Cc: Hugh Dickins
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ken Helias
     

06 Aug, 2014

1 commit

  • Conflicts:
    drivers/net/Makefile
    net/ipv6/sysctl_net_ipv6.c

    Two ipv6_table_template[] additions overlap, so the index
    of the ipv6_table[x] assignments needed to be adjusted.

    In the drivers/net/Makefile case, we've gotten rid of the
    garbage whereby we had to list every single USB networking
    driver in the top-level Makefile, there is just one
    "USB_NETWORKING" that guards everything.

    Signed-off-by: David S. Miller

    David S. Miller
     

05 Aug, 2014

4 commits

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

    Simon Wunderlich
     
  • The default hop penalty is currently set to 15, which is applied like
    that for multi interface devices (e.g. dual band APs). Single band
    devices will still use an effective penalty of 30 (hop penalty + wifi
    penalty).

    After receiving reports of too long paths in mesh networks with dual
    band APs which were fixed by increasing the hop penalty, we'd like to
    suggest to increase that default value in the default setting as well.
    We've evaluated that increase in a handful of medium sized mesh
    networks (5-20 nodes) with single and dual band devices, with changes
    for the better (shorter routes, higher throughput) or no change at all.

    This patch changes the hop penalty to 30, which will give an effective
    penalty of 60 on single band devices (hop penalty + wifi penalty).

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

    Simon Wunderlich
     
  • This patch removes unnecessary logspam which resulted from superfluous
    calls to net_ratelimit(). With the supplied patch, net_ratelimit() is
    called after the loglevel has been checked.

    Signed-off-by: André Gaul
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    André Gaul
     
  • batadv_frag_insert_packet was unable to handle out-of-order packets because it
    dropped them directly. This is caused by the way the fragmentation lists is
    checked for the correct place to insert a fragmentation entry.

    The fragmentation code keeps the fragments in lists. The fragmentation entries
    are kept in descending order of sequence number. The list is traversed and each
    entry is compared with the new fragment. If the current entry has a smaller
    sequence number than the new fragment then the new one has to be inserted
    before the current entry. This ensures that the list is still in descending
    order.

    An out-of-order packet with a smaller sequence number than all entries in the
    list still has to be added to the end of the list. The used hlist has no
    information about the last entry in the list inside hlist_head and thus the
    last entry has to be calculated differently. Currently the code assumes that
    the iterator variable of hlist_for_each_entry can be used for this purpose
    after the hlist_for_each_entry finished. This is obviously wrong because the
    iterator variable is always NULL when the list was completely traversed.

    Instead the information about the last entry has to be stored in a different
    variable.

    This problem was introduced in 610bfc6bc99bc83680d190ebc69359a05fc7f605
    ("batman-adv: Receive fragmented packets and merge").

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

    Sven Eckelmann
     

04 Aug, 2014

1 commit


22 Jul, 2014

1 commit


21 Jul, 2014

2 commits

  • When a VLAN interface (on top of batX) is removed and
    re-added within a short timeframe TT does not have enough
    time to properly cleanup. This creates an internal TT state
    mismatch as the newly created softif_vlan will be
    initialized from scratch with a TT client count of zero
    (even if TT entries for this VLAN still exist). The
    resulting TT messages are bogus due to the counter / tt
    client listing mismatch, thus creating inconsistencies on
    every node in the network

    To fix this issue destroy_vlan() has to not free the VLAN
    object immediately but it has to be kept alive until all the
    TT entries for this VLAN have been removed. destroy_vlan()
    still removes the sysfs folder so that the user has the
    feeling that everything went fine.

    If the same VLAN is re-added before the old object is free'd,
    then the latter is resurrected and re-used.

    Implement such behaviour by increasing the reference counter
    of a softif_vlan object every time a new local TT entry for
    such VLAN is created and remove the object from the list
    only when all the TT entries have been destroyed.

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

    Antonio Quartulli
     
  • Since bridge loop avoidance only supports untagged or simple 802.1q
    tagged VLAN claim frames, claim frames with stacked VLAN headers (QinQ)
    should be detected and dropped. Transporting the over the mesh may cause
    problems on the receivers, or create bogus entries in the local tt
    tables.

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

    Simon Wunderlich
     

16 Jul, 2014

1 commit

  • Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
    all users to pass NET_NAME_UNKNOWN.

    Coccinelle patch:

    @@
    expression sizeof_priv, name, setup, txqs, rxqs, count;
    @@

    (
    -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
    +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
    |
    -alloc_netdev_mq(sizeof_priv, name, setup, count)
    +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
    |
    -alloc_netdev(sizeof_priv, name, setup)
    +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
    )

    v9: move comments here from the wrong commit

    Signed-off-by: Tom Gundersen
    Reviewed-by: David Herrmann
    Signed-off-by: David S. Miller

    Tom Gundersen
     

08 Jul, 2014

1 commit

  • kasprintf combines kmalloc and sprintf, and takes care of the size
    calculation itself.

    The semantic patch that makes this change is as follows:

    //
    @@
    expression a,flag;
    expression list args;
    statement S;
    @@

    a =
    - \(kmalloc\|kzalloc\)(...,flag)
    + kasprintf(flag,args)

    - sprintf(a,args);
    //

    Signed-off-by: Himangi Saraogi
    Acked-by: Julia Lawall
    Signed-off-by: David S. Miller

    Himangi Saraogi
     

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

8 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