<p></p>
<p><b>@jia200x</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/15995#discussion_r681017233">sys/net/gnrc/link_layer/lorawan/gnrc_lorawan_mlme.c</a>:</p>
<pre style='color:#555'>> +    mac->mlme.pending_mlme_opts |=  GNRC_LORAWAN_MLME_OPTS_LINK_ADR_ANS;
+
+    DEBUG("gnrc_lorawan_mlme: LinkADRReq DataRate_TXPower : DR%u TX%u\n", dr, tx_power);
+    DEBUG("gnrc_lorawan_mlme: LinkADRReq ChMaskCntrl : %u and Channel mask : \
+           %u\n", chmask_ctrl, channel_mask);
+    DEBUG("gnrc_lorawan_mlme: LinkADRReq Redundancy : %u\n", nbtrans);
+
+    return consumed_bytes;
+}
+
+int _fopts_mlme_link_adr_ans(gnrc_lorawan_t *mac, lorawan_buffer_t *buf)
+{
+    for (uint8_t _count = mac->mlme.adr_req_cnt; buf && _count; _count--) {
+        assert(buf->index + GNRC_LORAWAN_CID_LINK_ADR_ANS_SIZE <= buf->size);
+        buf->data[buf->index++] = GNRC_LORAWAN_CID_LINK_ADR_ANS;
+        buf->data[buf->index++] = mac->mlme.adr_flags;
</pre>

⬇️ Suggested change
<pre style="color: #555">-        buf->data[buf->index++] = mac->mlme.adr_flags;
+        buf->data[buf->index++] = mac->mlme.adr_flags & GNRC_LORAWAN_ADR_ANS_MASK;
</pre>

<p>Where <code>GNRC_LORAWAN_ADR_ANS_MASK=0x7</code>. Note <code>adr_flags</code> is keeping track of the contiguous block too, therefore the current snippet will always add an extra bit.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/15995#pullrequestreview-720264949">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYHCWEN66B7SJJ3IRJLT22TIXANCNFSM4XQ67POQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABE7WYHMDHGBY4G3BGAAB5DT22TIXA5CNFSM4XQ67PO2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOFLXF55I.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/15995#pullrequestreview-720264949",
"url": "https://github.com/RIOT-OS/RIOT/pull/15995#pullrequestreview-720264949",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>