diff options
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index 6e00811d44bc..1a7e6eac90b0 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -616,7 +616,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname, | |||
616 | break; | 616 | break; |
617 | 617 | ||
618 | case SO_PEERSEC: | 618 | case SO_PEERSEC: |
619 | return security_socket_getpeersec(sock, optval, optlen, len); | 619 | return security_socket_getpeersec_stream(sock, optval, optlen, len); |
620 | 620 | ||
621 | default: | 621 | default: |
622 | return(-ENOPROTOOPT); | 622 | return(-ENOPROTOOPT); |
@@ -1385,6 +1385,20 @@ int sock_common_getsockopt(struct socket *sock, int level, int optname, | |||
1385 | 1385 | ||
1386 | EXPORT_SYMBOL(sock_common_getsockopt); | 1386 | EXPORT_SYMBOL(sock_common_getsockopt); |
1387 | 1387 | ||
1388 | #ifdef CONFIG_COMPAT | ||
1389 | int compat_sock_common_getsockopt(struct socket *sock, int level, int optname, | ||
1390 | char __user *optval, int __user *optlen) | ||
1391 | { | ||
1392 | struct sock *sk = sock->sk; | ||
1393 | |||
1394 | if (sk->sk_prot->compat_setsockopt != NULL) | ||
1395 | return sk->sk_prot->compat_getsockopt(sk, level, optname, | ||
1396 | optval, optlen); | ||
1397 | return sk->sk_prot->getsockopt(sk, level, optname, optval, optlen); | ||
1398 | } | ||
1399 | EXPORT_SYMBOL(compat_sock_common_getsockopt); | ||
1400 | #endif | ||
1401 | |||
1388 | int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock, | 1402 | int sock_common_recvmsg(struct kiocb *iocb, struct socket *sock, |
1389 | struct msghdr *msg, size_t size, int flags) | 1403 | struct msghdr *msg, size_t size, int flags) |
1390 | { | 1404 | { |
@@ -1414,6 +1428,20 @@ int sock_common_setsockopt(struct socket *sock, int level, int optname, | |||
1414 | 1428 | ||
1415 | EXPORT_SYMBOL(sock_common_setsockopt); | 1429 | EXPORT_SYMBOL(sock_common_setsockopt); |
1416 | 1430 | ||
1431 | #ifdef CONFIG_COMPAT | ||
1432 | int compat_sock_common_setsockopt(struct socket *sock, int level, int optname, | ||
1433 | char __user *optval, int optlen) | ||
1434 | { | ||
1435 | struct sock *sk = sock->sk; | ||
1436 | |||
1437 | if (sk->sk_prot->compat_setsockopt != NULL) | ||
1438 | return sk->sk_prot->compat_setsockopt(sk, level, optname, | ||
1439 | optval, optlen); | ||
1440 | return sk->sk_prot->setsockopt(sk, level, optname, optval, optlen); | ||
1441 | } | ||
1442 | EXPORT_SYMBOL(compat_sock_common_setsockopt); | ||
1443 | #endif | ||
1444 | |||
1417 | void sk_common_release(struct sock *sk) | 1445 | void sk_common_release(struct sock *sk) |
1418 | { | 1446 | { |
1419 | if (sk->sk_prot->destroy) | 1447 | if (sk->sk_prot->destroy) |