udp_usrreq.c (74209) | udp_usrreq.c (78064) |
---|---|
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 --- 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 * @(#)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 --- 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 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 |
34 * $FreeBSD: head/sys/netinet/udp_usrreq.c 74209 2001-03-13 13:26:06Z ru $ | 34 * $FreeBSD: head/sys/netinet/udp_usrreq.c 78064 2001-06-11 12:39:29Z ume $ |
35 */ 36 37#include "opt_ipsec.h" 38#include "opt_inet6.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> --- 344 unchanged lines hidden (view full) --- 387 savedflags = inp->inp_flags; 388 inp->inp_flags &= ~INP_UNMAPPABLEOPTS; 389 ip6_savecontrol(inp, &opts, &udp_ip6.uip6_ip6, m); 390 inp->inp_flags = savedflags; 391 } else 392#endif 393 ip_savecontrol(inp, &opts, ip, m); 394 } | 35 */ 36 37#include "opt_ipsec.h" 38#include "opt_inet6.h" 39 40#include <sys/param.h> 41#include <sys/systm.h> 42#include <sys/kernel.h> --- 344 unchanged lines hidden (view full) --- 387 savedflags = inp->inp_flags; 388 inp->inp_flags &= ~INP_UNMAPPABLEOPTS; 389 ip6_savecontrol(inp, &opts, &udp_ip6.uip6_ip6, m); 390 inp->inp_flags = savedflags; 391 } else 392#endif 393 ip_savecontrol(inp, &opts, ip, m); 394 } |
395 iphlen += sizeof(struct udphdr); 396 m_adj(m, iphlen); | 395 m_adj(m, iphlen + sizeof(struct udphdr)); |
397#ifdef INET6 398 if (inp->inp_vflag & INP_IPV6) { 399 in6_sin_2_v4mapsin6(&udp_in, &udp_in6.uin6_sin); 400 append_sa = (struct sockaddr *)&udp_in6; 401 } else 402#endif 403 append_sa = (struct sockaddr *)&udp_in; 404 if (sbappendaddr(&inp->inp_socket->so_rcv, append_sa, m, opts) == 0) { --- 334 unchanged lines hidden (view full) --- 739 ui->ui_sum = 0; 740 } 741 ((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len; 742 ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */ 743 ((struct ip *)ui)->ip_tos = inp->inp_ip_tos; /* XXX */ 744 udpstat.udps_opackets++; 745 746#ifdef IPSEC | 396#ifdef INET6 397 if (inp->inp_vflag & INP_IPV6) { 398 in6_sin_2_v4mapsin6(&udp_in, &udp_in6.uin6_sin); 399 append_sa = (struct sockaddr *)&udp_in6; 400 } else 401#endif 402 append_sa = (struct sockaddr *)&udp_in; 403 if (sbappendaddr(&inp->inp_socket->so_rcv, append_sa, m, opts) == 0) { --- 334 unchanged lines hidden (view full) --- 738 ui->ui_sum = 0; 739 } 740 ((struct ip *)ui)->ip_len = sizeof (struct udpiphdr) + len; 741 ((struct ip *)ui)->ip_ttl = inp->inp_ip_ttl; /* XXX */ 742 ((struct ip *)ui)->ip_tos = inp->inp_ip_tos; /* XXX */ 743 udpstat.udps_opackets++; 744 745#ifdef IPSEC |
747 ipsec_setsocket(m, inp->inp_socket); | 746 if (ipsec_setsocket(m, inp->inp_socket) != 0) { 747 error = ENOBUFS; 748 goto release; 749 } |
748#endif /*IPSEC*/ 749 error = ip_output(m, inp->inp_options, &inp->inp_route, 750 (inp->inp_socket->so_options & (SO_DONTROUTE | SO_BROADCAST)), 751 inp->inp_moptions); 752 753 if (addr) { 754 in_pcbdisconnect(inp); 755 inp->inp_laddr = laddr; /* XXX rehash? */ --- 178 unchanged lines hidden --- | 750#endif /*IPSEC*/ 751 error = ip_output(m, inp->inp_options, &inp->inp_route, 752 (inp->inp_socket->so_options & (SO_DONTROUTE | SO_BROADCAST)), 753 inp->inp_moptions); 754 755 if (addr) { 756 in_pcbdisconnect(inp); 757 inp->inp_laddr = laddr; /* XXX rehash? */ --- 178 unchanged lines hidden --- |