Date: Tue, 16 Jun 2009 05:07:34 +0000 (UTC) From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r194282 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal Message-ID: <200906160507.n5G57YF8012799@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dchagin Date: Tue Jun 16 05:07:34 2009 New Revision: 194282 URL: http://svn.freebsd.org/changeset/base/194282 Log: MFC r192204: Use the protocol family constants for the domain argument validation. Return immediately when the socket() failed. Approved by: kib (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_socket.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/compat/linux/linux_socket.c ============================================================================== --- stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 05:05:46 2009 (r194281) +++ stable/7/sys/compat/linux/linux_socket.c Tue Jun 16 05:07:34 2009 (r194282) @@ -559,10 +559,12 @@ linux_socket(struct thread *td, struct l return (EAFNOSUPPORT); retval_socket = socket(td, &bsd_args); + if (retval_socket) + return (retval_socket); + if (bsd_args.type == SOCK_RAW && (bsd_args.protocol == IPPROTO_RAW || bsd_args.protocol == 0) - && bsd_args.domain == AF_INET - && retval_socket >= 0) { + && bsd_args.domain == PF_INET) { /* It's a raw IP socket: set the IP_HDRINCL option. */ int hdrincl; @@ -577,7 +579,7 @@ linux_socket(struct thread *td, struct l * default and some apps depend on this. So, set V6ONLY to 0 * for Linux apps if the sysctl value is set to 1. */ - if (bsd_args.domain == PF_INET6 && retval_socket >= 0 + if (bsd_args.domain == PF_INET6 #ifndef KLD_MODULE /* * XXX: Avoid undefined symbol error with an IPv4 only
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906160507.n5G57YF8012799>