From patchwork Mon Aug 7 17:22:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogenes Pereira X-Patchwork-Id: 9885913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B981602CC for ; Mon, 7 Aug 2017 17:44:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CA06286B6 for ; Mon, 7 Aug 2017 17:44:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4175E2869A; Mon, 7 Aug 2017 17:44:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F212286D9 for ; Mon, 7 Aug 2017 17:44:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751505AbdHGRlP (ORCPT ); Mon, 7 Aug 2017 13:41:15 -0400 Received: from mail-qt0-f170.google.com ([209.85.216.170]:36446 "EHLO mail-qt0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751775AbdHGRk6 (ORCPT ); Mon, 7 Aug 2017 13:40:58 -0400 Received: by mail-qt0-f170.google.com with SMTP id v29so6734157qtv.3 for ; Mon, 07 Aug 2017 10:40:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cesar-org-br.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UbclPvRy2+gyR7IeSG9TxzGX5p0eIk8j6qbfJqxZI3Y=; b=1emZhGQbXlTav+cUDuhvoOWnNFx8jWXIM/rPzx8FG/iMnBo73I7LZ7fp4jKVWP0Wj9 to7p5VYjyUfhFPF/+lLQjCCrjTY7hu6HOy0PfsJNB4CNy6Ar61yZn7Wx6GgaiTdCqs3q K1Miy+eCYV1U+pfxlP1ddfEovGlgDSqo33Iu0XaG4FRdERmX8nXJ2TvN7QPhHoO4s1yL utjjtg7MC2KYa8WCdNexz9JYKoKh7gT3zAKFWi4dLReQG/UvmGyyf2DCW2C7c68Cy0LY CWYpwvrRZAjbLoytHdBVb3YSYDw6wet8m7iwNJGHTTuSz6EwbAI5jZXPOHyI+PqsoLBp XXYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UbclPvRy2+gyR7IeSG9TxzGX5p0eIk8j6qbfJqxZI3Y=; b=UZ9WF4MVH6tsMRufYXzgUOuyQeLjwCUKg6Gbz+4l9egT9L7jKGAA75SSog4XZCgqHQ ftJwwHxTZvOz0D85jQJJTINTTb5nWa+VQokmIlxStih8pjAbD6EkEsk+N7G5nKcWJNbE FuVTnw6F+2BwTuuDlRkOPbGB/OyXyLvBlzbqGRZKf7oMOfOQBUynLfKKvX6QbMQA7S9G 6MfU5RsNhs5vZ/bxu/2t1i6CouKKDKxPUbKPE+nQeEGVbDHOkQ5ncwyI0o4bhMRjxFGZ P1TfjtztRf//7D+WlcQePyIVv0qZ/KOvTkzBlcBsFHgcBdzvIN7Pe3IM0Ww9Buk5atb8 LrVA== X-Gm-Message-State: AHYfb5jB8wU3YV+WVgRczR4tq+F1rkPNdzl+YVQyfZHvMPf6DDEc8cNA S6VglC/L3eyLaKwFHC4= X-Received: by 10.200.33.232 with SMTP id 37mr2036779qtz.11.1502127656338; Mon, 07 Aug 2017 10:40:56 -0700 (PDT) Received: from dvnp-VM.cesar.intranet (mikiko.cesar.org.br. [200.199.23.104]) by smtp.gmail.com with ESMTPSA id b5sm6010419qkh.82.2017.08.07.10.40.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 10:40:55 -0700 (PDT) From: Diogenes Pereira To: linux-wpan@vger.kernel.org Cc: aar@pengutronix.de, stefan@osg.samsung.com, Diogenes Pereira Subject: [PATCH v0 2/2] mac802154: replace hardcoded value with macro Date: Mon, 7 Aug 2017 14:22:40 -0300 Message-Id: <1502126560-24462-2-git-send-email-dvnp@cesar.org.br> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502126560-24462-1-git-send-email-dvnp@cesar.org.br> References: <1502126560-24462-1-git-send-email-dvnp@cesar.org.br> Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use IEEE802154_SCF_SECLEVEL_NONE macro defined at ieee802154.h file. Signed-off-by: Diogenes Pereira Acked-by: Stefan Schmidt --- net/mac802154/llsec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mac802154/llsec.c b/net/mac802154/llsec.c index 3c8ae3f..f51093e 100644 --- a/net/mac802154/llsec.c +++ b/net/mac802154/llsec.c @@ -718,7 +718,8 @@ int mac802154_llsec_encrypt(struct mac802154_llsec *sec, struct sk_buff *skb) if (hlen < 0 || hdr.fc.type != IEEE802154_FC_TYPE_DATA) return -EINVAL; - if (!hdr.fc.security_enabled || hdr.sec.level == 0) { + if (!hdr.fc.security_enabled || + hdr.sec.level == IEEE802154_SCF_SECLEVEL_NONE) { skb_push(skb, hlen); return 0; }