raw_ip.c (133517) | raw_ip.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 * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 | 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 * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 |
30 * $FreeBSD: head/sys/netinet/raw_ip.c 133517 2004-08-11 20:30:08Z andre $ | 30 * $FreeBSD: head/sys/netinet/raw_ip.c 133720 2004-08-14 15:32:40Z dwmalone $ |
31 */ 32 33#include "opt_inet6.h" 34#include "opt_ipsec.h" 35#include "opt_mac.h" | 31 */ 32 33#include "opt_inet6.h" 34#include "opt_ipsec.h" 35#include "opt_mac.h" |
36#include "opt_random_ip_id.h" | |
37 38#include <sys/param.h> 39#include <sys/jail.h> 40#include <sys/kernel.h> 41#include <sys/lock.h> 42#include <sys/mac.h> 43#include <sys/malloc.h> 44#include <sys/mbuf.h> --- 254 unchanged lines hidden (view full) --- 299 && inp->inp_options) 300 || (ip->ip_len > m->m_pkthdr.len) 301 || (ip->ip_len < (ip->ip_hl << 2))) { 302 INP_UNLOCK(inp); 303 m_freem(m); 304 return EINVAL; 305 } 306 if (ip->ip_id == 0) | 36 37#include <sys/param.h> 38#include <sys/jail.h> 39#include <sys/kernel.h> 40#include <sys/lock.h> 41#include <sys/mac.h> 42#include <sys/malloc.h> 43#include <sys/mbuf.h> --- 254 unchanged lines hidden (view full) --- 298 && inp->inp_options) 299 || (ip->ip_len > m->m_pkthdr.len) 300 || (ip->ip_len < (ip->ip_hl << 2))) { 301 INP_UNLOCK(inp); 302 m_freem(m); 303 return EINVAL; 304 } 305 if (ip->ip_id == 0) |
307#ifdef RANDOM_IP_ID 308 ip->ip_id = ip_randomid(); 309#else 310 ip->ip_id = htons(ip_id++); 311#endif | 306 ip->ip_id = ip_newid(); |
312 /* XXX prevent ip_output from overwriting header fields */ 313 flags |= IP_RAWOUTPUT; 314 ipstat.ips_rawout++; 315 } 316 317 if (inp->inp_flags & INP_ONESBCAST) 318 flags |= IP_SENDONES; 319 --- 561 unchanged lines hidden --- | 307 /* XXX prevent ip_output from overwriting header fields */ 308 flags |= IP_RAWOUTPUT; 309 ipstat.ips_rawout++; 310 } 311 312 if (inp->inp_flags & INP_ONESBCAST) 313 flags |= IP_SENDONES; 314 --- 561 unchanged lines hidden --- |