Module Name: src Committed By: maxv Date: Thu Feb 8 11:49:37 UTC 2018
Modified Files: src/sys/netinet6: udp6_usrreq.c Log Message: pr_send can be given a NULL lwp. It looks like the control != NULL && lwp == NULL condition is never supposed to happen, but add a panic for safety. To generate a diff of this commit: cvs rdiff -u -r1.132 -r1.133 src/sys/netinet6/udp6_usrreq.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/udp6_usrreq.c diff -u src/sys/netinet6/udp6_usrreq.c:1.132 src/sys/netinet6/udp6_usrreq.c:1.133 --- src/sys/netinet6/udp6_usrreq.c:1.132 Thu Feb 8 11:34:35 2018 +++ src/sys/netinet6/udp6_usrreq.c Thu Feb 8 11:49:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: udp6_usrreq.c,v 1.132 2018/02/08 11:34:35 maxv Exp $ */ +/* $NetBSD: udp6_usrreq.c,v 1.133 2018/02/08 11:49:37 maxv Exp $ */ /* $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $ */ /* $KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $ */ @@ -63,7 +63,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.132 2018/02/08 11:34:35 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.133 2018/02/08 11:49:37 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -708,6 +708,9 @@ udp6_output(struct in6pcb * const in6p, } if (control) { + if (__predict_false(l == NULL)) { + panic("%s: control but no lwp", __func__); + } if ((error = ip6_setpktopts(control, &opt, in6p->in6p_outputopts, l->l_cred, IPPROTO_UDP)) != 0) goto release;