udp6_usrreq.c (185370) | udp6_usrreq.c (185435) |
---|---|
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 --- 49 unchanged lines hidden (view full) --- 58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 60 * SUCH DAMAGE. 61 * 62 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 63 */ 64 65#include <sys/cdefs.h> | 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 --- 49 unchanged lines hidden (view full) --- 58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 60 * SUCH DAMAGE. 61 * 62 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95 63 */ 64 65#include <sys/cdefs.h> |
66__FBSDID("$FreeBSD: head/sys/netinet6/udp6_usrreq.c 185370 2008-11-27 12:04:35Z bz $"); | 66__FBSDID("$FreeBSD: head/sys/netinet6/udp6_usrreq.c 185435 2008-11-29 14:32:14Z bz $"); |
67 68#include "opt_inet.h" 69#include "opt_inet6.h" 70#include "opt_ipsec.h" 71#include "opt_mac.h" 72 73#include <sys/param.h> | 67 68#include "opt_inet.h" 69#include "opt_inet6.h" 70#include "opt_ipsec.h" 71#include "opt_mac.h" 72 73#include <sys/param.h> |
74#include <sys/jail.h> |
|
74#include <sys/kernel.h> 75#include <sys/lock.h> 76#include <sys/mbuf.h> 77#include <sys/priv.h> 78#include <sys/proc.h> 79#include <sys/protosw.h> 80#include <sys/signalvar.h> 81#include <sys/socket.h> --- 773 unchanged lines hidden (view full) --- 855 if (IN6_IS_ADDR_V4MAPPED(&sin6_p->sin6_addr)) { 856 struct sockaddr_in sin; 857 858 if (inp->inp_faddr.s_addr != INADDR_ANY) { 859 error = EISCONN; 860 goto out; 861 } 862 in6_sin6_2_sin(&sin, sin6_p); | 75#include <sys/kernel.h> 76#include <sys/lock.h> 77#include <sys/mbuf.h> 78#include <sys/priv.h> 79#include <sys/proc.h> 80#include <sys/protosw.h> 81#include <sys/signalvar.h> 82#include <sys/socket.h> --- 773 unchanged lines hidden (view full) --- 856 if (IN6_IS_ADDR_V4MAPPED(&sin6_p->sin6_addr)) { 857 struct sockaddr_in sin; 858 859 if (inp->inp_faddr.s_addr != INADDR_ANY) { 860 error = EISCONN; 861 goto out; 862 } 863 in6_sin6_2_sin(&sin, sin6_p); |
864 if (td && jailed(td->td_ucred)) 865 if (prison_remote_ip4(td->td_ucred, 866 &sin.sin_addr) != 0) { 867 error = EAFNOSUPPORT; 868 goto out; 869 } |
|
863 error = in_pcbconnect(inp, (struct sockaddr *)&sin, 864 td->td_ucred); 865 if (error == 0) { 866 inp->inp_vflag |= INP_IPV4; 867 inp->inp_vflag &= ~INP_IPV6; 868 soisconnected(so); 869 } 870 goto out; 871 } 872 } 873 if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { 874 error = EISCONN; 875 goto out; 876 } | 870 error = in_pcbconnect(inp, (struct sockaddr *)&sin, 871 td->td_ucred); 872 if (error == 0) { 873 inp->inp_vflag |= INP_IPV4; 874 inp->inp_vflag &= ~INP_IPV6; 875 soisconnected(so); 876 } 877 goto out; 878 } 879 } 880 if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) { 881 error = EISCONN; 882 goto out; 883 } |
884 if (td && jailed(td->td_ucred)) { 885 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)nam; 886 if (prison_remote_ip6(td->td_ucred, &sin6->sin6_addr) != 0) { 887 error = EAFNOSUPPORT; 888 goto out; 889 } 890 } |
|
877 error = in6_pcbconnect(inp, nam, td->td_ucred); 878 if (error == 0) { 879 if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) { 880 /* should be non mapped addr */ 881 inp->inp_vflag &= ~INP_IPV4; 882 inp->inp_vflag |= INP_IPV6; 883 } 884 soisconnected(so); --- 165 unchanged lines hidden --- | 891 error = in6_pcbconnect(inp, nam, td->td_ucred); 892 if (error == 0) { 893 if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0) { 894 /* should be non mapped addr */ 895 inp->inp_vflag &= ~INP_IPV4; 896 inp->inp_vflag |= INP_IPV6; 897 } 898 soisconnected(so); --- 165 unchanged lines hidden --- |