Skip to content

Commit

Permalink
ipv6:remove useless check
Browse files Browse the repository at this point in the history
After switch (rthdr->type) {...},the check below is completely useless.Because:
if the type is 2,then hdrlen must be 2 and segments_left must be 1,clearly the
check is redundant;if the type is not 2,then goto sticky_done,the check is useless
too.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Reviewed-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yang Hongyang authored and David S. Miller committed Apr 14, 2009
1 parent 0eca93b commit ce8632b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,10 +380,6 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
default:
goto sticky_done;
}

if ((rthdr->hdrlen & 1) ||
(rthdr->hdrlen >> 1) != rthdr->segments_left)
goto sticky_done;
}

retv = 0;
Expand Down

0 comments on commit ce8632b

Please sign in to comment.