diff options
| author | Dmitry Chagin <dchagin@FreeBSD.org> | 2009-05-16 18:44:56 +0000 |
|---|---|---|
| committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2009-05-16 18:44:56 +0000 |
| commit | 6994ea543f06af0c76234dae538e8d9759735e12 (patch) | |
| tree | a696c0ff573fda52b07dbce27dcf15940352e0b4 /sys/compat/linux/linux_socket.c | |
| parent | d4dd69c46cf0a3513b5ae06bd7f3e579574985d3 (diff) | |
Notes
Diffstat (limited to 'sys/compat/linux/linux_socket.c')
| -rw-r--r-- | sys/compat/linux/linux_socket.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index da7d82905d66..ee7bf184ad05 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -602,10 +602,12 @@ linux_socket(struct thread *td, struct linux_socket_args *args) 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; @@ -620,7 +622,7 @@ linux_socket(struct thread *td, struct linux_socket_args *args) * 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 |
