6lowpan: fix small comment issue

Fix a little comment issue.
Number 2 is 10 in bits and 1 is 01.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: fix magic number

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: fix return value with comment operator

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: init 6lowpan header and ipv6hdr to zero

When we set it to zero, we can assume that the memory is already zero
while parsing.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: remove setting some memory regions to zero

While we can assume that the memory is already be zero, we can drop some
memsets while parsing.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: Fix fragmentation with link-local compressed addresses

When a new 6lowpan fragment is received, a skbuff is allocated for
the reassembled packet. However when a 6lowpan packet compresses
link-local addresses based on link-layer addresses, the processing
function relies on the skb mac control block to find the related
link-layer address.

This patch copies the control block from the first fragment into
the newly allocated skb to keep a trace of the link-layer addresses
in case of a link-local compressed address.

Signed-off-by: David Hauweele <david@hauweele.net>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: use _saddr and _daddr instead of skb data

Pointers _saddr and _daddr points to source and destination address.
Use this for a link-layer compression to get these addresses.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: add function to uncompress multicast addr

Add function to uncompress multicast address.
This function split the uncompress function for a multicast address
in a seperate function.

To uncompress a multicast address is different than a other
non-multicasts addresses according to rfc6282.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: handle only real local link addresses

A link-local address isn't fe80::/10 it's fe80::/64
see http://tools.ietf.org/html/rfc4291#section-2.5.6
for more details.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: lowpan_uncompress_addr with address_mode

This patch drop the pre and postcount calculation from the
lowpan_uncompress_addr function.

We use instead a switch case over address_mode value, it's easier
to understand what's going on there.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: add warning for CID bit

We don't handle the CID bit currently, so I add a warning and drop the
package.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: add warning for DAC bit

We don't handle the DAC bit currently, so I add a warning and drop the
package.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: add comment for unspec address

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: handle context based source address

Handle context based address when a unspecific address is specified.
For other context based address we print a warning and drop the package
currently because we don't support it right now.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: add dynamic calculated header len func

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: fix fragmentation according to rfc 4944

This patch is only a "possible" solution for the frag/reassmble fix.
I remove the reassmble code from the lowpan_process_data to avoid a
headache if you want to understand it.

Also remove some deadcode, which I don't understand why it was there in
the DISPATCH evaluate switch-case.

TODO:
 - Timer implementation if timer expired

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
6lowpan: remove ack for at86rf230 devices

Signed-off-by: Alexander Aring <alex.aring@gmail.com>