diff --git a/mesh/crypto.c b/mesh/crypto.c
index a9d6704..31001d2 100644
--- a/mesh/crypto.c
+++ b/mesh/crypto.c
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;
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) &
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
{
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
/* 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))