| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ip_input.c,v 1.275.4.1.8.1 2011/01/07 03:16:14 matt Exp $ */ | | 1 | /* $NetBSD: ip_input.c,v 1.275.4.1.8.2 2011/01/07 03:17:44 matt 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 | * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 | | 90 | * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 |
91 | */ | | 91 | */ |
92 | | | 92 | |
93 | #include <sys/cdefs.h> | | 93 | #include <sys/cdefs.h> |
94 | __KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.275.4.1.8.1 2011/01/07 03:16:14 matt Exp $"); | | 94 | __KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.275.4.1.8.2 2011/01/07 03:17:44 matt Exp $"); |
95 | | | 95 | |
96 | #include "opt_inet.h" | | 96 | #include "opt_inet.h" |
97 | #include "opt_gateway.h" | | 97 | #include "opt_gateway.h" |
98 | #include "opt_pfil_hooks.h" | | 98 | #include "opt_pfil_hooks.h" |
99 | #include "opt_ipsec.h" | | 99 | #include "opt_ipsec.h" |
100 | #include "opt_mrouting.h" | | 100 | #include "opt_mrouting.h" |
101 | #include "opt_mbuftrace.h" | | 101 | #include "opt_mbuftrace.h" |
102 | #include "opt_inet_csum.h" | | 102 | #include "opt_inet_csum.h" |
103 | | | 103 | |
104 | #include <sys/param.h> | | 104 | #include <sys/param.h> |
105 | #include <sys/systm.h> | | 105 | #include <sys/systm.h> |
106 | #include <sys/malloc.h> | | 106 | #include <sys/malloc.h> |
107 | #include <sys/mbuf.h> | | 107 | #include <sys/mbuf.h> |
| @@ -463,29 +463,27 @@ void | | | @@ -463,29 +463,27 @@ void |
463 | ipintr(void) | | 463 | ipintr(void) |
464 | { | | 464 | { |
465 | int s; | | 465 | int s; |
466 | struct mbuf *m; | | 466 | struct mbuf *m; |
467 | | | 467 | |
468 | mutex_enter(softnet_lock); | | 468 | mutex_enter(softnet_lock); |
469 | KERNEL_LOCK(1, NULL); | | 469 | KERNEL_LOCK(1, NULL); |
470 | while (!IF_IS_EMPTY(&ipintrq)) { | | 470 | while (!IF_IS_EMPTY(&ipintrq)) { |
471 | s = splnet(); | | 471 | s = splnet(); |
472 | IF_DEQUEUE(&ipintrq, m); | | 472 | IF_DEQUEUE(&ipintrq, m); |
473 | splx(s); | | 473 | splx(s); |
474 | if (m == NULL) | | 474 | if (m == NULL) |
475 | break; | | 475 | break; |
476 | KERNEL_UNLOCK_ONE(NULL); | | | |
477 | ip_input(m); | | 476 | ip_input(m); |
478 | KERNEL_LOCK(1, NULL); | | | |
479 | } | | 477 | } |
480 | KERNEL_UNLOCK_ONE(NULL); | | 478 | KERNEL_UNLOCK_ONE(NULL); |
481 | mutex_exit(softnet_lock); | | 479 | mutex_exit(softnet_lock); |
482 | } | | 480 | } |
483 | | | 481 | |
484 | /* | | 482 | /* |
485 | * Ip input routine. Checksum and byte swap header. If fragmented | | 483 | * Ip input routine. Checksum and byte swap header. If fragmented |
486 | * try to reassemble. Process options. Pass to next level. | | 484 | * try to reassemble. Process options. Pass to next level. |
487 | */ | | 485 | */ |
488 | void | | 486 | void |
489 | ip_input(struct mbuf *m) | | 487 | ip_input(struct mbuf *m) |
490 | { | | 488 | { |
491 | struct ip *ip = NULL; | | 489 | struct ip *ip = NULL; |