projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sock: struct proto hash function may error
[cascardo/linux.git]
/
include
/
net
/
sock.h
diff --git
a/include/net/sock.h
b/include/net/sock.h
index
f5ea148
..
255d3e0
100644
(file)
--- a/
include/net/sock.h
+++ b/
include/net/sock.h
@@
-984,7
+984,7
@@
struct proto {
void (*release_cb)(struct sock *sk);
/* Keeping track of sk's, looking them up, and port selection methods. */
void (*release_cb)(struct sock *sk);
/* Keeping track of sk's, looking them up, and port selection methods. */
-
void
(*hash)(struct sock *sk);
+
int
(*hash)(struct sock *sk);
void (*unhash)(struct sock *sk);
void (*rehash)(struct sock *sk);
int (*get_port)(struct sock *sk, unsigned short snum);
void (*unhash)(struct sock *sk);
void (*rehash)(struct sock *sk);
int (*get_port)(struct sock *sk, unsigned short snum);
@@
-1194,10
+1194,10
@@
static inline void sock_prot_inuse_add(struct net *net, struct proto *prot,
/* With per-bucket locks this operation is not-atomic, so that
* this version is not worse.
*/
/* With per-bucket locks this operation is not-atomic, so that
* this version is not worse.
*/
-static inline
void
__sk_prot_rehash(struct sock *sk)
+static inline
int
__sk_prot_rehash(struct sock *sk)
{
sk->sk_prot->unhash(sk);
{
sk->sk_prot->unhash(sk);
- sk->sk_prot->hash(sk);
+
return
sk->sk_prot->hash(sk);
}
void sk_prot_clear_portaddr_nulls(struct sock *sk, int size);
}
void sk_prot_clear_portaddr_nulls(struct sock *sk, int size);