Consistently use PACKETBUF_ATTR_MAC_SEQNO for MAC sequence number, both input and output. Disable PACKETBUF_ATTR_PACKET_ID in the non-Rime case.
This commit is contained in:
parent
bb76bb8beb
commit
290fc829ea
6 changed files with 10 additions and 5 deletions
|
@ -74,7 +74,7 @@ mac_sequence_is_duplicate(void)
|
|||
for(i = 0; i < MAX_SEQNOS; ++i) {
|
||||
if(linkaddr_cmp(packetbuf_addr(PACKETBUF_ADDR_SENDER),
|
||||
&received_seqnos[i].sender)) {
|
||||
if(packetbuf_attr(PACKETBUF_ATTR_PACKET_ID) == received_seqnos[i].seqno) {
|
||||
if(packetbuf_attr(PACKETBUF_ATTR_MAC_SEQNO) == received_seqnos[i].seqno) {
|
||||
/* Duplicate packet. */
|
||||
return 1;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ mac_sequence_register_seqno(void)
|
|||
for(j = i - 1; j > 0; --j) {
|
||||
memcpy(&received_seqnos[j], &received_seqnos[j - 1], sizeof(struct seqno));
|
||||
}
|
||||
received_seqnos[0].seqno = packetbuf_attr(PACKETBUF_ATTR_PACKET_ID);
|
||||
received_seqnos[0].seqno = packetbuf_attr(PACKETBUF_ATTR_MAC_SEQNO);
|
||||
linkaddr_copy(&received_seqnos[0].sender,
|
||||
packetbuf_addr(PACKETBUF_ADDR_SENDER));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue