Skip to content

Commit 3fa71fe

Browse files
committed
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>
1 parent 9ab9bb0 commit 3fa71fe

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎net/6lowpan/iphc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,11 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
643643
tmp = ((tmp & 0x03) << 6) | (tmp >> 2);
644644

645645
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)) {
647647
/* flow label can be compressed */
648648
iphc0 |= LOWPAN_IPHC_FL_C;
649649
if ((hdr->priority == 0) &&
650-
((hdr->flow_lbl[0] & 0xF0) == 0)) {
650+
((hdr->flow_lbl[0] & 0xF0) == 0)) {
651651
/* compress (elide) all */
652652
iphc0 |= LOWPAN_IPHC_TC_C;
653653
} else {
@@ -658,7 +658,7 @@ int lowpan_header_compress(struct sk_buff *skb, struct net_device *dev,
658658
} else {
659659
/* Flow label cannot be compressed */
660660
if ((hdr->priority == 0) &&
661-
((hdr->flow_lbl[0] & 0xF0) == 0)) {
661+
((hdr->flow_lbl[0] & 0xF0) == 0)) {
662662
/* compress only traffic class */
663663
iphc0 |= LOWPAN_IPHC_TC_C;
664664
*hc_ptr = (tmp & 0xc0) | (hdr->flow_lbl[0] & 0x0F);

0 commit comments

Comments
 (0)