tv.tv_usec = xtime.tv_nsec * 1000; 
tv.tv_usec = xtime.tv_nsec / NSEC_PER_USEC; 
svc_udp_recvfrom(struct svc_rqst *rqstp){	struct svc_sock	*svsk = rqstp->rq_sock;	struct svc_serv	*serv = svsk->sk_server;	struct sk_buff	*skb;	int		err, len;	if (test_and_clear_bit(SK_CHNGBUF, &svsk->sk_flags))	    /* udp sockets need large rcvbuf as all pending	     * requests are still in that buffer.  sndbuf must	     * also be large enough that there is enough space	     * for one reply per thread.	     */	    svc_sock_setbufsize(svsk->sk_sock,				(serv->sv_nrthreads+3) * serv->sv_bufsz,				(serv->sv_nrthreads+3) * serv->sv_bufsz);	if ((rqstp->rq_deferred = svc_deferred_dequeue(svsk))) {		svc_sock_received(svsk);		return svc_deferred_recv(rqstp);	}	clear_bit(SK_DATA, &svsk->sk_flags);	while ((skb = skb_recv_datagram(svsk->sk_sk, 0, 1, &err)) == NULL) {		if (err == -EAGAIN) {			svc_sock_received(svsk);			return err;		}		/* possibly an icmp error */		dprintk("svc: recvfrom returned error %d\n", -err);	}	if (skb->tstamp.off_sec == 0) {		struct timeval tv;		tv.tv_sec = xtime.tv_sec;		tv.tv_usec = xtime.tv_nsec * 1000;		skb_set_timestamp(skb, &tv);		/* Don't enable netstamp, sunrpc doesn't 		   need that much accuracy */	}	skb_get_timestamp(skb, &svsk->sk_sk->sk_stamp);	set_bit(SK_DATA, &svsk->sk_flags); /* there may be more data... */	/*	 * Maybe more packets - kick another thread ASAP.	 */	svc_sock_received(svsk);	len  = skb->len - sizeof(struct udphdr);	rqstp->rq_arg.len = len;	rqstp->rq_prot        = IPPROTO_UDP;	/* Get sender address */	rqstp->rq_addr.sin_family = AF_INET;	rqstp->rq_addr.sin_port = skb->h.uh->source;	rqstp->rq_addr.sin_addr.s_addr = skb->nh.iph->saddr;	rqstp->rq_daddr = skb->nh.iph->daddr;	if (skb_is_nonlinear(skb)) {		/* we have to copy */		local_bh_disable();		if (csum_partial_copy_to_xdr(&rqstp->rq_arg, skb)) {			local_bh_enable();			/* checksum error */			skb_free_datagram(svsk->sk_sk, skb);			return 0;		}		local_bh_enable();		skb_free_datagram(svsk->sk_sk, skb); 	} else {		/* we can use it in-place */		rqstp->rq_arg.head[0].iov_base = skb->data + sizeof(struct udphdr);		rqstp->rq_arg.head[0].iov_len = len;		if (skb->ip_summed != CHECKSUM_UNNECESSARY) {			if ((unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum))) {				skb_free_datagram(svsk->sk_sk, skb);				return 0;			}			skb->ip_summed = CHECKSUM_UNNECESSARY;		}		rqstp->rq_skbuff = skb;	}	rqstp->rq_arg.page_base = 0;	if (len <= rqstp->rq_arg.head[0].iov_len) {		rqstp->rq_arg.head[0].iov_len = len;		rqstp->rq_arg.page_len = 0;	} else {		rqstp->rq_arg.page_len = len - rqstp->rq_arg.head[0].iov_len;		rqstp->rq_argused += (rqstp->rq_arg.page_len + PAGE_SIZE - 1)/ PAGE_SIZE;	}	if (serv->sv_stats)		serv->sv_stats->netudpcnt++;	return len;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4bcde03d41d2264edb4ea3c47cb27da1e2609e48/svcsock.c/buggy/net/sunrpc/svcsock.c