login
Header Space

 
 

[INET]: sk_reuse is valbool

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <netdev@...>
Date: Monday, April 7, 2008 - 11:01 am

I found this while checking how DCCP handles duplicate bind operations;
it seems it is a remainder of earlier code and now defunct.

-----------------------------------> Patch <---------------------------------------
[INET]: sk_reuse is valbool

sk_reuse is declared as "unsigned char", but is set as type valbool in net/core/sock.c.
There is no other place in net/ where sk->sk_reuse is set to a value > 1, so the test 
"sk_reuse > 1" can not be true.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
--
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -133,8 +133,6 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum)
 	goto tb_not_found;
 tb_found:
 	if (!hlist_empty(&tb->owners)) {
-		if (sk->sk_reuse > 1)
-			goto success;
 		if (tb->fastreuse > 0 &&
 		    sk->sk_reuse && sk->sk_state != TCP_LISTEN) {
 			goto success;
-- 


The University of Aberdeen is a charity registered in Scotland, No SC013683.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[INET]: sk_reuse is valbool, Gerrit Renker, (Mon Apr 7, 11:01 am)
Re: [INET]: sk_reuse is valbool, David Miller, (Mon Apr 14, 12:49 am)
speck-geostationary