* [PATCH] IPv6: Fail with appropriate error code when sending RH0
@ 2008-06-27 4:28 Shan Wei
2008-07-19 1:28 ` Shan Wei
0 siblings, 1 reply; 2+ messages in thread
From: Shan Wei @ 2008-06-27 4:28 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明; +Cc: davem, netdev
When sending IPv6 packet with RH0(Type 0 Routing Header),
return EINVAL instead of EPERM.
Signed-off-by: Shan Wei<shanwei@cn.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-19 1:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-27 4:28 [PATCH] IPv6: Fail with appropriate error code when sending RH0 Shan Wei
2008-07-19 1:28 ` Shan Wei
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).