raw_ip6.c (105194) | raw_ip6.c (105199) |
---|---|
1/* 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * 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 --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 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 * | 1/* 2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 3 * 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 --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 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 * $FreeBSD: head/sys/netinet6/raw_ip6.c 105194 2002-10-16 01:54:46Z sam $ | 29 * $FreeBSD: head/sys/netinet6/raw_ip6.c 105199 2002-10-16 02:25:05Z sam $ |
30 */ 31 32/* 33 * Copyright (c) 1982, 1986, 1988, 1993 34 * The Regents of the University of California. All rights reserved. 35 * 36 * Redistribution and use in source and binary forms, with or without 37 * modification, are permitted provided that the following conditions --- 62 unchanged lines hidden (view full) --- 100#include <netinet6/scope6_var.h> 101#endif 102 103#ifdef IPSEC 104#include <netinet6/ipsec.h> 105#include <netinet6/ipsec6.h> 106#endif /*IPSEC*/ 107 | 30 */ 31 32/* 33 * Copyright (c) 1982, 1986, 1988, 1993 34 * The Regents of the University of California. All rights reserved. 35 * 36 * Redistribution and use in source and binary forms, with or without 37 * modification, are permitted provided that the following conditions --- 62 unchanged lines hidden (view full) --- 100#include <netinet6/scope6_var.h> 101#endif 102 103#ifdef IPSEC 104#include <netinet6/ipsec.h> 105#include <netinet6/ipsec6.h> 106#endif /*IPSEC*/ 107 |
108#ifdef FAST_IPSEC 109#include <netipsec/ipsec.h> 110#include <netipsec/ipsec6.h> 111#endif /* FAST_IPSEC */ 112 |
|
108#include <machine/stdarg.h> 109 110#define satosin6(sa) ((struct sockaddr_in6 *)(sa)) 111#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) 112 113/* 114 * Raw interface to IP6 protocol. 115 */ --- 60 unchanged lines hidden (view full) --- 176 * Check AH/ESP integrity. 177 */ 178 if (n && ipsec6_in_reject_so(n, last->inp_socket)) { 179 m_freem(n); 180 ipsec6stat.in_polvio++; 181 /* do not inject data into pcb */ 182 } else 183#endif /*IPSEC*/ | 113#include <machine/stdarg.h> 114 115#define satosin6(sa) ((struct sockaddr_in6 *)(sa)) 116#define ifatoia6(ifa) ((struct in6_ifaddr *)(ifa)) 117 118/* 119 * Raw interface to IP6 protocol. 120 */ --- 60 unchanged lines hidden (view full) --- 181 * Check AH/ESP integrity. 182 */ 183 if (n && ipsec6_in_reject_so(n, last->inp_socket)) { 184 m_freem(n); 185 ipsec6stat.in_polvio++; 186 /* do not inject data into pcb */ 187 } else 188#endif /*IPSEC*/ |
189#ifdef FAST_IPSEC 190 /* 191 * Check AH/ESP integrity. 192 */ 193 if (n && ipsec6_in_reject(n, last)) { 194 m_freem(n); 195 /* do not inject data into pcb */ 196 } else 197#endif /*FAST_IPSEC*/ |
|
184 if (n) { 185 if (last->in6p_flags & IN6P_CONTROLOPTS || 186 last->in6p_socket->so_options & SO_TIMESTAMP) 187 ip6_savecontrol(last, &opts, ip6, n); 188 /* strip intermediate headers */ 189 m_adj(n, *offp); 190 if (sbappendaddr(&last->in6p_socket->so_rcv, 191 (struct sockaddr *)&rip6src, --- 15 unchanged lines hidden (view full) --- 207 */ 208 if (last && ipsec6_in_reject_so(m, last->inp_socket)) { 209 m_freem(m); 210 ipsec6stat.in_polvio++; 211 ip6stat.ip6s_delivered--; 212 /* do not inject data into pcb */ 213 } else 214#endif /*IPSEC*/ | 198 if (n) { 199 if (last->in6p_flags & IN6P_CONTROLOPTS || 200 last->in6p_socket->so_options & SO_TIMESTAMP) 201 ip6_savecontrol(last, &opts, ip6, n); 202 /* strip intermediate headers */ 203 m_adj(n, *offp); 204 if (sbappendaddr(&last->in6p_socket->so_rcv, 205 (struct sockaddr *)&rip6src, --- 15 unchanged lines hidden (view full) --- 221 */ 222 if (last && ipsec6_in_reject_so(m, last->inp_socket)) { 223 m_freem(m); 224 ipsec6stat.in_polvio++; 225 ip6stat.ip6s_delivered--; 226 /* do not inject data into pcb */ 227 } else 228#endif /*IPSEC*/ |
229#ifdef FAST_IPSEC 230 /* 231 * Check AH/ESP integrity. 232 */ 233 if (last && ipsec6_in_reject(m, last)) { 234 m_freem(m); 235 ip6stat.ip6s_delivered--; 236 /* do not inject data into pcb */ 237 } else 238#endif /*FAST_IPSEC*/ |
|
215 if (last) { 216 if (last->in6p_flags & IN6P_CONTROLOPTS || 217 last->in6p_socket->so_options & SO_TIMESTAMP) 218 ip6_savecontrol(last, &opts, ip6, m); 219 /* strip intermediate headers */ 220 m_adj(m, *offp); 221 if (sbappendaddr(&last->in6p_socket->so_rcv, 222 (struct sockaddr *)&rip6src, m, opts) == 0) { --- 497 unchanged lines hidden --- | 239 if (last) { 240 if (last->in6p_flags & IN6P_CONTROLOPTS || 241 last->in6p_socket->so_options & SO_TIMESTAMP) 242 ip6_savecontrol(last, &opts, ip6, m); 243 /* strip intermediate headers */ 244 m_adj(m, *offp); 245 if (sbappendaddr(&last->in6p_socket->so_rcv, 246 (struct sockaddr *)&rip6src, m, opts) == 0) { --- 497 unchanged lines hidden --- |