rem: i = hdrlen + min(icl, ICMP_ADVLENMIN); if (buf->m_len < i && (buf = m_pullup(buf, i)) == NULL) {
add: i = hdrlen + min(icl, (int) ICMP_ADVLENMIN); if ((int) buf->m_len < i && (buf = m_pullup(buf, i)) == NULL) {
context: void icmp_input(struct mbuf *buf, int hdrlen){	struct ip *ip = mtod(buf, struct ip *);		struct icmp *ic;	int icl = ip->ip_len;	int i;	uint16 rv;	int code;	struct sockaddr_in icmpsrc = {sizeof(struct sockaddr_in), AF_INET};	if (icl < ICMP_MINLEN) {		icmpstat.icps_tooshort++;		goto freeit;	}#if SHOW_DEBUG	dump_icmp(buf);#endif	i = hdrlen + min(icl, ICMP_ADVLENMIN);	if (buf->m_len < i && (buf = m_pullup(buf, i)) == NULL) {		icmpstat.icps_tooshort++;		return;	}	ip = mtod(buf, struct ip*);		buf->m_len -= hdrlen;	buf->m_data += hdrlen;		ic = mtod(buf, struct icmp*);	if ((rv = in_cksum(buf, icl, 0)) != 0) {		printf("icmp_input: checksum failed over %d bytes (%d)!\n", icl, rv);		icmpstat.icps_checksum++;		goto freeit;	}		buf->m_len += hdrlen;	buf->m_data -= hdrlen;	if (ic->icmp_type > ICMP_MAXTYPE)		goto raw;	icmpstat.icps_inhist[ic->icmp_type]++;	code = ic->icmp_code;		switch (ic->icmp_type) {		case ICMP_UNREACH:			switch (code) {				case ICMP_UNREACH_NET:				case ICMP_UNREACH_HOST:				case ICMP_UNREACH_PROTOCOL:				case ICMP_UNREACH_PORT:				case ICMP_UNREACH_SRCFAIL:					code += PRC_UNREACH_NET;					break;				case ICMP_UNREACH_NEEDFRAG:					code = PRC_MSGSIZE;					break;				case ICMP_UNREACH_NET_UNKNOWN:				case ICMP_UNREACH_NET_PROHIB:				case ICMP_UNREACH_TOSNET:					code = PRC_UNREACH_NET;					break;				case ICMP_UNREACH_HOST_UNKNOWN:				case ICMP_UNREACH_ISOLATED:				case ICMP_UNREACH_HOST_PROHIB:				case ICMP_UNREACH_TOSHOST:					code = PRC_UNREACH_HOST;					break;				default:					goto badcode;			}			goto deliver;		case ICMP_TIMXCEED:			if (code > 1)				goto badcode;			code += PRC_TIMXCEED_INTRANS;			goto deliver;		case ICMP_PARAMPROB:			if (code > 1)				goto badcode;			code = PRC_PARAMPROB;			goto deliver;		case ICMP_SOURCEQUENCH:			if (code)				goto badcode;			code = PRC_QUENCH;deliver:			if (icl < ICMP_ADVLENMIN || icl < ICMP_ADVLEN(ic) ||			    (ic->icmp_ip.ip_hl < sizeof(struct ip) >> 2)) {				icmpstat.icps_badlen++;				goto freeit;			}			ic->icmp_ip.ip_len = htons(ic->icmp_ip.ip_len);			icmpsrc.sin_addr = ic->icmp_ip.ip_dst;			if (proto[ic->icmp_ip.ip_p]->pr_ctlinput)				proto[ic->icmp_ip.ip_p]->pr_ctlinput(code, 				       (struct sockaddr*)&icmpsrc, (void*)&ic->icmp_ip);			break;badcode:			icmpstat.icps_badcode++;			break;				case ICMP_ECHO: {				ic->icmp_type = ICMP_ECHOREPLY;			ip->ip_len += hdrlen;			icmpstat.icps_reflect++;			icmpstat.icps_outhist[ic->icmp_type]++;			icmp_reflect(buf);			return;			break;		}		case ICMP_ECHOREPLY:			break;		default:			break;	}raw:	if (raw)		raw->input(buf, 0);	return;freeit:	m_freem(buf);	return;}