rem: int opt, cnt; uint len;
add: int opt, cnt, len;
context: static void icmp_reflect(struct mbuf *m){	struct ip *ip = mtod(m, struct ip*);	struct in_ifaddr *ia;	struct in_addr t;	struct mbuf *opts = NULL;	int optlen = (ip->ip_hl << 2) - sizeof(struct ip);	struct sockaddr_in icmpdst;	if (!ic_ifaddr) {		ic_ifaddr = get_primary_addr();		if (!ic_ifaddr) {			printf("icmp_reflect: no interfaces available (ic_ifaddr == NULL)\n");			m_freem(m);			return;		}	}		if (!in_canforward(ip->ip_src) &&	    ((ntohl(ip->ip_src.s_addr) & IN_CLASSA_NET) !=	    (IN_LOOPBACKNET << IN_CLASSA_NSHIFT))) {	    printf("icmp_reflect: can't forward packet!\n");		m_freem(m);		goto done;	}	t = ip->ip_dst;	ip->ip_dst = ip->ip_src;	for (ia = ic_ifaddr; ia; ia = ia->ia_next) {		if (t.s_addr == IA_SIN(ia)->sin_addr.s_addr)			break;		if ((ia->ia_ifp->if_flags & IFF_BROADCAST) &&		    t.s_addr == satosin(&ia->ia_broadaddr)->sin_addr.s_addr)			break;	}	icmpdst.sin_addr = t;	if (ia == NULL)		ia = (struct in_ifaddr*)ifaof_ifpforaddr((struct sockaddr*)&icmpdst,		                                         m->m_pkthdr.rcvif);	if (ia == NULL)		ia = get_primary_addr(); //XXX is this right?	t = IA_SIN(ia)->sin_addr;	ip->ip_src = t;	ip->ip_ttl = MAXTTL;	if (optlen > 0) {		uint8 *cp;		int opt, cnt;		uint len;				cp = (uint8*)(ip + 1);		if ((opts = ipm->srcroute()) == 0 &&		    (opts = m_gethdr(MT_HEADER))) {			opts->m_len = sizeof(struct in_addr);			mtod(opts, struct in_addr*)->s_addr = 0;		}		if (opts) {			for (cnt = optlen; cnt > 0; cnt -= len, cp+= len) {				opt = cp[IPOPT_OPTVAL];				if (opt == IPOPT_EOL)					break;				if (opt == IPOPT_NOP)					len = 1;				else {					len = cp[IPOPT_OLEN];					if (len <= 0 || len > cnt)						break;				}				if (opt == IPOPT_RR || opt == IPOPT_TS || 				    opt == IPOPT_SECURITY) {					memcpy((void*)(mtod(opts, char*) + opts->m_len), 					       (void*)cp, len);					opts->m_len += len;				}			}			if ((cnt = opts->m_len % 4)) {				for (; cnt < 4; cnt++) {					*(mtod(opts, char*) + opts->m_len) = IPOPT_EOL;					opts->m_len++;				}			}		}		ip->ip_len -= optlen;		ip->ip_hl = sizeof(struct ip) >> 2;		m->m_len -= optlen;		if (m->m_flags & M_PKTHDR)			m->m_pkthdr.len -= optlen;		optlen += sizeof(struct ip);		memcpy((void*)(ip + 1), (void*)(ip + optlen), 		       (uint)(m->m_len - sizeof(struct ip)));	}	m->m_flags &= ~(M_BCAST | M_MCAST);	icmp_send(m, opts);done:	if (opts)		m_free(opts);}