ip_input.c (133557) | ip_input.c (133720) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 |
30 * $FreeBSD: head/sys/netinet/ip_input.c 133557 2004-08-12 08:37:42Z andre $ | 30 * $FreeBSD: head/sys/netinet/ip_input.c 133720 2004-08-14 15:32:40Z dwmalone $ |
31 */ 32 33#include "opt_bootp.h" 34#include "opt_ipfw.h" 35#include "opt_ipdn.h" 36#include "opt_ipdivert.h" 37#include "opt_ipfilter.h" 38#include "opt_ipstealth.h" 39#include "opt_ipsec.h" 40#include "opt_mac.h" 41#include "opt_pfil_hooks.h" | 31 */ 32 33#include "opt_bootp.h" 34#include "opt_ipfw.h" 35#include "opt_ipdn.h" 36#include "opt_ipdivert.h" 37#include "opt_ipfilter.h" 38#include "opt_ipstealth.h" 39#include "opt_ipsec.h" 40#include "opt_mac.h" 41#include "opt_pfil_hooks.h" |
42#include "opt_random_ip_id.h" | |
43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/mac.h> 47#include <sys/mbuf.h> 48#include <sys/malloc.h> 49#include <sys/domain.h> 50#include <sys/protosw.h> --- 79 unchanged lines hidden (view full) --- 130 &maxfragsperpacket, 0, 131 "Maximum number of IPv4 fragments allowed per packet"); 132 133static int ip_sendsourcequench = 0; 134SYSCTL_INT(_net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_RW, 135 &ip_sendsourcequench, 0, 136 "Enable the transmission of source quench packets"); 137 | 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/mac.h> 46#include <sys/mbuf.h> 47#include <sys/malloc.h> 48#include <sys/domain.h> 49#include <sys/protosw.h> --- 79 unchanged lines hidden (view full) --- 129 &maxfragsperpacket, 0, 130 "Maximum number of IPv4 fragments allowed per packet"); 131 132static int ip_sendsourcequench = 0; 133SYSCTL_INT(_net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_RW, 134 &ip_sendsourcequench, 0, 135 "Enable the transmission of source quench packets"); 136 |
137int ip_do_randomid = 0; 138SYSCTL_INT(_net_inet_ip, OID_AUTO, random_id, CTLFLAG_RW, 139 &ip_do_randomid, 0, 140 "Assign random ip_id values"); 141 |
|
138/* 139 * XXX - Setting ip_checkinterface mostly implements the receive side of 140 * the Strong ES model described in RFC 1122, but since the routing table 141 * and transmit implementation do not implement the Strong ES model, 142 * setting this to 1 results in an odd hybrid. 143 * 144 * XXX - ip_checkinterface currently must be disabled if you use ipnat 145 * to translate the destination address to another local interface. --- 130 unchanged lines hidden (view full) --- 276 277 IPQ_LOCK_INIT(); 278 for (i = 0; i < IPREASS_NHASH; i++) 279 TAILQ_INIT(&ipq[i]); 280 281 maxnipq = nmbclusters / 32; 282 maxfragsperpacket = 16; 283 | 142/* 143 * XXX - Setting ip_checkinterface mostly implements the receive side of 144 * the Strong ES model described in RFC 1122, but since the routing table 145 * and transmit implementation do not implement the Strong ES model, 146 * setting this to 1 results in an odd hybrid. 147 * 148 * XXX - ip_checkinterface currently must be disabled if you use ipnat 149 * to translate the destination address to another local interface. --- 130 unchanged lines hidden (view full) --- 280 281 IPQ_LOCK_INIT(); 282 for (i = 0; i < IPREASS_NHASH; i++) 283 TAILQ_INIT(&ipq[i]); 284 285 maxnipq = nmbclusters / 32; 286 maxfragsperpacket = 16; 287 |
284#ifndef RANDOM_IP_ID | |
285 ip_id = time_second & 0xffff; | 288 ip_id = time_second & 0xffff; |
286#endif | |
287 ipintrq.ifq_maxlen = ipqmaxlen; 288 mtx_init(&ipintrq.ifq_mtx, "ip_inq", NULL, MTX_DEF); 289 netisr_register(NETISR_IP, ip_input, &ipintrq, NETISR_MPSAFE); 290} 291 292/* 293 * Ip input routine. Checksum and byte swap header. If fragmented 294 * try to reassemble. Process options. Pass to next level. --- 1890 unchanged lines hidden --- | 289 ipintrq.ifq_maxlen = ipqmaxlen; 290 mtx_init(&ipintrq.ifq_mtx, "ip_inq", NULL, MTX_DEF); 291 netisr_register(NETISR_IP, ip_input, &ipintrq, NETISR_MPSAFE); 292} 293 294/* 295 * Ip input routine. Checksum and byte swap header. If fragmented 296 * try to reassemble. Process options. Pass to next level. --- 1890 unchanged lines hidden --- |