mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Use the protocol family constants for the domain argument validation.
Return immediately when the socket() failed. Approved by: kib (mentor) MFC after: 1 month
This commit is contained in:
parent
d4dd69c46c
commit
6994ea543f
1 changed files with 5 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue