diff options
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r-- | net/netlink/af_netlink.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index e57d700bf6d9..a007dbb4c9f1 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1091,6 +1091,13 @@ out: | |||
1091 | return 0; | 1091 | return 0; |
1092 | } | 1092 | } |
1093 | 1093 | ||
1094 | /** | ||
1095 | * netlink_set_err - report error to broadcast listeners | ||
1096 | * @ssk: the kernel netlink socket, as returned by netlink_kernel_create() | ||
1097 | * @pid: the PID of a process that we want to skip (if any) | ||
1098 | * @groups: the broadcast group that will notice the error | ||
1099 | * @code: error code, must be negative (as usual in kernelspace) | ||
1100 | */ | ||
1094 | void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) | 1101 | void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) |
1095 | { | 1102 | { |
1096 | struct netlink_set_err_data info; | 1103 | struct netlink_set_err_data info; |
@@ -1100,7 +1107,8 @@ void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) | |||
1100 | info.exclude_sk = ssk; | 1107 | info.exclude_sk = ssk; |
1101 | info.pid = pid; | 1108 | info.pid = pid; |
1102 | info.group = group; | 1109 | info.group = group; |
1103 | info.code = code; | 1110 | /* sk->sk_err wants a positive error value */ |
1111 | info.code = -code; | ||
1104 | 1112 | ||
1105 | read_lock(&nl_table_lock); | 1113 | read_lock(&nl_table_lock); |
1106 | 1114 | ||