patch-2.1.120 linux/net/core/neighbour.c

Next file: linux/net/core/rtnetlink.c
Previous file: linux/net/core/iovec.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.119/linux/net/core/neighbour.c linux/net/core/neighbour.c
@@ -9,6 +9,9 @@
  *      modify it under the terms of the GNU General Public License
  *      as published by the Free Software Foundation; either version
  *      2 of the License, or (at your option) any later version.
+ *
+ *	Fixes:
+ *	Vitaly E. Lavrov	releasing NULL neighbor in neigh_add.
  */
 
 #include <linux/config.h>
@@ -1033,7 +1036,8 @@
 					   ndm->ndm_state,
 					   nlh->nlmsg_flags&NLM_F_REPLACE, 0);
 		}
-		neigh_release(n);
+		if (n)
+			neigh_release(n);
 		end_bh_atomic();
 		return err;
 	}
@@ -1043,7 +1047,7 @@
 
 
 static int neigh_fill_info(struct sk_buff *skb, struct neighbour *n,
-			    pid_t pid, u32 seq, int event)
+			   u32 pid, u32 seq, int event)
 {
 	unsigned long now = jiffies;
 	struct ndmsg *ndm;

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