IPv6: Fail with appropriate error code when sending RH0
Subsystems (3)
PATCH 1/1 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<[email protected]>
--- net/ipv6/ipv6_sockglue.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
net/ipv6/ipv6_sockglue.c +4 -1
@@ -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 ;
Signature · 1 line
1.5.4.4
Quoted 8 lines · Shan Wei
When sending IPv6 packet with RH0(Type 0 Routing Header), return EINVAL instead of EPERM.
Signed-off-by Shan Wei<[email protected]>--- net/ipv6/ipv6_sockglue.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
Yoshifuji-san, please take a look at this patch.