[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <48646C84.1000207@cn.fujitsu.com>
Date: Fri, 27 Jun 2008 12:28:52 +0800
From: Shan Wei <shanwei@...fujitsu.com>
To: YOSHIFUJI Hideaki / 吉藤英明
<yoshfuji@...ux-ipv6.org>
CC: davem@...emloft.net, netdev@...r.kernel.org
Subject: [PATCH] IPv6: Fail with appropriate error code when sending RH0
When sending IPv6 packet with RH0(Type 0 Routing Header),
return EINVAL instead of EPERM.
Signed-off-by: Shan Wei<shanwei@...fujitsu.com>
---
net/ipv6/ipv6_sockglue.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 86e28a7..0101d4f 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -377,12 +377,15 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
break;
#endif
default:
+ retv = -EINVAL;
goto sticky_done;
}
if ((rthdr->hdrlen & 1) ||
- (rthdr->hdrlen >> 1) != rthdr->segments_left)
+ (rthdr->hdrlen >> 1) != rthdr->segments_left) {
+ retv = -EINVAL;
goto sticky_done;
+ }
}
retv = 0;
--
1.5.4.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists