diff options
Diffstat (limited to 'net/sunrpc/svcsock.c')
| -rw-r--r-- | net/sunrpc/svcsock.c | 22 | 
1 files changed, 17 insertions, 5 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index a4bc98265d88..135ec2c11b3b 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -39,6 +39,7 @@  #include <net/checksum.h>  #include <net/ip.h>  #include <net/ipv6.h> +#include <net/udp.h>  #include <net/tcp.h>  #include <net/tcp_states.h>  #include <asm/uaccess.h> @@ -129,6 +130,18 @@ static void svc_release_skb(struct svc_rqst *rqstp)  	}  } +static void svc_release_udp_skb(struct svc_rqst *rqstp) +{ +	struct sk_buff *skb = rqstp->rq_xprt_ctxt; + +	if (skb) { +		rqstp->rq_xprt_ctxt = NULL; + +		dprintk("svc: service %p, releasing skb %p\n", rqstp, skb); +		consume_skb(skb); +	} +} +  union svc_pktinfo_u {  	struct in_pktinfo pkti;  	struct in6_pktinfo pkti6; @@ -549,7 +562,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)  	err = kernel_recvmsg(svsk->sk_sock, &msg, NULL,  			     0, 0, MSG_PEEK | MSG_DONTWAIT);  	if (err >= 0) -		skb = skb_recv_datagram(svsk->sk_sk, 0, 1, &err); +		skb = skb_recv_udp(svsk->sk_sk, 0, 1, &err);  	if (skb == NULL) {  		if (err != -EAGAIN) { @@ -590,7 +603,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)  			goto out_free;  		}  		local_bh_enable(); -		skb_free_datagram_locked(svsk->sk_sk, skb); +		consume_skb(skb);  	} else {  		/* we can use it in-place */  		rqstp->rq_arg.head[0].iov_base = skb->data; @@ -617,8 +630,7 @@ static int svc_udp_recvfrom(struct svc_rqst *rqstp)  	return len;  out_free: -	trace_kfree_skb(skb, svc_udp_recvfrom); -	skb_free_datagram_locked(svsk->sk_sk, skb); +	kfree_skb(skb);  	return 0;  } @@ -679,7 +691,7 @@ static struct svc_xprt_ops svc_udp_ops = {  	.xpo_create = svc_udp_create,  	.xpo_recvfrom = svc_udp_recvfrom,  	.xpo_sendto = svc_udp_sendto, -	.xpo_release_rqst = svc_release_skb, +	.xpo_release_rqst = svc_release_udp_skb,  	.xpo_detach = svc_sock_detach,  	.xpo_free = svc_sock_free,  	.xpo_prep_reply_hdr = svc_udp_prep_reply_hdr,  |