Module Name: src
Committed By: martin
Date: Sun Mar 10 19:13:09 UTC 2024
Modified Files:
src/sys/netinet6 [netbsd-8]: in6.c
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1944):
sys/netinet6/in6.c: revision 1.292
netinet6: Avoid NPD on `ifconfig ifN inet6 ... pltime 0 vltime 0'.
PR kern/53922
To generate a diff of this commit:
cvs rdiff -u -r1.245.2.14 -r1.245.2.15 src/sys/netinet6/in6.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/netinet6/in6.c
diff -u src/sys/netinet6/in6.c:1.245.2.14 src/sys/netinet6/in6.c:1.245.2.15
--- src/sys/netinet6/in6.c:1.245.2.14 Fri Aug 4 14:38:09 2023
+++ src/sys/netinet6/in6.c Sun Mar 10 19:13:09 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: in6.c,v 1.245.2.14 2023/08/04 14:38:09 martin Exp $ */
+/* $NetBSD: in6.c,v 1.245.2.15 2024/03/10 19:13:09 martin Exp $ */
/* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */
/*
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.245.2.14 2023/08/04 14:38:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.245.2.15 2024/03/10 19:13:09 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -708,7 +708,14 @@ in6_control1(struct socket *so, u_long c
int s = splsoftnet();
error = in6_update_ifa1(ifp, ifra, &ia, &psref, 0);
splx(s);
- if (error)
+ /*
+ * in6_update_ifa1 doesn't create the address if its
+ * valid lifetime (vltime) is zero, since we would just
+ * delete the address immediately in that case anyway.
+ * So it may succeed but return null ia. In that case,
+ * nothing left to do.
+ */
+ if (error || ia == NULL)
break;
pfil_run_addrhooks(if_pfil, cmd, &ia->ia_ifa);
break;