aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svcsock.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r--net/sunrpc/svcsock.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 43bcb4699d69..0cb34f5d58dc 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -400,6 +400,12 @@ static void svc_sock_setbufsize(struct socket *sock, unsigned int snd,
400 release_sock(sock->sk); 400 release_sock(sock->sk);
401#endif 401#endif
402} 402}
403
404static int svc_sock_secure_port(struct svc_rqst *rqstp)
405{
406 return svc_port_is_privileged(svc_addr(rqstp));
407}
408
403/* 409/*
404 * INET callback when data has been received on the socket. 410 * INET callback when data has been received on the socket.
405 */ 411 */
@@ -678,6 +684,7 @@ static struct svc_xprt_ops svc_udp_ops = {
678 .xpo_prep_reply_hdr = svc_udp_prep_reply_hdr, 684 .xpo_prep_reply_hdr = svc_udp_prep_reply_hdr,
679 .xpo_has_wspace = svc_udp_has_wspace, 685 .xpo_has_wspace = svc_udp_has_wspace,
680 .xpo_accept = svc_udp_accept, 686 .xpo_accept = svc_udp_accept,
687 .xpo_secure_port = svc_sock_secure_port,
681}; 688};
682 689
683static struct svc_xprt_class svc_udp_class = { 690static struct svc_xprt_class svc_udp_class = {
@@ -1234,6 +1241,7 @@ static struct svc_xprt_ops svc_tcp_bc_ops = {
1234 .xpo_detach = svc_bc_tcp_sock_detach, 1241 .xpo_detach = svc_bc_tcp_sock_detach,
1235 .xpo_free = svc_bc_sock_free, 1242 .xpo_free = svc_bc_sock_free,
1236 .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr, 1243 .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr,
1244 .xpo_secure_port = svc_sock_secure_port,
1237}; 1245};
1238 1246
1239static struct svc_xprt_class svc_tcp_bc_class = { 1247static struct svc_xprt_class svc_tcp_bc_class = {
@@ -1272,6 +1280,7 @@ static struct svc_xprt_ops svc_tcp_ops = {
1272 .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr, 1280 .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr,
1273 .xpo_has_wspace = svc_tcp_has_wspace, 1281 .xpo_has_wspace = svc_tcp_has_wspace,
1274 .xpo_accept = svc_tcp_accept, 1282 .xpo_accept = svc_tcp_accept,
1283 .xpo_secure_port = svc_sock_secure_port,
1275}; 1284};
1276 1285
1277static struct svc_xprt_class svc_tcp_class = { 1286static struct svc_xprt_class svc_tcp_class = {