Wed Oct 4 02:25:07 2017 UTC ()
Include socketvar.h for softnet_lock


(ozaki-r)
diff -r1.67 -r1.68 src/sys/sys/protosw.h

cvs diff -r1.67 -r1.68 src/sys/sys/protosw.h (expand / switch to unified diff)

--- src/sys/sys/protosw.h 2017/09/27 10:05:05 1.67
+++ src/sys/sys/protosw.h 2017/10/04 02:25:07 1.68
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: protosw.h,v 1.67 2017/09/27 10:05:05 ozaki-r Exp $ */ 1/* $NetBSD: protosw.h,v 1.68 2017/10/04 02:25:07 ozaki-r Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1982, 1986, 1993 4 * Copyright (c) 1982, 1986, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -484,26 +484,28 @@ name##_wrapper(int a, struct socket *b,  @@ -484,26 +484,28 @@ name##_wrapper(int a, struct socket *b,
484} 484}
485 485
486#define PR_WRAP_CTLINPUT(name) \ 486#define PR_WRAP_CTLINPUT(name) \
487static void * \ 487static void * \
488name##_wrapper(int a, const struct sockaddr *b, void *c)\ 488name##_wrapper(int a, const struct sockaddr *b, void *c)\
489{ \ 489{ \
490 void *rv; \ 490 void *rv; \
491 KERNEL_LOCK(1, NULL); \ 491 KERNEL_LOCK(1, NULL); \
492 rv = name(a, b, c); \ 492 rv = name(a, b, c); \
493 KERNEL_UNLOCK_ONE(NULL); \ 493 KERNEL_UNLOCK_ONE(NULL); \
494 return rv; \ 494 return rv; \
495} 495}
496 496
 497#include <sys/socketvar.h> /* for softnet_lock */
 498
497#define PR_WRAP_INPUT(name) \ 499#define PR_WRAP_INPUT(name) \
498static void \ 500static void \
499name##_wrapper(struct mbuf *m, ...) \ 501name##_wrapper(struct mbuf *m, ...) \
500{ \ 502{ \
501 va_list args; \ 503 va_list args; \
502 int off, nxt; \ 504 int off, nxt; \
503 /* XXX just passing args doesn't work on rump kernels */\ 505 /* XXX just passing args doesn't work on rump kernels */\
504 va_start(args, m); \ 506 va_start(args, m); \
505 off = va_arg(args, int); \ 507 off = va_arg(args, int); \
506 nxt = va_arg(args, int); \ 508 nxt = va_arg(args, int); \
507 va_end(args); \ 509 va_end(args); \
508 mutex_enter(softnet_lock); \ 510 mutex_enter(softnet_lock); \
509 name(m, off, nxt); \ 511 name(m, off, nxt); \