rem: int code, type, error = 0; struct ifnet *destifp = NULL;
add: int code, type, error; struct ifnet *destifp;
context: static void ip_forward(struct mbuf *m, int srcrt){	struct ip *ip = mtod(m, struct ip*);	struct sockaddr_in *sin;	struct rtentry *rt;	struct mbuf *mcopy;	n_long dest;	int code, type, error = 0;	struct ifnet *destifp = NULL;	memset(sin, 0, sizeof(*sin));		dest = 0;	if (m->m_flags & M_BCAST || in_canforward(ip->ip_dst) == 0) {		ipstat.ips_cantforward++;		m_freem(m);		return;	}	ip->ip_id = htons(ip->ip_id);	if (ip->ip_ttl <= IPTTLDEC) {		icmp->error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, dest, 0);		return;	}	ip->ip_ttl -= IPTTLDEC;		sin = (struct sockaddr_in *)&ipforward_rt.ro_dst;	if ((rt = ipforward_rt.ro_rt) == NULL ||	    ip->ip_dst.s_addr != sin->sin_addr.s_addr) {		if (ipforward_rt.ro_rt) {			RTFREE(ipforward_rt.ro_rt);			ipforward_rt.ro_rt = NULL;		}		sin->sin_family = AF_INET;		sin->sin_len = sizeof(*sin);		sin->sin_addr = ip->ip_dst;				rtalloc(&ipforward_rt);		if (ipforward_rt.ro_rt == NULL) {			icmp->error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, dest, 0);			return;		}		rt = ipforward_rt.ro_rt;	} 	mcopy = m_copym(m, 0, (int)min(ip->ip_len, 64));	if (rt->rt_ifp == m->m_pkthdr.rcvif &&	    (rt->rt_flags & (RTF_DYNAMIC | RTF_MODIFIED)) == 0 &&	    satosin(rt_key(rt))->sin_addr.s_addr != 0 &&	    ipsendredirects && !srcrt) {#define RTA(rt) ((struct in_ifaddr *)(rt->rt_ifa))		uint32 src = ntohl(ip->ip_src.s_addr);		if (RTA(rt) &&		    (src & RTA(rt)->ia_subnetmask) == RTA(rt)->ia_subnet) {			if (rt->rt_flags & RTF_GATEWAY)				dest = satosin(rt->rt_gateway)->sin_addr.s_addr;			else				dest = ip->ip_dst.s_addr;			type = ICMP_REDIRECT;			code = ICMP_REDIRECT_HOST;		}	}	error = ipv4_output(m, NULL, &ipforward_rt, IP_FORWARDING | IP_ALLOWBROADCAST, 0);	if (error)		ipstat.ips_cantforward++;	else {		ipstat.ips_forward++;		if (type)			ipstat.ips_redirectsent++;		else {			if (mcopy)				m_freem(mcopy);			return;		}	}	if (!mcopy)		return;	destifp = NULL;		switch(error) {		case 0:			break;		case ENETUNREACH:		case EHOSTUNREACH:		case ENETDOWN:		case EHOSTDOWN:		default:			type = ICMP_UNREACH;			code = ICMP_UNREACH_HOST;			break;		case EMSGSIZE:			type = ICMP_UNREACH;			code = ICMP_UNREACH_NEEDFRAG;			if (ipforward_rt.ro_rt)				destifp = ipforward_rt.ro_rt->rt_ifp;			ipstat.ips_cantfrag++;			break;		case ENOBUFS:			type = ICMP_SOURCEQUENCH;			code = 0;			break;	}	icmp->error(mcopy, type, code, dest, destifp);}