All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcp: md5: remove unneeded check in tcp_v4_parse_md5_keys
@ 2014-08-03 18:45 Dmitry Popov
  2014-08-04  0:05 ` YOSHIFUJI Hideaki
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Popov @ 2014-08-03 18:45 UTC (permalink / raw)
  To: David S. Miller, netdev

tcpm_key is an array inside struct tcp_md5sig, there is no need to check it
against NULL.

Signed-off-by: Dmitry Popov <ixaphire@qrator.net>
---
 net/ipv4/tcp_ipv4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 77cccda..8ea4eff 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1064,7 +1064,7 @@ static int tcp_v4_parse_md5_keys(struct sock *sk, char __user *optval,
 	if (sin->sin_family != AF_INET)
 		return -EINVAL;
 
-	if (!cmd.tcpm_key || !cmd.tcpm_keylen)
+	if (!cmd.tcpm_keylen)
 		return tcp_md5_do_del(sk, (union tcp_md5_addr *)&sin->sin_addr.s_addr,
 				      AF_INET);
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tcp: md5: remove unneeded check in tcp_v4_parse_md5_keys
  2014-08-03 18:45 [PATCH] tcp: md5: remove unneeded check in tcp_v4_parse_md5_keys Dmitry Popov
@ 2014-08-04  0:05 ` YOSHIFUJI Hideaki
  0 siblings, 0 replies; 2+ messages in thread
From: YOSHIFUJI Hideaki @ 2014-08-04  0:05 UTC (permalink / raw)
  To: Dmitry Popov, David S. Miller, netdev, David Miller; +Cc: hideaki.yoshifuji

Dmitry Popov wrote:
> tcpm_key is an array inside struct tcp_md5sig, there is no need to check it
> against NULL.
>
> Signed-off-by: Dmitry Popov <ixaphire@qrator.net>

Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>

(IPv6 side is okay.)

> ---
>   net/ipv4/tcp_ipv4.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 77cccda..8ea4eff 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -1064,7 +1064,7 @@ static int tcp_v4_parse_md5_keys(struct sock *sk, char __user *optval,
>   	if (sin->sin_family != AF_INET)
>   		return -EINVAL;
>
> -	if (!cmd.tcpm_key || !cmd.tcpm_keylen)
> +	if (!cmd.tcpm_keylen)
>   		return tcp_md5_do_del(sk, (union tcp_md5_addr *)&sin->sin_addr.s_addr,
>   				      AF_INET);
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

--yoshfuji

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-04  0:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-03 18:45 [PATCH] tcp: md5: remove unneeded check in tcp_v4_parse_md5_keys Dmitry Popov
2014-08-04  0:05 ` YOSHIFUJI Hideaki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.