projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57699a4
)
netlink: Fix netlink_insert EADDRINUSE error
author
Herbert Xu
<
[email protected]
>
Fri, 16 Jan 2015 06:23:48 +0000
(17:23 +1100)
committer
David S. Miller
<
[email protected]
>
Fri, 16 Jan 2015 07:38:07 +0000
(
02:38
-0500)
The patch
c5adde9468b0714a051eac7f9666f23eb10b61f7
("netlink:
eliminate nl_sk_hash_lock") introduced a bug where the EADDRINUSE
error has been replaced by ENOMEM. This patch rectifies that
problem.
Signed-off-by: Herbert Xu <
[email protected]
>
Acked-by: Ying Xue <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/netlink/af_netlink.c
patch
|
blob
|
history
diff --git
a/net/netlink/af_netlink.c
b/net/netlink/af_netlink.c
index 01b702d63457601b37784fdd99ac897d1f2de127..7a94185bde6bdec6159a629a79222cebc123e46a 100644
(file)
--- a/
net/netlink/af_netlink.c
+++ b/
net/netlink/af_netlink.c
@@
-1050,7
+1050,7
@@
netlink_update_listeners(struct sock *sk)
static int netlink_insert(struct sock *sk, struct net *net, u32 portid)
{
struct netlink_table *table = &nl_table[sk->sk_protocol];
- int err
= -EADDRINUSE
;
+ int err;
lock_sock(sk);
@@
-1065,10
+1065,13
@@
static int netlink_insert(struct sock *sk, struct net *net, u32 portid)
nlk_sk(sk)->portid = portid;
sock_hold(sk);
- if (__netlink_insert(table, sk, net))
- err = 0;
- else
+
+ err = 0;
+ if (!__netlink_insert(table, sk, net)) {
+ err = -EADDRINUSE;
sock_put(sk);
+ }
+
err:
release_sock(sk);
return err;