patch-2.4.0-test3 linux/net/core/neighbour.c

Next file: linux/net/core/sock.c
Previous file: linux/net/bridge/br_input.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/net/core/neighbour.c linux/net/core/neighbour.c
@@ -281,25 +281,27 @@
 	struct neighbour *n, *n1;
 	u32 hash_val;
 	int key_len = tbl->key_len;
+	int error;
 
 	n = neigh_alloc(tbl);
 	if (n == NULL)
-		return NULL;
+		return ERR_PTR(-ENOBUFS);
 
 	memcpy(n->primary_key, pkey, key_len);
 	n->dev = dev;
 	dev_hold(dev);
 
 	/* Protocol specific setup. */
-	if (tbl->constructor &&	tbl->constructor(n) < 0) {
+	if (tbl->constructor &&	(error = tbl->constructor(n)) < 0) {
 		neigh_release(n);
-		return NULL;
+		return ERR_PTR(error);
 	}
 
 	/* Device specific setup. */
-	if (n->parms && n->parms->neigh_setup && n->parms->neigh_setup(n) < 0) {
+	if (n->parms && n->parms->neigh_setup &&
+	    (error = n->parms->neigh_setup(n)) < 0) {
 		neigh_release(n);
-		return NULL;
+		return ERR_PTR(error);
 	}
 
 	n->confirmed = jiffies - (n->parms->base_reachable_time<<1);
@@ -603,8 +605,6 @@
 	struct neigh_table *tbl = (struct neigh_table*)arg;
 	
 	tasklet_schedule(&tbl->gc_task);
-
-	timer_exit(&tbl->gc_timer);
 }
 #endif
 
@@ -676,7 +676,6 @@
 
 	neigh->ops->solicit(neigh, skb_peek(&neigh->arp_queue));
 	atomic_inc(&neigh->probes);
-	timer_exit(&neigh->timer);
 	return;
 
 out:
@@ -685,7 +684,6 @@
 	if (notify && neigh->parms->app_probes)
 		neigh_app_notify(neigh);
 #endif
-	timer_exit(&neigh->timer);
 	neigh_release(neigh);
 }
 
@@ -1021,7 +1019,6 @@
 		tbl->proxy_timer.expires = jiffies + sched_next;
 		add_timer(&tbl->proxy_timer);
 	}
-	timer_exit(&tbl->proxy_timer);
 }
 
 void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
@@ -1247,6 +1244,7 @@
 		if (nda[NDA_LLADDR-1] != NULL &&
 		    nda[NDA_LLADDR-1]->rta_len != RTA_LENGTH(dev->addr_len))
 			goto out;
+		err = 0;
 		n = neigh_lookup(tbl, RTA_DATA(nda[NDA_DST-1]), dev);
 		if (n) {
 			if (nlh->nlmsg_flags&NLM_F_EXCL)
@@ -1254,9 +1252,11 @@
 		} else if (!(nlh->nlmsg_flags&NLM_F_CREATE))
 			err = -ENOENT;
 		else {
-			n = __neigh_lookup(tbl, RTA_DATA(nda[NDA_DST-1]), dev, 1);
-			if (n == NULL)
-				err = -ENOBUFS;
+			n = __neigh_lookup_errno(tbl, RTA_DATA(nda[NDA_DST-1]), dev);
+			if (IS_ERR(n)) {
+				err = PTR_ERR(n);
+				n = NULL;
+			}
 		}
 		if (err == 0) {
 			err = neigh_update(n, nda[NDA_LLADDR-1] ? RTA_DATA(nda[NDA_LLADDR-1]) : NULL,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)