netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
@ 2009-01-13  7:35 Yang Hongyang
  2009-01-14  3:47 ` Herbert Xu
  0 siblings, 1 reply; 18+ messages in thread
From: Yang Hongyang @ 2009-01-13  7:35 UTC (permalink / raw)
  To: netdev, David Miller

Actually the condition (optlen == 0) is included in (optlen < sizeof(struct in6_pktinfo)),
so we do not need to check it separately.

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>

---
 net/ipv6/ipv6_sockglue.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 40f3246..e6affa7 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -399,9 +399,7 @@ sticky_done:
 	{
 		struct in6_pktinfo pkt;
 
-		if (optlen == 0)
-			goto e_inval;
-		else if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
+		if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
 			goto e_inval;
 
 		if (copy_from_user(&pkt, optval, sizeof(struct in6_pktinfo))) {
-- 
1.6.0.3
-- 
Regards
Yang Hongyang

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

end of thread, other threads:[~2009-01-15 10:07 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-13  7:35 [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option Yang Hongyang
2009-01-14  3:47 ` Herbert Xu
2009-01-14  3:54   ` Yang Hongyang
2009-01-14  4:07     ` Wei Yongjun
2009-01-14  5:27       ` Yang Hongyang
2009-01-14  8:26         ` Shan Wei
2009-01-15  0:50           ` [PATCHv2]IPv6:remove duplicate check " Yang Hongyang
2009-01-14  4:48     ` [PATCH]IPv6:remove duplicate check of optlen " Herbert Xu
2009-01-15  5:02       ` David Miller
2009-01-15  5:04         ` Herbert Xu
2009-01-15  5:06           ` Herbert Xu
2009-01-15  5:25             ` Yang Hongyang
2009-01-15  5:43           ` David Miller
2009-01-15  5:34         ` Yang Hongyang
2009-01-15  5:37           ` Herbert Xu
2009-01-15  5:45             ` David Miller
2009-01-15  5:48               ` Herbert Xu
2009-01-15 10:07               ` Yang Hongyang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).