On Mon, May 08, 2017 at 11:04:56AM +0200, Martin Pieuchot wrote:
> With my previous diff to remove pfctlinput() false positive we can now
> turn the last splsoftnet() into an assert.
>
> pfctlinput() is only used on OpenBSD for PRC_REDIRECT_HOST. It is
> always called during the input path, so with the NET_LOCK() held.
>
> ok?
OK bluhm@
>
> Index: kern/uipc_domain.c
> ===================================================================
> RCS file: /cvs/src/sys/kern/uipc_domain.c,v
> retrieving revision 1.49
> diff -u -p -r1.49 uipc_domain.c
> --- kern/uipc_domain.c 27 Feb 2017 19:16:56 -0000 1.49
> +++ kern/uipc_domain.c 8 May 2017 08:57:03 -0000
> @@ -221,15 +221,15 @@ pfctlinput(int cmd, struct sockaddr *sa)
> {
> struct domain *dp;
> struct protosw *pr;
> - int i, s;
> + int i;
> +
> + NET_ASSERT_LOCKED();
>
> - s = splsoftnet();
> for (i = 0; (dp = domains[i]) != NULL; i++) {
> for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++)
> if (pr->pr_ctlinput)
> (*pr->pr_ctlinput)(cmd, sa, 0, NULL);
> }
> - splx(s);
> }
>
> void