From 3dc74dc63222b6ee0cd56f4ae5418d96218ac5fb Mon Sep 17 00:00:00 2001 From: Yasuyuki Tanaka Date: Wed, 14 Dec 2016 16:50:28 +0100 Subject: [PATCH] TSCH: fix a wrong return value tsch_security_secure_frame() returns the length of MIC in case of success. Otherwise, it is supposed to return 0. There was one case where it returns 1 in an error handling block. --- core/net/mac/tsch/tsch-security.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/net/mac/tsch/tsch-security.c b/core/net/mac/tsch/tsch-security.c index 0a3d19b8f..d7df867f0 100644 --- a/core/net/mac/tsch/tsch-security.c +++ b/core/net/mac/tsch/tsch-security.c @@ -160,7 +160,7 @@ tsch_security_secure_frame(uint8_t *hdr, uint8_t *outbuf, if(!frame.fcf.security_enabled) { /* Security is not enabled for this frame, we're done */ - return 1; + return 0; } /* Read security key index */