diff mbox

[v1] mac802154: replace hardcoded value with macro

Message ID 1502295564-20178-1-git-send-email-dvnp@cesar.org.br (mailing list archive)
State Accepted
Headers show

Commit Message

Diogenes Pereira Aug. 9, 2017, 4:19 p.m. UTC
Use IEEE802154_SCF_SECLEVEL_NONE macro defined at ieee802154.h file.

Signed-off-by: Diogenes Pereira <dvnp@cesar.org.br>
Acked-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 net/mac802154/llsec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Stefan Schmidt Aug. 21, 2017, 2:46 p.m. UTC | #1
Hello Marcel.

could you pick up this one through the bluetooth-next tree as well?

regards
Stefan Schmidt

On 08/09/2017 06:19 PM, Diogenes Pereira wrote:
> Use IEEE802154_SCF_SECLEVEL_NONE macro defined at ieee802154.h file.
> 
> Signed-off-by: Diogenes Pereira <dvnp@cesar.org.br>
> Acked-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>   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;
>   	}
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stefan Schmidt Sept. 20, 2017, 12:31 p.m. UTC | #2
Hello.

On 08/09/2017 06:19 PM, Diogenes Pereira wrote:
> Use IEEE802154_SCF_SECLEVEL_NONE macro defined at ieee802154.h file.
> 
> Signed-off-by: Diogenes Pereira <dvnp@cesar.org.br>
> Acked-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  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;
>  	}
> 

Thanks! This patch has been applied to the wpan-next tree and will be part of the next pull request.

regards
Stefan Schmidt
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 	}