08 Jul, 2016

3 commits

  • The RIOT-OS stack does send intra-pan frames but don't set the intra pan
    flag inside the mac header. It seems this is valid frame addressing but
    inefficient. Anyway this patch adds a new function for intra pan
    addressing, doesn't matter if intra pan flag or source and destination
    are the same. The newly introduction function will be used to check on
    intra pan addressing for 6lowpan.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch reverts commit f9d1ce8f81eb ("ieee802154: fix netns settings").
    The lowpan interface need to be created inside the net namespace where
    the wpan interface is available. The wpan namespace can be changed only
    by nl802154 before. Without this patch it's not possible to create a
    lowpan interface for a wpan interface which isn't inside init_net
    namespace.

    Cc: Nicolas Dichtel
    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch adds netns support for 802.15.4 subsystem. Most parts are
    copy&pasted from wireless subsystem, it has the identically userspace
    API.

    Cc: Nicolas Dichtel
    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

06 Jul, 2016

1 commit


16 Jun, 2016

2 commits

  • This patch adds necessary handling for use the short address for
    802.15.4 6lowpan. It contains support for IPHC address compression
    and new matching algorithmn to decide which link layer address will be
    used for 802.15.4 frame.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Signed-off-by: David S. Miller

    Alexander Aring
     
  • This patch will introduce a 6lowpan neighbour private data. Like the
    interface private data we handle private data for generic 6lowpan and
    for link-layer specific 6lowpan.

    The current first use case if to save the short address for a 802.15.4
    6lowpan neighbour.

    Cc: David S. Miller
    Reviewed-by: Stefan Schmidt
    Acked-by: YOSHIFUJI Hideaki
    Signed-off-by: Alexander Aring
    Signed-off-by: David S. Miller

    Alexander Aring
     

10 Jun, 2016

1 commit


08 Jun, 2016

1 commit

  • Instead of using a single bit (__QDISC___STATE_RUNNING)
    in sch->__state, use a seqcount.

    This adds lockdep support, but more importantly it will allow us
    to sample qdisc/class statistics without having to grab qdisc root lock.

    Signed-off-by: Eric Dumazet
    Cc: Cong Wang
    Cc: Jamal Hadi Salim
    Signed-off-by: David S. Miller

    Eric Dumazet
     

30 May, 2016

1 commit


27 Apr, 2016

1 commit

  • …etooth/bluetooth-next

    Johan Hedberg says:

    ====================
    pull request: bluetooth-next 2016-04-26

    Here's another set of Bluetooth & 802.15.4 patches for the 4.7 kernel:

    - Cleanups & refactoring of ieee802154 & 6lowpan code
    - Security related additions to ieee802154 and mrf24j40 driver
    - Memory corruption fix to Bluetooth 6lowpan code
    - Race condition fix in vhci driver
    - Enhancements to the atusb 802.15.4 driver

    Please let me know if there are any issues pulling. Thanks.
    ====================

    Signed-off-by: David S. Miller <davem@davemloft.net>

    David S. Miller
     

26 Apr, 2016

1 commit


24 Apr, 2016

1 commit


13 Apr, 2016

4 commits

  • This patch moves the 802.15.4 link layer specific structures to generic
    6lowpan. This is necessary for special 802.15.4 6lowpan handling in
    6lowpan generic layer.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch changes the naming for interface private data for lowpan
    intefaces. The current private data scheme is:

    -------------------------------------------------
    | 6LoWPAN Generic | LinkLayer 6LoWPAN |
    -------------------------------------------------

    the current naming schemes are:

    - 6LoWPAN Generic:
    - lowpan_priv
    - LinkLayer 6LoWPAN:
    - BTLE
    - lowpan_dev
    - 802.15.4:
    - lowpan_dev_info

    the new naming scheme with this patch will be:

    - 6LoWPAN Generic:
    - lowpan_dev
    - LinkLayer 6LoWPAN:
    - BTLE
    - lowpan_btle_dev
    - 802.15.4:
    - lowpan_802154_dev

    Signed-off-by: Alexander Aring
    Reviewed-by: Stefan Schmidt
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • The short address is unique in combination with the panid. This patch
    will add the panid for generating an ieee802154 address hash.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • The generation of autoconfigured IPv6 link-local addresses starts with a
    notification on interface up.

    To handle autoconfiguration according to RFC 4944 requires pan id and
    short address to generate an autoconfigured link-local address. This
    patch will avoid changing of these link-layer address configuration
    while lowpan interface is up.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

24 Feb, 2016

1 commit


11 Feb, 2016

1 commit

  • In order to support fast reuseport lookups in TCP, the hash function
    defined in struct proto must be capable of returning an error code.
    This patch changes the function signature of all related hash functions
    to return an integer and handles or propagates this return value at
    all call sites.

    Signed-off-by: Craig Gallek
    Signed-off-by: David S. Miller

    Craig Gallek
     

06 Jan, 2016

1 commit


10 Dec, 2015

1 commit

  • This patch introduces register and unregister functionality for lowpan
    interfaces. While register a lowpan interface there are several things
    which need to be initialize by the 6lowpan subsystem. Upcoming
    functionality need to register/unregister per interface components e.g.
    debugfs entry.

    Reviewed-by: Stefan Schmidt
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

03 Nov, 2015

1 commit

  • This patch fixes following problems :

    1) percpu_counter_init() can return an error, therefore
    init_frag_mem_limit() must propagate this error so that
    inet_frags_init_net() can do the same up to its callers.

    2) If ip[46]_frags_ns_ctl_register() fail, we must unwind
    properly and free the percpu_counter.

    Without this fix, we leave freed object in percpu_counters
    global list (if CONFIG_HOTPLUG_CPU) leading to crashes.

    This bug was detected by KASAN and syzkaller tool
    (http://github.com/google/syzkaller)

    Fixes: 6d7b857d541e ("net: use lib/percpu_counter API for fragmentation mem accounting")
    Signed-off-by: Eric Dumazet
    Reported-by: Dmitry Vyukov
    Cc: Hannes Frederic Sowa
    Cc: Jesper Dangaard Brouer
    Acked-by: Hannes Frederic Sowa
    Signed-off-by: David S. Miller

    Eric Dumazet
     

22 Oct, 2015

1 commit

  • Looking at current situation of memory management in 6lowpan receive
    function I detected some invalid handling. After calling
    lowpan_invoke_rx_handlers we will do a kfree_skb and then NET_RX_DROP on
    error handling. We don't do this before, also on
    skb_share_check/skb_unshare which might manipulate the reference
    counters.

    After running some 'grep -r "dev_add_pack" net/' to look how others
    packet-layer receive callbacks works I detected that every subsystem do
    a kfree_skb, then NET_RX_DROP without calling skb functions which
    might manipulate the skb reference counters. This is the reason why we
    should do the same here like all others subsystems. I didn't find any
    documentation how the packet-layer receive callbacks handle NET_RX_DROP
    return values either.

    This patch will add a kfree_skb, then NET_RX_DROP handling for the
    "trivial checks", in case of skb_share_check/skb_unshare the kfree_skb
    call will be done inside these functions.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

21 Oct, 2015

4 commits

  • This macro is used at 802.15.4 6LoWPAN only and can be replaced by
    memcmp with the interface broadcast address.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch removes the IPHC related defines for doing bit manipulation
    from global 6lowpan header to the iphc file which should the only one
    implementation which use these defines.

    Also move next header compression defines to their nhc implementation.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch changes the lowpan_header_decompress function by removing
    inklayer related information from parameters. This is currently for
    supporting short and extended address for iphc handling in 802154.
    We don't support short address handling anyway right now, but there
    exists already code for handling short addresses in
    lowpan_header_decompress.

    The address parameters are also changed to a void pointer, so 6LoWPAN
    linklayer specific code can put complex structures as these parameters
    and cast it again inside the generic code by evaluating linklayer type
    before. The order is also changed by destination address at first and
    then source address, which is the same like all others functions where
    destination is always the first, memcpy, dev_hard_header,
    lowpan_header_compress, etc.

    This patch also moves the fetching of iphc values from 6LoWPAN linklayer
    specific code into the generic branch.

    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch changes the lowpan_header_compress function by removing
    unused parameters like "len" and drop static value parameters of
    protocol type. Instead we really check the protocol type inside inside
    the skb structure. Also we drop the use of IEEE802154_ADDR_LEN which is
    link-layer specific. Instead we using EUI64_ADDR_LEN which should always
    the default case for now.

    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

08 Oct, 2015

1 commit

  • This patch moves values for all lowpan interface to the shared
    implementation of 6lowpan. This patch also quietly fixes the forgotten
    IFF_NO_QUEUE flag for the bluetooth 6LoWPAN interface. An identically
    commit is 4afbc0d ("net: 6lowpan: convert to using IFF_NO_QUEUE") which
    wasn't changed for bluetooth 6lowpan.

    All 6lowpan interfaces should be virtual with IFF_NO_QUEUE, using EUI64
    address length, the mtu size is 1280 (IPV6_MIN_MTU) and the netdev type
    is ARPHRD_6LOWPAN.

    Signed-off-by: Alexander Aring
    Acked-by: Jukka Rissanen
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

03 Oct, 2015

1 commit


01 Oct, 2015

1 commit

  • This reverts commit 9abc378c66e3d6f437eed77c1c534cbc183523f7
    ("ieee802154: 6lowpan: change datagram var types").

    The reason is that I forgot the IPv6 fragmentation here. Our MTU of
    lowpan interface is 1280 and skb->len should not above of that. If we
    reach a payload above 1280 in IPv6 header then we have a IPv6
    fragmentation above 802.15.4 6LoWPAN fragmentation. The type "u16" was
    fine, instead I added now a WARN_ON_ONCE if skb->len is above MTU which
    should never happen otherwise IPv6 on minimum MTU size is broken.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

30 Sep, 2015

6 commits

  • This patch adds support for increment transmit and receive stats. The
    meaning of these stats are IPv6 based, which shows the stats after
    running the 6lowpan adaptation layer (uncompression/compression,
    fragmentation handling) on receive and before the adaptation layer
    when transmit.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch fixes the data frame sequence numer (dsn) while 6lowpan
    fragmentation for frag1. Currently we create one 802.15.4 header at
    first, then check if it's match into one frame and at the end construct
    many fragments and calling wpan_dev_hard_header for each of them,
    inclusive for the first fragment. This will make the first generated
    header to garbage, instead we copying this header for frag1 instead of
    generate a new one which skips one dsn.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch changes datagram size variable from u16 type to unsigned int.
    The reason is that an IPv6 header has an MAX_UIN16 payload length, but
    the datagram size is payload + IPv6 header length. This avoids overflows
    at some places.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch changes the mtu size of 802.15.4 interfaces. The current
    setting is the meaning of the maximum transport unit with mac header,
    which is 127 bytes according 802.15.4. The linux meaning of the mtu size
    field is the maximum payload of a mac frame. Like in ethernet, which is
    1500 bytes.

    We have dynamic length of mac frames in 802.15.4, this is why we assume
    the minimum header length which is hard_header_len. This contains fc and
    sequence fields. These can evaluated by driver layer without additional
    checks. We currently don't support to set the FCS from userspace, so we
    need to subtract this from mtu size as well.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch adds support for accessing mac802154 llsec implementation
    over nl802154. I added for a new Kconfig entry to provide this
    functionality CONFIG_IEEE802154_NL802154_EXPERIMENTAL. This interface is
    still in development. It provides to change security parameters and
    add/del/dump entries of security tables. Later we can add also a get to
    get an entry by unique identifier.

    Cc: Phoebe Buckheister
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • This patch uses the nla_get_le64 function instead of doing a force
    converting to le64.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

22 Sep, 2015

3 commits

  • This patch cleanups needed_headroom, needed_tailroom and hard_header_len
    fields for wpan and lowpan interfaces.

    For wpan interfaces the worst case mac header len should be part of
    needed_headroom, currently this is set as hard_header_len, but
    hard_header_len should be set to the minimum header length which xmit
    call assumes and this is the minimum frame length of 802.15.4.
    The hard_header_len value will check inside send callbacl of AF_PACKET
    raw sockets.

    For lowpan interfaces, if fragmentation isn't needed the skb will
    call dev_hard_header for 802154 layer and queue it afterwards. This
    happens without new skb allocation, so we need the same headroom and
    tailroom lengths like 802154 inside 802154 6lowpan layer. At least we
    assume as minimum header length an ipv6 header size.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • The current header_ops callback structure of net device are used mostly
    from 802.15.4 upper-layers. Because this callback structure is a very
    generic one, which is also used by e.g. DGRAM AF_PACKET sockets, we
    can't make this callback structure 802.15.4 specific which is currently
    is.

    I saw the smallest "constraint" for calling this callback with
    dev_hard_header/dev_parse_header by AF_PACKET which assign a 8 byte
    array for address void pointers. Currently 802.15.4 specific protocols
    like af802154 and 6LoWPAN will assign the "struct ieee802154_addr" as
    these parameters which is greater than 8 bytes. The current callback
    implementation for header_ops.create assumes always a complete
    "struct ieee802154_addr" which AF_PACKET can't never handled and is
    greater than 8 bytes.

    For that reason we introduce now a "generic" create/parse header_ops
    callback which allows handling with intra-pan extended addresses only.
    This allows a small use-case with AF_PACKET to send "somehow" a valid
    dataframe over DGRAM.

    To keeping the current dev_hard_header behaviour we introduce a similar
    callback structure "wpan_dev_header_ops" which contains 802.15.4 specific
    upper-layer header creation functionality, which can be called by
    wpan_dev_hard_header.

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     
  • Sometimes upper-layer protocols wants to generate a new mac header by
    filling "struct ieee802154_hdr" only. These upper-layers sets for the
    address settings the source and dest fields, but not the fc fields for
    indicate the source and dest address mode. This patch changes the
    "ieee802154_hdr_push" function so the fc address fields are set
    according the source and dest fields of "struct ieee802154_hdr".

    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring
     

17 Sep, 2015

2 commits

  • The ESC dispatch value has some history and it originally was 0x7f in rfc4944
    (see section-5.1). With the release of rfc6282 this value got part of the
    LOWPAN_IPHC range and was no longer available for ESC. Instead 0x40 was used
    as replacement (see section-2 in rfc6282).

    We have been checking the dispatch byte in an order where IPHC would always be
    evaluated before ESC and thus we would never reach the ESC check as the IPHC
    range already covers this value.

    Signed-off-by: Stefan Schmidt
    Acked-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Stefan Schmidt
     
  • This patch changes the return value of lowpan packet receive handler to
    the correct NET_RX_DROP instead RX_DROP.

    This issue was detected by sparse and reported from Marcel:
    net/ieee802154/6lowpan/rx.c:329:32: expected int
    net/ieee802154/6lowpan/rx.c:329:32: got restricted lowpan_rx_result ...

    Reported-by: Marcel Holtmann
    Signed-off-by: Alexander Aring
    Signed-off-by: Marcel Holtmann

    Alexander Aring