aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svc.c4
-rw-r--r--net/sunrpc/svcsock.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 4ad5fbbb18b4..94eed9b80038 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -1055,10 +1055,8 @@ err_bad:
1055 */ 1055 */
1056u32 svc_max_payload(const struct svc_rqst *rqstp) 1056u32 svc_max_payload(const struct svc_rqst *rqstp)
1057{ 1057{
1058 int max = RPCSVC_MAXPAYLOAD_TCP; 1058 u32 max = rqstp->rq_xprt->xpt_class->xcl_max_payload;
1059 1059
1060 if (rqstp->rq_sock->sk_sock->type == SOCK_DGRAM)
1061 max = RPCSVC_MAXPAYLOAD_UDP;
1062 if (rqstp->rq_server->sv_max_payload < max) 1060 if (rqstp->rq_server->sv_max_payload < max)
1063 max = rqstp->rq_server->sv_max_payload; 1061 max = rqstp->rq_server->sv_max_payload;
1064 return max; 1062 return max;
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 54f1b3d993a6..c507f6f8ee54 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -906,6 +906,7 @@ static struct svc_xprt_ops svc_udp_ops = {
906static struct svc_xprt_class svc_udp_class = { 906static struct svc_xprt_class svc_udp_class = {
907 .xcl_name = "udp", 907 .xcl_name = "udp",
908 .xcl_ops = &svc_udp_ops, 908 .xcl_ops = &svc_udp_ops,
909 .xcl_max_payload = RPCSVC_MAXPAYLOAD_UDP,
909}; 910};
910 911
911static void 912static void
@@ -1359,6 +1360,7 @@ static struct svc_xprt_ops svc_tcp_ops = {
1359static struct svc_xprt_class svc_tcp_class = { 1360static struct svc_xprt_class svc_tcp_class = {
1360 .xcl_name = "tcp", 1361 .xcl_name = "tcp",
1361 .xcl_ops = &svc_tcp_ops, 1362 .xcl_ops = &svc_tcp_ops,
1363 .xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP,
1362}; 1364};
1363 1365
1364void svc_init_xprt_sock(void) 1366void svc_init_xprt_sock(void)