udp6_usrreq.c (102131) | udp6_usrreq.c (105199) |
---|---|
1/* $FreeBSD: head/sys/netinet6/udp6_usrreq.c 102131 2002-08-19 19:47:13Z jmallett $ */ | 1/* $FreeBSD: head/sys/netinet6/udp6_usrreq.c 105199 2002-10-16 02:25:05Z sam $ */ |
2/* $KAME: udp6_usrreq.c,v 1.27 2001/05/21 05:45:10 jinmei Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 94 unchanged lines hidden (view full) --- 104#include <netinet6/in6_pcb.h> 105#include <netinet6/udp6_var.h> 106 107#ifdef IPSEC 108#include <netinet6/ipsec.h> 109#include <netinet6/ipsec6.h> 110#endif /* IPSEC */ 111 | 2/* $KAME: udp6_usrreq.c,v 1.27 2001/05/21 05:45:10 jinmei Exp $ */ 3 4/* 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions --- 94 unchanged lines hidden (view full) --- 104#include <netinet6/in6_pcb.h> 105#include <netinet6/udp6_var.h> 106 107#ifdef IPSEC 108#include <netinet6/ipsec.h> 109#include <netinet6/ipsec6.h> 110#endif /* IPSEC */ 111 |
112#ifdef FAST_IPSEC 113#include <netipsec/ipsec.h> 114#include <netipsec/ipsec6.h> 115#endif /* FAST_IPSEC */ 116 |
|
112/* 113 * UDP protocol inplementation. 114 * Per RFC 768, August, 1980. 115 */ 116 117extern struct protosw inetsw[]; 118static int in6_mcmatch __P((struct inpcb *, struct in6_addr *, struct ifnet *)); 119static int udp6_detach __P((struct socket *so)); --- 136 unchanged lines hidden (view full) --- 256 /* 257 * Check AH/ESP integrity. 258 */ 259 if (ipsec6_in_reject_so(m, last->inp_socket)) 260 ipsec6stat.in_polvio++; 261 /* do not inject data into pcb */ 262 else 263#endif /* IPSEC */ | 117/* 118 * UDP protocol inplementation. 119 * Per RFC 768, August, 1980. 120 */ 121 122extern struct protosw inetsw[]; 123static int in6_mcmatch __P((struct inpcb *, struct in6_addr *, struct ifnet *)); 124static int udp6_detach __P((struct socket *so)); --- 136 unchanged lines hidden (view full) --- 261 /* 262 * Check AH/ESP integrity. 263 */ 264 if (ipsec6_in_reject_so(m, last->inp_socket)) 265 ipsec6stat.in_polvio++; 266 /* do not inject data into pcb */ 267 else 268#endif /* IPSEC */ |
269#ifdef FAST_IPSEC 270 /* 271 * Check AH/ESP integrity. 272 */ 273 if (ipsec6_in_reject(m, last)) 274 ; 275 else 276#endif /* FAST_IPSEC */ |
|
264 if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { 265 /* 266 * KAME NOTE: do not 267 * m_copy(m, offset, ...) above. 268 * sbappendaddr() expects M_PKTHDR, 269 * and m_copy() will copy M_PKTHDR 270 * only if offset is 0. 271 */ --- 43 unchanged lines hidden (view full) --- 315 /* 316 * Check AH/ESP integrity. 317 */ 318 if (ipsec6_in_reject_so(m, last->inp_socket)) { 319 ipsec6stat.in_polvio++; 320 goto bad; 321 } 322#endif /* IPSEC */ | 277 if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { 278 /* 279 * KAME NOTE: do not 280 * m_copy(m, offset, ...) above. 281 * sbappendaddr() expects M_PKTHDR, 282 * and m_copy() will copy M_PKTHDR 283 * only if offset is 0. 284 */ --- 43 unchanged lines hidden (view full) --- 328 /* 329 * Check AH/ESP integrity. 330 */ 331 if (ipsec6_in_reject_so(m, last->inp_socket)) { 332 ipsec6stat.in_polvio++; 333 goto bad; 334 } 335#endif /* IPSEC */ |
336#ifdef FAST_IPSEC 337 /* 338 * Check AH/ESP integrity. 339 */ 340 if (ipsec6_in_reject(m, last)) { 341 goto bad; 342 } 343#endif /* FAST_IPSEC */ |
|
323 if (last->in6p_flags & IN6P_CONTROLOPTS 324 || last->in6p_socket->so_options & SO_TIMESTAMP) 325 ip6_savecontrol(last, &opts, ip6, m); 326 327 m_adj(m, off + sizeof(struct udphdr)); 328 if (sbappendaddr(&last->in6p_socket->so_rcv, 329 (struct sockaddr *)&udp_in6, 330 m, opts) == 0) { --- 32 unchanged lines hidden (view full) --- 363 /* 364 * Check AH/ESP integrity. 365 */ 366 if (ipsec6_in_reject_so(m, in6p->in6p_socket)) { 367 ipsec6stat.in_polvio++; 368 goto bad; 369 } 370#endif /* IPSEC */ | 344 if (last->in6p_flags & IN6P_CONTROLOPTS 345 || last->in6p_socket->so_options & SO_TIMESTAMP) 346 ip6_savecontrol(last, &opts, ip6, m); 347 348 m_adj(m, off + sizeof(struct udphdr)); 349 if (sbappendaddr(&last->in6p_socket->so_rcv, 350 (struct sockaddr *)&udp_in6, 351 m, opts) == 0) { --- 32 unchanged lines hidden (view full) --- 384 /* 385 * Check AH/ESP integrity. 386 */ 387 if (ipsec6_in_reject_so(m, in6p->in6p_socket)) { 388 ipsec6stat.in_polvio++; 389 goto bad; 390 } 391#endif /* IPSEC */ |
392#ifdef FAST_IPSEC 393 /* 394 * Check AH/ESP integrity. 395 */ 396 if (ipsec6_in_reject(m, in6p)) { 397 goto bad; 398 } 399#endif /* FAST_IPSEC */ |
|
371 372 /* 373 * Construct sockaddr format source address. 374 * Stuff source address and datagram in user buffer. 375 */ 376 init_sin6(&udp_in6, m); /* general init */ 377 udp_in6.sin6_port = uh->uh_sport; 378 if (in6p->in6p_flags & IN6P_CONTROLOPTS --- 365 unchanged lines hidden --- | 400 401 /* 402 * Construct sockaddr format source address. 403 * Stuff source address and datagram in user buffer. 404 */ 405 init_sin6(&udp_in6, m); /* general init */ 406 udp_in6.sin6_port = uh->uh_sport; 407 if (in6p->in6p_flags & IN6P_CONTROLOPTS --- 365 unchanged lines hidden --- |