svn commit: r194282 - in stable/7/sys: . compat/linux contrib/pf
dev/ath/ath_hal
Dmitry Chagin
dchagin at FreeBSD.org
Tue Jun 16 05:07:35 UTC 2009
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
More information about the svn-src-stable-7
mailing list