| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | /* $KAME: dccp6_usrreq.c,v 1.13 2005/07/27 08:42:56 nishida Exp $ */ | | 1 | /* $KAME: dccp6_usrreq.c,v 1.13 2005/07/27 08:42:56 nishida Exp $ */ |
2 | /* $NetBSD: dccp6_usrreq.c,v 1.3 2015/04/24 22:32:37 rtr Exp $ */ | | 2 | /* $NetBSD: dccp6_usrreq.c,v 1.4 2015/04/25 14:56:05 rtr Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (C) 2003 WIDE Project. | | 5 | * Copyright (C) 2003 WIDE Project. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
15 | * documentation and/or other materials provided with the distribution. | | 15 | * documentation and/or other materials provided with the distribution. |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE | | 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE |
24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | * SUCH DAMAGE. | | 30 | * SUCH DAMAGE. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: dccp6_usrreq.c,v 1.3 2015/04/24 22:32:37 rtr Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: dccp6_usrreq.c,v 1.4 2015/04/25 14:56:05 rtr Exp $"); |
35 | | | 35 | |
36 | #include "opt_inet.h" | | 36 | #include "opt_inet.h" |
37 | #include "opt_dccp.h" | | 37 | #include "opt_dccp.h" |
38 | | | 38 | |
39 | #include <sys/param.h> | | 39 | #include <sys/param.h> |
40 | #include <sys/systm.h> | | 40 | #include <sys/systm.h> |
41 | #include <sys/domain.h> | | 41 | #include <sys/domain.h> |
42 | #include <sys/kernel.h> | | 42 | #include <sys/kernel.h> |
43 | #include <sys/pool.h> | | 43 | #include <sys/pool.h> |
44 | #include <sys/lock.h> | | 44 | #include <sys/lock.h> |
45 | #include <sys/malloc.h> | | 45 | #include <sys/malloc.h> |
46 | #include <sys/mbuf.h> | | 46 | #include <sys/mbuf.h> |
47 | #include <sys/proc.h> | | 47 | #include <sys/proc.h> |
| @@ -258,27 +258,27 @@ dccp6_listen(struct socket *so, struct l | | | @@ -258,27 +258,27 @@ dccp6_listen(struct socket *so, struct l |
258 | dp->seq_snd = 512; | | 258 | dp->seq_snd = 512; |
259 | } | | 259 | } |
260 | INP_UNLOCK(inp); | | 260 | INP_UNLOCK(inp); |
261 | return error; | | 261 | return error; |
262 | } | | 262 | } |
263 | | | 263 | |
264 | int | | 264 | int |
265 | dccp6_accept(struct socket *so, struct sockaddr *nam) | | 265 | dccp6_accept(struct socket *so, struct sockaddr *nam) |
266 | { | | 266 | { |
267 | struct in6pcb *in6p = NULL; | | 267 | struct in6pcb *in6p = NULL; |
268 | int error = 0; | | 268 | int error = 0; |
269 | | | 269 | |
270 | DCCP_DEBUG((LOG_INFO, "Entering dccp6_accept!\n")); | | 270 | DCCP_DEBUG((LOG_INFO, "Entering dccp6_accept!\n")); |
271 | if (m == NULL) { | | 271 | if (nam == NULL) { |
272 | return EINVAL; | | 272 | return EINVAL; |
273 | } | | 273 | } |
274 | if (so->so_state & SS_ISDISCONNECTED) { | | 274 | if (so->so_state & SS_ISDISCONNECTED) { |
275 | DCCP_DEBUG((LOG_INFO, "so_state && SS_ISDISCONNECTED!, so->state = %i\n", so->so_state)); | | 275 | DCCP_DEBUG((LOG_INFO, "so_state && SS_ISDISCONNECTED!, so->state = %i\n", so->so_state)); |
276 | return ECONNABORTED; | | 276 | return ECONNABORTED; |
277 | } | | 277 | } |
278 | | | 278 | |
279 | INP_INFO_RLOCK(&dccpbinfo); | | 279 | INP_INFO_RLOCK(&dccpbinfo); |
280 | in6p = sotoin6pcb(so); | | 280 | in6p = sotoin6pcb(so); |
281 | if (in6p == 0) { | | 281 | if (in6p == 0) { |
282 | INP_INFO_RUNLOCK(&dccpbinfo); | | 282 | INP_INFO_RUNLOCK(&dccpbinfo); |
283 | return EINVAL; | | 283 | return EINVAL; |
284 | } | | 284 | } |