Module Name:    src
Committed By:   ozaki-r
Date:           Thu Dec 14 05:49:00 UTC 2017

Modified Files:
        src/sys/net: rtsock.c

Log Message:
Fix a bug that tries to psref_acquire ifa with a psref used before

This fixes ATF tests that started to fail by a recent change to psref.


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/sys/net/rtsock.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.233 src/sys/net/rtsock.c:1.234
--- src/sys/net/rtsock.c:1.233	Thu Dec 14 05:47:45 2017
+++ src/sys/net/rtsock.c	Thu Dec 14 05:48:59 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.233 2017/12/14 05:47:45 ozaki-r Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.234 2017/12/14 05:48:59 ozaki-r Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.233 2017/12/14 05:47:45 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.234 2017/12/14 05:48:59 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -622,6 +622,7 @@ route_output_get_ifa(const struct rt_add
 		if (info.rti_info[RTAX_IFA] == NULL &&
 		    info.rti_info[RTAX_GATEWAY] == NULL)
 			goto next;
+		ifa_release(ifa, psref);
 		if (info.rti_info[RTAX_IFA] == NULL) {
 			/* route change <dst> <gw> -ifp <if> */
 			ifa = ifaof_ifpforaddr_psref(info.rti_info[RTAX_GATEWAY],

Reply via email to