diff mbox

linux-user/syscall.c: Use SOL_SOCKET instead of level for setsockopt()

Message ID 1452491930-10210-1-git-send-email-chengang@emindsoft.com.cn
State New
Headers show

Commit Message

Chen Gang Jan. 11, 2016, 5:58 a.m. UTC
From: Chen Gang <chengang@emindsoft.com.cn>

In this case, level is TARGET_SOL_SOCKET, but we need SOL_SOCKET for
setsockopt().

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 linux-user/syscall.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Laurent Vivier Jan. 11, 2016, 7:52 a.m. UTC | #1
Le 11/01/2016 06:58, chengang@emindsoft.com.cn a écrit :
> From: Chen Gang <chengang@emindsoft.com.cn>
> 
> In this case, level is TARGET_SOL_SOCKET, but we need SOL_SOCKET for
> setsockopt().
> 
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>  linux-user/syscall.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 95b1762..44485f2 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -1596,7 +1596,8 @@ set_timeout:
>  		addr_ifname = alloca(IFNAMSIZ);
>  		memcpy(addr_ifname, dev_ifname, optlen);
>  		addr_ifname[optlen] = 0;
> -		ret = get_errno(setsockopt(sockfd, level, optname, addr_ifname, optlen));
> +		ret = get_errno(setsockopt(sockfd, SOL_SOCKET, optname,
> +                                           addr_ifname, optlen));
>  		unlock_user (dev_ifname, optval_addr, 0);
>  		return ret;
>  	}
> 
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
diff mbox

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 95b1762..44485f2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1596,7 +1596,8 @@  set_timeout:
 		addr_ifname = alloca(IFNAMSIZ);
 		memcpy(addr_ifname, dev_ifname, optlen);
 		addr_ifname[optlen] = 0;
-		ret = get_errno(setsockopt(sockfd, level, optname, addr_ifname, optlen));
+		ret = get_errno(setsockopt(sockfd, SOL_SOCKET, optname,
+                                           addr_ifname, optlen));
 		unlock_user (dev_ifname, optval_addr, 0);
 		return ret;
 	}