udp_usrreq.c (130583) | udp_usrreq.c (131151) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 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 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 | 1/* 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1995 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 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 |
30 * $FreeBSD: head/sys/netinet/udp_usrreq.c 130583 2004-06-16 08:50:14Z bms $ | 30 * $FreeBSD: head/sys/netinet/udp_usrreq.c 131151 2004-06-26 19:10:39Z rwatson $ |
31 */ 32 33#include "opt_ipsec.h" 34#include "opt_inet6.h" 35#include "opt_mac.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> --- 403 unchanged lines hidden (view full) --- 442static void 443udp_append(last, ip, n, off) 444 struct inpcb *last; 445 struct ip *ip; 446 struct mbuf *n; 447 int off; 448{ 449 struct sockaddr *append_sa; | 31 */ 32 33#include "opt_ipsec.h" 34#include "opt_inet6.h" 35#include "opt_mac.h" 36 37#include <sys/param.h> 38#include <sys/systm.h> --- 403 unchanged lines hidden (view full) --- 442static void 443udp_append(last, ip, n, off) 444 struct inpcb *last; 445 struct ip *ip; 446 struct mbuf *n; 447 int off; 448{ 449 struct sockaddr *append_sa; |
450 struct socket *so; |
|
450 struct mbuf *opts = 0; 451 452 INP_LOCK_ASSERT(last); 453 454#if defined(IPSEC) || defined(FAST_IPSEC) 455 /* check AH/ESP integrity. */ 456 if (ipsec4_in_reject(n, last)) { 457#ifdef IPSEC --- 33 unchanged lines hidden (view full) --- 491 in6_sin_2_v4mapsin6(&udp_in, &udp_in6.uin6_sin); 492 udp_in6.uin6_init_done = 1; 493 } 494 append_sa = (struct sockaddr *)&udp_in6.uin6_sin; 495 } else 496#endif 497 append_sa = (struct sockaddr *)&udp_in; 498 m_adj(n, off); | 451 struct mbuf *opts = 0; 452 453 INP_LOCK_ASSERT(last); 454 455#if defined(IPSEC) || defined(FAST_IPSEC) 456 /* check AH/ESP integrity. */ 457 if (ipsec4_in_reject(n, last)) { 458#ifdef IPSEC --- 33 unchanged lines hidden (view full) --- 492 in6_sin_2_v4mapsin6(&udp_in, &udp_in6.uin6_sin); 493 udp_in6.uin6_init_done = 1; 494 } 495 append_sa = (struct sockaddr *)&udp_in6.uin6_sin; 496 } else 497#endif 498 append_sa = (struct sockaddr *)&udp_in; 499 m_adj(n, off); |
499 if (sbappendaddr(&last->inp_socket->so_rcv, append_sa, n, opts) == 0) { | 500 501 so = last->inp_socket; 502 SOCKBUF_LOCK(&so->so_rcv); 503 if (sbappendaddr_locked(&so->so_rcv, append_sa, n, opts) == 0) { |
500 m_freem(n); 501 if (opts) 502 m_freem(opts); 503 udpstat.udps_fullsock++; | 504 m_freem(n); 505 if (opts) 506 m_freem(opts); 507 udpstat.udps_fullsock++; |
508 SOCKBUF_UNLOCK(&so->so_rcv); |
|
504 } else | 509 } else |
505 sorwakeup(last->inp_socket); | 510 sorwakeup_locked(so); |
506} 507 508/* 509 * Notify a udp user of an asynchronous error; 510 * just wake up so that he can collect error status. 511 */ 512struct inpcb * 513udp_notify(inp, errno) --- 612 unchanged lines hidden --- | 511} 512 513/* 514 * Notify a udp user of an asynchronous error; 515 * just wake up so that he can collect error status. 516 */ 517struct inpcb * 518udp_notify(inp, errno) --- 612 unchanged lines hidden --- |