nskb->nfcache = 0; 
static void send_reset(struct sk_buff *oldskb, int hook){	struct sk_buff *nskb;	struct iphdr *iph = oldskb->nh.iph;	struct tcphdr _otcph, *oth, *tcph;	struct rtable *rt;	u_int16_t tmp_port;	u_int32_t tmp_addr;	unsigned int tcplen;	int needs_ack;	int hh_len;	/* IP header checks: fragment. */	if (oldskb->nh.iph->frag_off & htons(IP_OFFSET))		return;	oth = skb_header_pointer(oldskb, oldskb->nh.iph->ihl * 4,				 sizeof(_otcph), &_otcph);	if (oth == NULL) 		return;	/* No RST for RST. */	if (oth->rst)		return;	/* Check checksum */	tcplen = oldskb->len - iph->ihl * 4;	if (((hook != NF_IP_LOCAL_IN && oldskb->ip_summed != CHECKSUM_HW) ||	     (hook == NF_IP_LOCAL_IN &&	      oldskb->ip_summed != CHECKSUM_UNNECESSARY)) &&	    csum_tcpudp_magic(iph->saddr, iph->daddr, tcplen, IPPROTO_TCP,	                      oldskb->ip_summed == CHECKSUM_HW ? oldskb->csum :	                      skb_checksum(oldskb, iph->ihl * 4, tcplen, 0)))		return;	if ((rt = route_reverse(oldskb, oth, hook)) == NULL)		return;	hh_len = LL_RESERVED_SPACE(rt->u.dst.dev);	/* We need a linear, writeable skb.  We also need to expand	   headroom in case hh_len of incoming interface < hh_len of	   outgoing interface */	nskb = skb_copy_expand(oldskb, hh_len, skb_tailroom(oldskb),			       GFP_ATOMIC);	if (!nskb) {		dst_release(&rt->u.dst);		return;	}	dst_release(nskb->dst);	nskb->dst = &rt->u.dst;	/* This packet will not be the same as the other: clear nf fields */	nf_reset(nskb);	nskb->nfcache = 0;	nskb->nfmark = 0;#ifdef CONFIG_BRIDGE_NETFILTER	nf_bridge_put(nskb->nf_bridge);	nskb->nf_bridge = NULL;#endif	tcph = (struct tcphdr *)((u_int32_t*)nskb->nh.iph + nskb->nh.iph->ihl);	/* Swap source and dest */	tmp_addr = nskb->nh.iph->saddr;	nskb->nh.iph->saddr = nskb->nh.iph->daddr;	nskb->nh.iph->daddr = tmp_addr;	tmp_port = tcph->source;	tcph->source = tcph->dest;	tcph->dest = tmp_port;	/* Truncate to length (no data) */	tcph->doff = sizeof(struct tcphdr)/4;	skb_trim(nskb, nskb->nh.iph->ihl*4 + sizeof(struct tcphdr));	nskb->nh.iph->tot_len = htons(nskb->len);	if (tcph->ack) {		needs_ack = 0;		tcph->seq = oth->ack_seq;		tcph->ack_seq = 0;	} else {		needs_ack = 1;		tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin				      + oldskb->len - oldskb->nh.iph->ihl*4				      - (oth->doff<<2));		tcph->seq = 0;	}	/* Reset flags */	((u_int8_t *)tcph)[13] = 0;	tcph->rst = 1;	tcph->ack = needs_ack;	tcph->window = 0;	tcph->urg_ptr = 0;	/* Adjust TCP checksum */	tcph->check = 0;	tcph->check = tcp_v4_check(tcph, sizeof(struct tcphdr),				   nskb->nh.iph->saddr,				   nskb->nh.iph->daddr,				   csum_partial((char *)tcph,						sizeof(struct tcphdr), 0));	/* Adjust IP TTL, DF */	nskb->nh.iph->ttl = MAXTTL;	/* Set DF, id = 0 */	nskb->nh.iph->frag_off = htons(IP_DF);	nskb->nh.iph->id = 0;	/* Adjust IP checksum */	nskb->nh.iph->check = 0;	nskb->nh.iph->check = ip_fast_csum((unsigned char *)nskb->nh.iph, 					   nskb->nh.iph->ihl);	/* "Never happens" */	if (nskb->len > dst_mtu(nskb->dst))		goto free_nskb;	nf_ct_attach(nskb, oldskb);	NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, nskb, NULL, nskb->dst->dev,		dst_output);	return; free_nskb:	kfree_skb(nskb);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6869c4d8e066e21623c812c448a05f1ed931c9c6/ipt_REJECT.c/clean/net/ipv4/netfilter/ipt_REJECT.c