int ipfr_newfrag(ip, fin, pass) ip_t *ip; fr_info_t *fin; int pass;
ipfr_newfrag(ip, fin, pass) ip_t *ip; fr_info_t *fin; int pass;
int ipfr_newfrag(ip, fin, pass)ip_t *ip;fr_info_t *fin;int pass;{	ipfr_t	**fp, *fr, frag;	u_int	idx;	frag.ipfr_p = ip->ip_p;	idx = ip->ip_p;	frag.ipfr_id = ip->ip_id;	idx += ip->ip_id;	frag.ipfr_tos = ip->ip_tos;	frag.ipfr_src.s_addr = ip->ip_src.s_addr;	idx += ip->ip_src.s_addr;	frag.ipfr_dst.s_addr = ip->ip_dst.s_addr;	idx += ip->ip_dst.s_addr;	idx *= 127;	idx %= IPFT_SIZE;	/*	 * first, make sure it isn't already there...	 */	MUTEX_ENTER(&ipf_frag);	for (fp = &ipfr_heads[idx]; (fr = *fp); fp = &fr->ipfr_next)		if (!bcmp((char *)&frag.ipfr_src, (char *)&fr->ipfr_src,			  IPFR_CMPSZ)) {			ipfr_stats.ifs_exists++;			MUTEX_EXIT(&ipf_frag);			return -1;		}	if (!(fr = (ipfr_t *)KMALLOC(sizeof(*fr)))) {		ipfr_stats.ifs_nomem++;		MUTEX_EXIT(&ipf_frag);		return -1;	}	if ((fr->ipfr_next = ipfr_heads[idx]))		ipfr_heads[idx]->ipfr_prev = fr;	fr->ipfr_prev = NULL;	ipfr_heads[idx] = fr;	bcopy((char *)&frag.ipfr_src, (char *)&fr->ipfr_src, IPFR_CMPSZ);	fr->ipfr_ttl = 120;	/* 60 seconds */	fr->ipfr_pass = pass & ~(FR_LOGFIRST|FR_LOG);	fr->ipfr_off = (ip->ip_off & 0x1fff) + (fin->fin_dlen >> 3);	*fp = fr;	ipfr_stats.ifs_new++;	ipfr_inuse++;	MUTEX_EXIT(&ipf_frag);	return 0;}