Deleted Added
full compact
raw_ip.c (67893) raw_ip.c (70254)
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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)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

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95
34 * $FreeBSD: head/sys/netinet/raw_ip.c 67893 2000-10-29 16:06:56Z phk $
34 * $FreeBSD: head/sys/netinet/raw_ip.c 70254 2000-12-21 21:44:31Z bmilekic $
35 */
36
37#include "opt_inet6.h"
38#include "opt_ipsec.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

--- 147 unchanged lines hidden (view full) ---

190 * If the user handed us a complete IP packet, use it.
191 * Otherwise, allocate an mbuf for a header and fill it in.
192 */
193 if ((inp->inp_flags & INP_HDRINCL) == 0) {
194 if (m->m_pkthdr.len + sizeof(struct ip) > IP_MAXPACKET) {
195 m_freem(m);
196 return(EMSGSIZE);
197 }
35 */
36
37#include "opt_inet6.h"
38#include "opt_ipsec.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>
42#include <sys/kernel.h>

--- 147 unchanged lines hidden (view full) ---

190 * If the user handed us a complete IP packet, use it.
191 * Otherwise, allocate an mbuf for a header and fill it in.
192 */
193 if ((inp->inp_flags & INP_HDRINCL) == 0) {
194 if (m->m_pkthdr.len + sizeof(struct ip) > IP_MAXPACKET) {
195 m_freem(m);
196 return(EMSGSIZE);
197 }
198 M_PREPEND(m, sizeof(struct ip), M_WAIT);
198 M_PREPEND(m, sizeof(struct ip), M_TRYWAIT);
199 ip = mtod(m, struct ip *);
200 ip->ip_tos = 0;
201 ip->ip_off = 0;
202 ip->ip_p = inp->inp_ip_p;
203 ip->ip_len = m->m_pkthdr.len;
204 ip->ip_src = inp->inp_laddr;
205 ip->ip_dst.s_addr = dst;
206 ip->ip_ttl = MAXTTL;

--- 455 unchanged lines hidden ---
199 ip = mtod(m, struct ip *);
200 ip->ip_tos = 0;
201 ip->ip_off = 0;
202 ip->ip_p = inp->inp_ip_p;
203 ip->ip_len = m->m_pkthdr.len;
204 ip->ip_src = inp->inp_laddr;
205 ip->ip_dst.s_addr = dst;
206 ip->ip_ttl = MAXTTL;

--- 455 unchanged lines hidden ---