aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-07-29 21:48:44 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-30 13:28:40 -0400
commit3fa71fe0b9908144c5e710a4a4fc5d01b60d9dee (patch)
treef3462b5ed0165a4c8744bebd389db463c7ac66cb /net
parent9ab9bb009c16cb785a4358699bbafd4094948893 (diff)
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>
Diffstat (limited to 'net')
-rw-r--r--net/6lowpan/iphc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
index 9e47702d24dd..350ecfafa8e7 100644
--- a/net/6lowpan/iphc.c
+++ b/net/6lowpan/iphc.c
@@ -643,11 +643,11 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
643 tmp = ((tmp & 0x03) << 6) | (tmp >> 2); 643 tmp = ((tmp & 0x03) << 6) | (tmp >> 2);
644 644
645 if (((hdr->flow_lbl[0] & 0x0F) == 0) && 645 if (((hdr->flow_lbl[0] & 0x0F) == 0) &&
646 (hdr->flow_lbl[1] == 0) && (hdr->flow_lbl[2] == 0)) { 646 (hdr->flow_lbl[1] == 0) && (hdr->flow_lbl[2] == 0)) {
647 /* flow label can be compressed */ 647 /* flow label can be compressed */
648 iphc0 |= LOWPAN_IPHC_FL_C; 648 iphc0 |= LOWPAN_IPHC_FL_C;
649 if ((hdr->priority == 0) && 649 if ((hdr->priority == 0) &&
650 ((hdr->flow_lbl[0] & 0xF0) == 0)) { 650 ((hdr->flow_lbl[0] & 0xF0) == 0)) {
651 /* compress (elide) all */ 651 /* compress (elide) all */
652 iphc0 |= LOWPAN_IPHC_TC_C; 652 iphc0 |= LOWPAN_IPHC_TC_C;
653 } else { 653 } else {
@@ -658,7 +658,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
658 } else { 658 } else {
659 /* Flow label cannot be compressed */ 659 /* Flow label cannot be compressed */
660 if ((hdr->priority == 0) && 660 if ((hdr->priority == 0) &&
661 ((hdr->flow_lbl[0] & 0xF0) == 0)) { 661 ((hdr->flow_lbl[0] & 0xF0) == 0)) {
662 /* compress only traffic class */ 662 /* compress only traffic class */
663 iphc0 |= LOWPAN_IPHC_TC_C; 663 iphc0 |= LOWPAN_IPHC_TC_C;
664 *hc_ptr = (tmp & 0xc0) | (hdr->flow_lbl[0] & 0x0F); 664 *hc_ptr = (tmp & 0xc0) | (hdr->flow_lbl[0] & 0x0F);