From patchwork Wed Aug 9 16:19:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diogenes Pereira X-Patchwork-Id: 9890957 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 113F8601EB for ; Wed, 9 Aug 2017 16:19:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F27112807B for ; Wed, 9 Aug 2017 16:19:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E731128A96; Wed, 9 Aug 2017 16:19:46 +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 510962807B for ; Wed, 9 Aug 2017 16:19:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753197AbdHIQTp (ORCPT ); Wed, 9 Aug 2017 12:19:45 -0400 Received: from mail-qt0-f171.google.com ([209.85.216.171]:35548 "EHLO mail-qt0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752741AbdHIQTp (ORCPT ); Wed, 9 Aug 2017 12:19:45 -0400 Received: by mail-qt0-f171.google.com with SMTP id p3so39338040qtg.2 for ; Wed, 09 Aug 2017 09:19:44 -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=t3bZ/qT1ZRkYsLOcuD4lKgZDNHnwLGrraqoJ07IjERU=; b=kyKoy0wBn1Ofcn68vFRXELhO3WUD9fxmo6M0JpNkImXfCVMFlWt22E3Di1sc0n6f42 mpDSB3anSfGvvDT6qd9snp85Bd/+efH/rT9jV3ojZRTkQSLYtdOldVagx271ydezZR9b f8L599n6AT1oyRD888P0DEBuELo7faS7OMaJzNrYFMWJevw9QvpO2viL6+rmZsfeRs5p kz9T06Hk38Hp768KhQa6TD2f69YXn8tLvCb6ucPwE8y6CARt47nfQ6P+HtGl0Nt2M6LZ fFY5cP4voiqK9rEvtSI8R3IYLL7OJqtdt6APDGsE0GXnGC5ePyCO76jzAJLA9+ZL4lPK vnHQ== 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=t3bZ/qT1ZRkYsLOcuD4lKgZDNHnwLGrraqoJ07IjERU=; b=mHUyvFkH0yV+Y+k9C6gDKgnwsVN0RealnPuJZeE33G/tkCJlVJaXbuEMSMwbJrrwjh r4lsM+hga5PDAc1FSR1rL1i1DppOJcZKGSbwyAnI2cs2ldyf5sa6JjQ9JcMV2ZFgyQUW wUIBglSrue2zSKAff5BegptXh+QMYqeLayhRLdInZWAT81RdtbgutAns2Dxb2DVwO2XH N1eWqj4mcVscD+X40ravjsCOL97OCsiT7Y+Vj05P8mfcy5kife4jhEFWONuBuPpPpOK/ 6u24vj3DxTlbbQXYQG1HBl5yb8CREp2jtPo8a2o1z8/wIsc5IpZ4/VSMN8aXohSqXhKD XWfA== X-Gm-Message-State: AHYfb5hquT/dviry1vZh/v7mn2xJUA4liIqXEqLQ0ujsAsyu8l9ScnqQ c+STGx8FXQkyC/jdngCZ2g== X-Received: by 10.237.57.163 with SMTP id m32mr12586991qte.37.1502295584014; Wed, 09 Aug 2017 09:19:44 -0700 (PDT) Received: from dvnp-VM.cesar.intranet (mikiko.cesar.org.br. [200.199.23.104]) by smtp.gmail.com with ESMTPSA id k11sm1703025qti.17.2017.08.09.09.19.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Aug 2017 09:19:34 -0700 (PDT) From: Diogenes Pereira To: linux-wpan@vger.kernel.org Cc: stefan@osg.samsung.com, alex.aring@gmail.com, Diogenes Pereira Subject: [PATCH v1] mac802154: replace hardcoded value with macro Date: Wed, 9 Aug 2017 13:19:24 -0300 Message-Id: <1502295564-20178-1-git-send-email-dvnp@cesar.org.br> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502126560-24462-2-git-send-email-dvnp@cesar.org.br> References: <1502126560-24462-2-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 1e1c9b2..edec2f9 100644 --- a/net/mac802154/llsec.c +++ b/net/mac802154/llsec.c @@ -713,7 +713,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; }