From 1d324e50d209c2e7f0dc2c83566debc5c8e0a908 Mon Sep 17 00:00:00 2001 From: kkrentz Date: Mon, 27 May 2013 06:30:14 -0700 Subject: [PATCH] framer-802154: Sequence number fix --- core/net/mac/framer-802154.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/net/mac/framer-802154.c b/core/net/mac/framer-802154.c index 9f97ff8a2..d934b62a4 100644 --- a/core/net/mac/framer-802154.c +++ b/core/net/mac/framer-802154.c @@ -130,6 +130,10 @@ create_frame(int type, int do_create) params.seq = packetbuf_attr(PACKETBUF_ATTR_MAC_SEQNO); } else { + /* Ensure that the sequence number 0 is not used as it would bypass the above check. */ + if(mac_dsn == 0) { + mac_dsn++; + } params.seq = mac_dsn++; packetbuf_set_attr(PACKETBUF_ATTR_MAC_SEQNO, params.seq); }