Diff between 4e5a3a80a8425d144ba70b23b02a1bed0d89c352 and a3824b4aac0e894699ca2643af5887239a6c489a

Changed Files

File Additions Deletions Status
mesh/crypto.c +3 -3 modified
mesh/net.c +2 -2 modified
mesh/net.h +2 -2 modified

Full Patch

diff --git a/mesh/crypto.c b/mesh/crypto.c
index a9d6704..31001d2 100644
--- a/mesh/crypto.c
+++ b/mesh/crypto.c
@@ -640,7 +640,7 @@ bool mesh_crypto_packet_parse(const uint8_t *packet, uint8_t packet_len,
 
 	hdr = l_get_be32(packet + 9);
 
-	is_segmented = !!((hdr >> SEG_HDR_SHIFT) & true);
+	is_segmented = !!((hdr >> SEG_HDR_SHIFT) & 0x1);
 	if (segmented)
 		*segmented = is_segmented;
 
@@ -655,7 +655,7 @@ bool mesh_crypto_packet_parse(const uint8_t *packet, uint8_t packet_len,
 
 		if (this_dst && this_opcode == NET_OP_SEG_ACKNOWLEDGE) {
 			if (relay)
-				*relay = !!((hdr >> RELAY_HDR_SHIFT) & true);
+				*relay = !!((hdr >> RELAY_HDR_SHIFT) & 0x1);
 
 			if (seqZero)
 				*seqZero = (hdr >> SEQ_ZERO_HDR_SHIFT) &
@@ -682,7 +682,7 @@ bool mesh_crypto_packet_parse(const uint8_t *packet, uint8_t packet_len,
 
 		if (is_segmented) {
 			if (szmic)
-				*szmic = !!((hdr >> SZMIC_HDR_SHIFT) & true);
+				*szmic = !!((hdr >> SZMIC_HDR_SHIFT) & 0x1);
 
 			if (seqZero)
 				*seqZero = (hdr >> SEQ_ZERO_HDR_SHIFT) &
diff --git a/mesh/net.c b/mesh/net.c
index d11de58..d711f80 100644
--- a/mesh/net.c
+++ b/mesh/net.c
@@ -3195,9 +3195,9 @@ void mesh_net_send_seg(struct mesh_net *net, uint32_t net_key_id,
 {
 	uint8_t packet[30];
 	uint8_t packet_len;
-	bool segmented = !!((hdr >> SEG_HDR_SHIFT) & true);
+	bool segmented = !!((hdr >> SEG_HDR_SHIFT) & 0x1);
 	uint8_t key_aid = (hdr >> KEY_HDR_SHIFT) & KEY_ID_MASK;
-	bool szmic = !!((hdr >> SZMIC_HDR_SHIFT) & true);
+	bool szmic = !!((hdr >> SZMIC_HDR_SHIFT) & 0x1);
 	uint16_t seqZero = (hdr >> SEQ_ZERO_HDR_SHIFT) & SEQ_ZERO_MASK;
 	uint8_t segO = (hdr >> SEGO_HDR_SHIFT) & SEG_MASK;
 	uint8_t segN = (hdr >> SEGN_HDR_SHIFT) & SEG_MASK;
diff --git a/mesh/net.h b/mesh/net.h
index 8a3b403..bdb797e 100644
--- a/mesh/net.h
+++ b/mesh/net.h
@@ -65,9 +65,9 @@ struct mesh_node;
 
 /* Mask of Hdr bits which must be constant over entire incoming SAR message */
 /* (SEG || AKF || AID || SZMIC || SeqZero || SegN) */
-#define HDR_KEY_MASK		((true << SEG_HDR_SHIFT) |		\
+#define HDR_KEY_MASK		((0x1 << SEG_HDR_SHIFT) |		\
 				(KEY_ID_MASK << KEY_HDR_SHIFT) |	\
-				(true << SZMIC_HDR_SHIFT) |		\
+				(0x1 << SZMIC_HDR_SHIFT) |		\
 				(SEQ_ZERO_MASK << SEQ_ZERO_HDR_SHIFT) |	\
 				(SEG_MASK << SEGN_HDR_SHIFT))