History log of /net/6lowpan/iphc.c
Revision Date Author Comments
3fa71fe0b9908144c5e710a4a4fc5d01b60d9dee 30-Jul-2014 Marcel Holtmann <marcel@holtmann.org> 6lowpan: iphc: Fix parenthesis alignments which off-by-one

CHECK: Alignment should match open parenthesis
+ if (((hdr->flow_lbl[0] & 0x0F) == 0) &&
+ (hdr->flow_lbl[1] == 0) && (hdr->flow_lbl[2] == 0)) {

CHECK: Alignment should match open parenthesis
+ if ((hdr->priority == 0) &&
+ ((hdr->flow_lbl[0] & 0xF0) == 0)) {

CHECK: Alignment should match open parenthesis
+ if ((hdr->priority == 0) &&
+ ((hdr->flow_lbl[0] & 0xF0) == 0)) {

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
9ab9bb009c16cb785a4358699bbafd4094948893 30-Jul-2014 Marcel Holtmann <marcel@holtmann.org> 6lowpan: iphc: Fix missing braces for if statement

CHECK: braces {} should be used on all arms of this statement
+ if ((iphc0 & 0x03) != LOWPAN_IPHC_TTL_I)
[...]
+ else {
[...]

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
26fff593cd7fea82e2a287a65fa6951eef7f9cd6 30-Jul-2014 Marcel Holtmann <marcel@holtmann.org> 6lowpan: iphc: Fix missing blank line after variable declarations

WARNING: Missing a blank line after declarations
+ struct sk_buff *new;
+ if (uncompress_udp_header(skb, &uh))

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
7fc4cfda757d5d8f31ba2ebb07b3fb31ae6986bc 30-Jul-2014 Marcel Holtmann <marcel@holtmann.org> 6lowpan: iphc: Fix issues with alignment matching open parenthesis

This patch fixes all the issues with alignment matching of open
parenthesis found by checkpatch.pl and makes them follow the
network coding style now.

CHECK: Alignment should match open parenthesis
+static int uncompress_addr(struct sk_buff *skb,
+ struct in6_addr *ipaddr, const u8 address_mode,

CHECK: Alignment should match open parenthesis
+static int uncompress_context_based_src_addr(struct sk_buff *skb,
+ struct in6_addr *ipaddr,

CHECK: Alignment should match open parenthesis
+static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr,
+ struct net_device *dev, skb_delivery_cb deliver_skb)

CHECK: Alignment should match open parenthesis
+ new = skb_copy_expand(skb, sizeof(struct ipv6hdr), skb_tailroom(skb),
+ GFP_ATOMIC);

CHECK: Alignment should match open parenthesis
+ raw_dump_table(__func__, "raw skb data dump before receiving",
+ new->data, new->len);

CHECK: Alignment should match open parenthesis
+lowpan_uncompress_multicast_daddr(struct sk_buff *skb,
+ struct in6_addr *ipaddr,

CHECK: Alignment should match open parenthesis
+ raw_dump_inline(NULL, "Reconstructed ipv6 multicast addr is",
+ ipaddr->s6_addr, 16);

CHECK: Alignment should match open parenthesis
+int lowpan_process_data(struct sk_buff *skb, struct net_device *dev,
+ const u8 *saddr, const u8 saddr_type, const u8 saddr_len,

CHECK: Alignment should match open parenthesis
+ raw_dump_table(__func__, "raw skb data dump uncompressed",
+ skb->data, skb->len);

CHECK: Alignment should match open parenthesis
+ err = uncompress_addr(skb, &hdr.saddr, tmp, saddr,
+ saddr_type, saddr_len);

CHECK: Alignment should match open parenthesis
+ err = uncompress_addr(skb, &hdr.daddr, tmp, daddr,
+ daddr_type, daddr_len);

CHECK: Alignment should match open parenthesis
+ pr_debug("dest: stateless compression mode %d dest %pI6c\n",
+ tmp, &hdr.daddr);

CHECK: Alignment should match open parenthesis
+ raw_dump_table(__func__, "raw UDP header dump",
+ (u8 *)&uh, sizeof(uh));

CHECK: Alignment should match open parenthesis
+ raw_dump_table(__func__, "raw header dump", (u8 *)&hdr,
+ sizeof(hdr));

CHECK: Alignment should match open parenthesis
+int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
+ unsigned short type, const void *_daddr,

CHECK: Alignment should match open parenthesis
+ raw_dump_table(__func__, "raw skb network header dump",
+ skb_network_header(skb), sizeof(struct ipv6hdr));

CHECK: Alignment should match open parenthesis
+ raw_dump_table(__func__,
+ "sending raw skb network uncompressed packet",

CHECK: Alignment should match open parenthesis
+ if (((hdr->flow_lbl[0] & 0x0F) == 0) &&
+ (hdr->flow_lbl[1] == 0) && (hdr->flow_lbl[2] == 0)) {

WARNING: quoted string split across lines
+ pr_debug("dest address unicast link-local %pI6c "
+ "iphc1 0x%02x\n", &hdr->daddr, iphc1);

CHECK: Alignment should match open parenthesis
+ raw_dump_table(__func__, "raw skb data dump compressed",
+ skb->data, skb->len);

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
89f534905ad6e7f18d89759efcbfc8225f254de1 30-Jul-2014 Marcel Holtmann <marcel@holtmann.org> 6lowpan: iphc: Fix block comments to match networking style

This patch fixes all the block comment issues found by checkpatch.pl and
makes them match the network style now.

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+/*
+ * Based on patches from Jon Smirl <jonsmirl@gmail.com>

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+/*
+ * Uncompress address function for source and

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+/*
+ * Uncompress address function for source context

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+ /*
+ * UDP lenght needs to be infered from the lower layers

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+ /*
+ * Traffic Class and FLow Label carried in-line

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+ /*
+ * Traffic class carried in-line

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+ /*
+ * Flow Label carried in-line

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+ /*
+ * replace the compressed UDP head by the uncompressed UDP

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+ /*
+ * As we copy some bit-length fields, in the IPHC encoding bytes,

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+ /*
+ * Traffic class, flow label

WARNING: networking block comments don't use an empty /* line, use /* Comment...
+ /*
+ * Hop limit

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
b2e3a479a6ae937b32aa0a8fffc541e4e7778734 29-Jul-2014 Alexander Aring <alex.aring@gmail.com> 6lowpan: iphc: remove check on null

This memory is placed on stack and can't be null so remove the check on
null.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
556a5bfc03c35c6f0b4e85ef6a19d00f0eb6dd00 29-Jul-2014 Alexander Aring <alex.aring@gmail.com> 6lowpan: iphc: use ipv6 api to check address scope

This patch removes the own implementation to check of link-layer,
broadcast and any address type and use the IPv6 api for that.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
85c71240a3e6c151038d9ed3fa88fc0fb80043fb 29-Jul-2014 Alexander Aring <alex.aring@gmail.com> 6lowpan: iphc: cleanup use of lowpan_push_hc_data

This patch uses the lowpan_push_hc_data functions in several places
where we can use it. The lowpan_push_hc_data was introduced in some
previous patches.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
4ebc960f9453d2610d150bef4fc9ca227bd33e22 29-Jul-2014 Alexander Aring <alex.aring@gmail.com> 6lowpan: iphc: cleanup use of lowpan_fetch_skb

We introduced the lowpan_fetch_skb function in some previous patches for
6lowpan to have a generic fetch function. This patch drops the old
function and use the generic lowpan_fetch_skb one.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
8ec1d9be323388550b3eb4390c23217ea0711013 29-Jul-2014 Alexander Aring <alex.aring@gmail.com> 6lowpan: iphc: use sizeof in udp uncompression

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
84ca5e036f41bb2d08accbd3cfd293f0bd955573 29-Jul-2014 Alexander Aring <alex.aring@gmail.com> 6lowpan: iphc: rename hc06_ptr pointer to hc_ptr

The hc06_ptr pointer variable stands for header compression draft-06. We
are mostly rfc complaint. This patch rename the variable to normal hc_ptr.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2c6bed7cfcd3f594ed9e4d6919fa2ebea2243d19 11-Jul-2014 Alexander Aring <alex.aring@gmail.com> 6lowpan: introduce new net/6lowpan directory

This patch moves generic code which is used by bluetooth and ieee802154
6lowpan to a new net/6lowpan directory. This directory contains generic
6LoWPAN code which is shared between bluetooth and ieee802154 MAC-Layer.

This is the IPHC - "IPv6 Header Compression" format at the moment. Which
is described by RFC 6282 [0]. The BLTE 6LoWPAN draft describes that the
IPHC is the same format like IEEE 802.15.4, see [1].

Futuremore we can put more code into this directory which is shared
between BLTE and IEEE 802.15.4 6LoWPAN like RFC 6775 or the routing
protocol RPL RFC 6550.

To avoid naming conflicts I renamed 6lowpan-y to ieee802154_6lowpan-y
in net/ieee802154/Makefile.

[0] http://tools.ietf.org/html/rfc6282
[1] http://tools.ietf.org/html/draft-ietf-6lowpan-btle-12#section-3.2
[2] http://tools.ietf.org/html/rfc6775
[3] http://tools.ietf.org/html/rfc6550

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>