aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/scm.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/scm.c')
-rw-r--r--net/core/scm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/core/scm.c b/net/core/scm.c
index 3b6899b7d810..14596fb37172 100644
--- a/net/core/scm.c
+++ b/net/core/scm.c
@@ -289,8 +289,8 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
289 /* Bump the usage count and install the file. */ 289 /* Bump the usage count and install the file. */
290 sock = sock_from_file(fp[i], &err); 290 sock = sock_from_file(fp[i], &err);
291 if (sock) { 291 if (sock) {
292 sock_update_netprioidx(sock->sk); 292 sock_update_netprioidx(&sock->sk->sk_cgrp_data);
293 sock_update_classid(sock->sk); 293 sock_update_classid(&sock->sk->sk_cgrp_data);
294 } 294 }
295 fd_install(new_fd, get_file(fp[i])); 295 fd_install(new_fd, get_file(fp[i]));
296 } 296 }
@@ -305,6 +305,8 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
305 err = put_user(cmlen, &cm->cmsg_len); 305 err = put_user(cmlen, &cm->cmsg_len);
306 if (!err) { 306 if (!err) {
307 cmlen = CMSG_SPACE(i*sizeof(int)); 307 cmlen = CMSG_SPACE(i*sizeof(int));
308 if (msg->msg_controllen < cmlen)
309 cmlen = msg->msg_controllen;
308 msg->msg_control += cmlen; 310 msg->msg_control += cmlen;
309 msg->msg_controllen -= cmlen; 311 msg->msg_controllen -= cmlen;
310 } 312 }