Deleted Added
full compact
raw_ip.c (130281) raw_ip.c (131151)
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 130281 2004-06-09 20:10:38Z ru $
30 * $FreeBSD: head/sys/netinet/raw_ip.c 131151 2004-06-26 19:10:39Z rwatson $
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>

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

155 }
156#endif /*IPSEC || FAST_IPSEC*/
157#ifdef MAC
158 if (!policyfail && mac_check_inpcb_deliver(last, n) != 0)
159 policyfail = 1;
160#endif
161 if (!policyfail) {
162 struct mbuf *opts = NULL;
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>

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

155 }
156#endif /*IPSEC || FAST_IPSEC*/
157#ifdef MAC
158 if (!policyfail && mac_check_inpcb_deliver(last, n) != 0)
159 policyfail = 1;
160#endif
161 if (!policyfail) {
162 struct mbuf *opts = NULL;
163 struct socket *so;
163
164
165 so = last->inp_socket;
164 if ((last->inp_flags & INP_CONTROLOPTS) ||
166 if ((last->inp_flags & INP_CONTROLOPTS) ||
165 (last->inp_socket->so_options & SO_TIMESTAMP))
167 (so->so_options & SO_TIMESTAMP))
166 ip_savecontrol(last, &opts, ip, n);
168 ip_savecontrol(last, &opts, ip, n);
167 if (sbappendaddr(&last->inp_socket->so_rcv,
169 SOCKBUF_LOCK(&so->so_rcv);
170 if (sbappendaddr_locked(&so->so_rcv,
168 (struct sockaddr *)&ripsrc, n, opts) == 0) {
169 /* should notify about lost packet */
170 m_freem(n);
171 if (opts)
172 m_freem(opts);
171 (struct sockaddr *)&ripsrc, n, opts) == 0) {
172 /* should notify about lost packet */
173 m_freem(n);
174 if (opts)
175 m_freem(opts);
176 SOCKBUF_UNLOCK(&so->so_rcv);
173 } else
177 } else
174 sorwakeup(last->inp_socket);
178 sorwakeup_locked(so);
175 } else
176 m_freem(n);
177 return policyfail;
178}
179
180/*
181 * Setup generic address and protocol structures
182 * for raw_input routine, then pass them along with

--- 694 unchanged lines hidden ---
179 } else
180 m_freem(n);
181 return policyfail;
182}
183
184/*
185 * Setup generic address and protocol structures
186 * for raw_input routine, then pass them along with

--- 694 unchanged lines hidden ---