if (skb->ip_summed != CHECKSUM_UNNECESSARY && (unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum))) 
if (skb_checksum_complete(skb)) 
static int udpv6_rcv(struct sk_buff **pskb, unsigned int *nhoffp){	struct sk_buff *skb = *pskb;	struct sock *sk;  	struct udphdr *uh;	struct net_device *dev = skb->dev;	struct in6_addr *saddr, *daddr;	u32 ulen = 0;	if (!pskb_may_pull(skb, sizeof(struct udphdr)))		goto short_packet;	saddr = &skb->nh.ipv6h->saddr;	daddr = &skb->nh.ipv6h->daddr;	uh = skb->h.uh;	ulen = ntohs(uh->len);	/* Check for jumbo payload */	if (ulen == 0)		ulen = skb->len;	if (ulen > skb->len || ulen < sizeof(*uh))		goto short_packet;	if (uh->check == 0) {		/* RFC 2460 section 8.1 says that we SHOULD log		   this error. Well, it is reasonable.		 */		LIMIT_NETDEBUG(KERN_INFO "IPv6: udp checksum is 0\n");		goto discard;	}	if (ulen < skb->len) {		if (pskb_trim_rcsum(skb, ulen))			goto discard;		saddr = &skb->nh.ipv6h->saddr;		daddr = &skb->nh.ipv6h->daddr;		uh = skb->h.uh;	}	if (skb->ip_summed==CHECKSUM_HW) {		skb->ip_summed = CHECKSUM_UNNECESSARY;		if (csum_ipv6_magic(saddr, daddr, ulen, IPPROTO_UDP, skb->csum)) {			LIMIT_NETDEBUG(KERN_DEBUG "udp v6 hw csum failure.\n");			skb->ip_summed = CHECKSUM_NONE;		}	}	if (skb->ip_summed != CHECKSUM_UNNECESSARY)		skb->csum = ~csum_ipv6_magic(saddr, daddr, ulen, IPPROTO_UDP, 0);	/* 	 *	Multicast receive code 	 */	if (ipv6_addr_is_multicast(daddr)) {		udpv6_mcast_deliver(uh, saddr, daddr, skb);		return 0;	}	/* Unicast */	/* 	 * check socket cache ... must talk to Alan about his plans	 * for sock caches... i'll skip this for now.	 */	sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, dev->ifindex);	if (sk == NULL) {		if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))			goto discard;		if (skb->ip_summed != CHECKSUM_UNNECESSARY &&		    (unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)))			goto discard;		UDP6_INC_STATS_BH(UDP_MIB_NOPORTS);		icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev);		kfree_skb(skb);		return(0);	}		/* deliver */		udpv6_queue_rcv_skb(sk, skb);	sock_put(sk);	return(0);short_packet:		if (net_ratelimit())		printk(KERN_DEBUG "UDP: short packet: %d/%u\n", ulen, skb->len);discard:	UDP6_INC_STATS_BH(UDP_MIB_INERRORS);	kfree_skb(skb);	return(0);	}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/fb286bb2990a107009dbf25f6ffebeb7df77f9be/udp.c/clean/net/ipv6/udp.c