| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: tcp_subr.c,v 1.289 2021/07/31 20:29:37 andvar Exp $ */ | | 1 | /* $NetBSD: tcp_subr.c,v 1.290 2022/06/27 01:29:51 knakahara Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | | 4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. |
5 | * All rights reserved. | | 5 | * 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. |
| @@ -81,27 +81,27 @@ | | | @@ -81,27 +81,27 @@ |
81 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 81 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
82 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 82 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
83 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 83 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
84 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 84 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
85 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 85 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
86 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 86 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
87 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 87 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
88 | * SUCH DAMAGE. | | 88 | * SUCH DAMAGE. |
89 | * | | 89 | * |
90 | * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 | | 90 | * @(#)tcp_subr.c 8.2 (Berkeley) 5/24/95 |
91 | */ | | 91 | */ |
92 | | | 92 | |
93 | #include <sys/cdefs.h> | | 93 | #include <sys/cdefs.h> |
94 | __KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.289 2021/07/31 20:29:37 andvar Exp $"); | | 94 | __KERNEL_RCSID(0, "$NetBSD: tcp_subr.c,v 1.290 2022/06/27 01:29:51 knakahara Exp $"); |
95 | | | 95 | |
96 | #ifdef _KERNEL_OPT | | 96 | #ifdef _KERNEL_OPT |
97 | #include "opt_inet.h" | | 97 | #include "opt_inet.h" |
98 | #include "opt_ipsec.h" | | 98 | #include "opt_ipsec.h" |
99 | #include "opt_inet_csum.h" | | 99 | #include "opt_inet_csum.h" |
100 | #include "opt_mbuftrace.h" | | 100 | #include "opt_mbuftrace.h" |
101 | #endif | | 101 | #endif |
102 | | | 102 | |
103 | #include <sys/param.h> | | 103 | #include <sys/param.h> |
104 | #include <sys/atomic.h> | | 104 | #include <sys/atomic.h> |
105 | #include <sys/proc.h> | | 105 | #include <sys/proc.h> |
106 | #include <sys/systm.h> | | 106 | #include <sys/systm.h> |
107 | #include <sys/mbuf.h> | | 107 | #include <sys/mbuf.h> |
| @@ -1287,28 +1287,27 @@ tcp_drain(void) | | | @@ -1287,28 +1287,27 @@ tcp_drain(void) |
1287 | tp = intotcpcb((struct inpcb *)inph); | | 1287 | tp = intotcpcb((struct inpcb *)inph); |
1288 | break; | | 1288 | break; |
1289 | #ifdef INET6 | | 1289 | #ifdef INET6 |
1290 | case AF_INET6: | | 1290 | case AF_INET6: |
1291 | tp = in6totcpcb((struct in6pcb *)inph); | | 1291 | tp = in6totcpcb((struct in6pcb *)inph); |
1292 | break; | | 1292 | break; |
1293 | #endif | | 1293 | #endif |
1294 | default: | | 1294 | default: |
1295 | tp = NULL; | | 1295 | tp = NULL; |
1296 | break; | | 1296 | break; |
1297 | } | | 1297 | } |
1298 | if (tp != NULL) { | | 1298 | if (tp != NULL) { |
1299 | /* | | 1299 | /* |
1300 | * We may be called from a device's interrupt | | 1300 | * If the tcpcb is already busy, |
1301 | * context. If the tcpcb is already busy, | | | |
1302 | * just bail out now. | | 1301 | * just bail out now. |
1303 | */ | | 1302 | */ |
1304 | if (tcp_reass_lock_try(tp) == 0) | | 1303 | if (tcp_reass_lock_try(tp) == 0) |
1305 | continue; | | 1304 | continue; |
1306 | if (tcp_freeq(tp)) | | 1305 | if (tcp_freeq(tp)) |
1307 | TCP_STATINC(TCP_STAT_CONNSDRAINED); | | 1306 | TCP_STATINC(TCP_STAT_CONNSDRAINED); |
1308 | TCP_REASS_UNLOCK(tp); | | 1307 | TCP_REASS_UNLOCK(tp); |
1309 | } | | 1308 | } |
1310 | } | | 1309 | } |
1311 | | | 1310 | |
1312 | KERNEL_UNLOCK_ONE(NULL); | | 1311 | KERNEL_UNLOCK_ONE(NULL); |
1313 | mutex_exit(softnet_lock); | | 1312 | mutex_exit(softnet_lock); |
1314 | } | | 1313 | } |