diff options
author | Mark Brown <broonie@linaro.org> | 2013-11-21 07:56:52 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-21 07:56:52 -0500 |
commit | 16ec790938d4f356c82fab27b9a9adf4d6fe19a6 (patch) | |
tree | 8158b4c88b59391274d539a7e8e6985446d900e7 /net/unix/af_unix.c | |
parent | e64001e8efc107992fd835770f6383d0dc731594 (diff) | |
parent | 254dc326dbfd23c2678fafad1b84fc0e42ac4374 (diff) |
Merge tag 'ib-asoc-1' of git://git.linaro.org/people/ljones/mfd into asoc-arizona
Immutable branch for ASoC, as requested by Mark Brown
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 86de99ad2976..c1f403bed683 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1246,6 +1246,15 @@ static int unix_socketpair(struct socket *socka, struct socket *sockb) | |||
1246 | return 0; | 1246 | return 0; |
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | static void unix_sock_inherit_flags(const struct socket *old, | ||
1250 | struct socket *new) | ||
1251 | { | ||
1252 | if (test_bit(SOCK_PASSCRED, &old->flags)) | ||
1253 | set_bit(SOCK_PASSCRED, &new->flags); | ||
1254 | if (test_bit(SOCK_PASSSEC, &old->flags)) | ||
1255 | set_bit(SOCK_PASSSEC, &new->flags); | ||
1256 | } | ||
1257 | |||
1249 | static int unix_accept(struct socket *sock, struct socket *newsock, int flags) | 1258 | static int unix_accept(struct socket *sock, struct socket *newsock, int flags) |
1250 | { | 1259 | { |
1251 | struct sock *sk = sock->sk; | 1260 | struct sock *sk = sock->sk; |
@@ -1280,6 +1289,7 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags) | |||
1280 | /* attach accepted sock to socket */ | 1289 | /* attach accepted sock to socket */ |
1281 | unix_state_lock(tsk); | 1290 | unix_state_lock(tsk); |
1282 | newsock->state = SS_CONNECTED; | 1291 | newsock->state = SS_CONNECTED; |
1292 | unix_sock_inherit_flags(sock, newsock); | ||
1283 | sock_graft(tsk, newsock); | 1293 | sock_graft(tsk, newsock); |
1284 | unix_state_unlock(tsk); | 1294 | unix_state_unlock(tsk); |
1285 | return 0; | 1295 | return 0; |