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:
Simon Duquennoy 2015-05-06 14:23:32 +02:00
parent bb76bb8beb
commit 290fc829ea
6 changed files with 10 additions and 5 deletions

View file

@ -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));
}