From 7353829c72fd6a499942fdb9f946f62780e5a4ac Mon Sep 17 00:00:00 2001 From: kkrentz Date: Wed, 2 Mar 2016 01:58:19 -0800 Subject: [PATCH] llsec: Fix for Issue #1537 --- core/net/llsec/noncoresec/noncoresec.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/net/llsec/noncoresec/noncoresec.c b/core/net/llsec/noncoresec/noncoresec.c index a14e71e52..71a1cb82a 100644 --- a/core/net/llsec/noncoresec/noncoresec.c +++ b/core/net/llsec/noncoresec/noncoresec.c @@ -143,16 +143,15 @@ aead(uint8_t hdrlen, int forward) static void add_security_header(void) { - if(!packetbuf_attr(PACKETBUF_ATTR_SECURITY_LEVEL)) { - packetbuf_set_attr(PACKETBUF_ATTR_FRAME_TYPE, FRAME802154_DATAFRAME); - packetbuf_set_attr(PACKETBUF_ATTR_SECURITY_LEVEL, SEC_LVL); - anti_replay_set_counter(); - } + packetbuf_set_attr(PACKETBUF_ATTR_FRAME_TYPE, FRAME802154_DATAFRAME); + packetbuf_set_attr(PACKETBUF_ATTR_SECURITY_LEVEL, SEC_LVL); } /*---------------------------------------------------------------------------*/ static void send(mac_callback_t sent, void *ptr) { + add_security_header(); + anti_replay_set_counter(); NETSTACK_MAC.send(sent, ptr); } /*---------------------------------------------------------------------------*/ @@ -161,7 +160,6 @@ create(void) { int result; - add_security_header(); result = DECORATED_FRAMER.create(); if(result == FRAMER_FAILED) { return result;