LIMIT_NETDEBUG( printk(KERN_INFO "ICMP: %u.%u.%u.%u: " 
LIMIT_NETDEBUG(KERN_INFO "ICMP: %u.%u.%u.%u: " 
static void icmp_unreach(struct sk_buff *skb){	struct iphdr *iph;	struct icmphdr *icmph;	int hash, protocol;	struct net_protocol *ipprot;	struct sock *raw_sk;	u32 info = 0;	/*	 *	Incomplete header ?	 * 	Only checks for the IP header, there should be an	 *	additional check for longer headers in upper levels.	 */	if (!pskb_may_pull(skb, sizeof(struct iphdr)))		goto out_err;	icmph = skb->h.icmph;	iph   = (struct iphdr *)skb->data;	if (iph->ihl < 5) /* Mangled header, drop. */		goto out_err;	if (icmph->type == ICMP_DEST_UNREACH) {		switch (icmph->code & 15) {		case ICMP_NET_UNREACH:		case ICMP_HOST_UNREACH:		case ICMP_PROT_UNREACH:		case ICMP_PORT_UNREACH:			break;		case ICMP_FRAG_NEEDED:			if (ipv4_config.no_pmtu_disc) {				LIMIT_NETDEBUG(					printk(KERN_INFO "ICMP: %u.%u.%u.%u: "							 "fragmentation needed "							 "and DF set.\n",					       NIPQUAD(iph->daddr)));			} else {				info = ip_rt_frag_needed(iph,						     ntohs(icmph->un.frag.mtu));				if (!info)					goto out;			}			break;		case ICMP_SR_FAILED:			LIMIT_NETDEBUG(				printk(KERN_INFO "ICMP: %u.%u.%u.%u: Source "						 "Route Failed.\n",				       NIPQUAD(iph->daddr)));			break;		default:			break;		}		if (icmph->code > NR_ICMP_UNREACH)			goto out;	} else if (icmph->type == ICMP_PARAMETERPROB)		info = ntohl(icmph->un.gateway) >> 24;	/*	 *	Throw it at our lower layers	 *	 *	RFC 1122: 3.2.2 MUST extract the protocol ID from the passed	 *		  header.	 *	RFC 1122: 3.2.2.1 MUST pass ICMP unreach messages to the	 *		  transport layer.	 *	RFC 1122: 3.2.2.2 MUST pass ICMP time expired messages to	 *		  transport layer.	 */	/*	 *	Check the other end isnt violating RFC 1122. Some routers send	 *	bogus responses to broadcast frames. If you see this message	 *	first check your netmask matches at both ends, if it does then	 *	get the other vendor to fix their kit.	 */	if (!sysctl_icmp_ignore_bogus_error_responses &&	    inet_addr_type(iph->daddr) == RTN_BROADCAST) {		if (net_ratelimit())			printk(KERN_WARNING "%u.%u.%u.%u sent an invalid ICMP "					    "type %u, code %u "					    "error to a broadcast: %u.%u.%u.%u on %s\n",			       NIPQUAD(skb->nh.iph->saddr),			       icmph->type, icmph->code,			       NIPQUAD(iph->daddr),			       skb->dev->name);		goto out;	}	/* Checkin full IP header plus 8 bytes of protocol to	 * avoid additional coding at protocol handlers.	 */	if (!pskb_may_pull(skb, iph->ihl * 4 + 8))		goto out;	iph = (struct iphdr *)skb->data;	protocol = iph->protocol;	/*	 *	Deliver ICMP message to raw sockets. Pretty useless feature?	 */	/* Note: See raw.c and net/raw.h, RAWV4_HTABLE_SIZE==MAX_INET_PROTOS */	hash = protocol & (MAX_INET_PROTOS - 1);	read_lock(&raw_v4_lock);	if ((raw_sk = sk_head(&raw_v4_htable[hash])) != NULL) {		while ((raw_sk = __raw_v4_lookup(raw_sk, protocol, iph->daddr,						 iph->saddr,						 skb->dev->ifindex)) != NULL) {			raw_err(raw_sk, skb, info);			raw_sk = sk_next(raw_sk);			iph = (struct iphdr *)skb->data;		}	}	read_unlock(&raw_v4_lock);	rcu_read_lock();	ipprot = rcu_dereference(inet_protos[hash]);	if (ipprot && ipprot->err_handler)		ipprot->err_handler(skb, info);	rcu_read_unlock();out:	return;out_err:	ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);	goto out;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/64ce207306debd7157f47282be94770407bec01c/icmp.c/buggy/net/ipv4/icmp.c