eth[12] = 0x08;	/* ETH_P_IP */ eth[13] = 0x00; 
if (snap) { eth[12] = pkt[18]; eth[13] = pkt[19]; } else { /* protocol numbers are from rfc-1700 or * http: */ if (pkt[12] >> 4 == 6) { /* version field from IP header */ eth[12] = 0x86;	/* IPv6 */ eth[13] = 0xdd; } else { eth[12] = 0x08;	/* IPv4 */ eth[13] = 0x00; } } 
static void dvb_net_sec(struct net_device *dev, u8 *pkt, int pkt_len){        u8 *eth;        struct sk_buff *skb;	struct net_device_stats *stats = &(((struct dvb_net_priv *) dev->priv)->stats);	/* note: pkt_len includes a 32bit checksum */	if (pkt_len < 16) {		printk("%s: IP/MPE packet length = %d too small.\n",			dev->name, pkt_len);		stats->rx_errors++;		stats->rx_length_errors++;		return;	}/* it seems some ISPs manage to screw up here, so we have to * relax the error checks... */#if 0	if ((pkt[5] & 0xfd) != 0xc1) {		/* drop scrambled or broken packets */#else	if ((pkt[5] & 0x3c) != 0x00) {		/* drop scrambled */#endif		stats->rx_errors++;		stats->rx_crc_errors++;		return;	}	if (pkt[5] & 0x02) {		//FIXME: handle LLC/SNAP                stats->rx_dropped++;                return;        }	if (pkt[7]) {		/* FIXME: assemble datagram from multiple sections */		stats->rx_errors++;		stats->rx_frame_errors++;		return;	}	/* we have 14 byte ethernet header (ip header follows);	 * 12 byte MPE header; 4 byte checksum; + 2 byte alignment	 */	if (!(skb = dev_alloc_skb(pkt_len - 4 - 12 + 14 + 2))) {		//printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);		stats->rx_dropped++;		return;	}	skb_reserve(skb, 2);    /* longword align L3 header */	skb->dev = dev;	/* copy L3 payload */	eth = (u8 *) skb_put(skb, pkt_len - 12 - 4 + 14);	memcpy(eth + 14, pkt + 12, pkt_len - 12 - 4);	/* create ethernet header: */        eth[0]=pkt[0x0b];        eth[1]=pkt[0x0a];        eth[2]=pkt[0x09];        eth[3]=pkt[0x08];        eth[4]=pkt[0x04];        eth[5]=pkt[0x03];        eth[6]=eth[7]=eth[8]=eth[9]=eth[10]=eth[11]=0;	eth[12] = 0x08;	/* ETH_P_IP */	eth[13] = 0x00;	skb->protocol = dvb_net_eth_type_trans(skb, dev);	stats->rx_packets++;	stats->rx_bytes+=skb->len;        netif_rx(skb);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/59142330aaea9d870d795065d8b91e21d5e55254/dvb_net.c/buggy/drivers/media/dvb/dvb-core/dvb_net.c