patch-2.1.56 linux/net/ipv4/arp.c

Next file: linux/net/ipv4/tcp_output.c
Previous file: linux/net/core/dev.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.55/linux/net/ipv4/arp.c linux/net/ipv4/arp.c
@@ -797,10 +797,11 @@
 
 	entry = (struct arp_table *)neigh_alloc(sizeof(struct arp_table),
 						&arp_neigh_ops);
-	atomic_set(&entry->u.neigh.refcnt, 1);
 
 	if (entry != NULL)
 	{
+		atomic_set(&entry->u.neigh.refcnt, 1);
+
 		if (how)
 			atomic_inc(&arp_size);
 
@@ -1265,7 +1266,7 @@
 	arp = (struct arphdr *) skb_put(skb,sizeof(struct arphdr) + 2*(dev->addr_len+4));
 	skb->arp = 1;
 	skb->dev = dev;
-	skb->protocol = htons (ETH_P_IP);
+	skb->protocol = htons (ETH_P_ARP);
 
 	/*
 	 *	Fill the device header for the ARP frame

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov