Skip to contentSkip to conversation

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

PATCH In review [email protected] 2 participants 2 messages Jan 11, 2016

lore
Share & tools
lore
#0 lore raw

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

From: Chen Gang <[email protected]>

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

---
 linux-user/syscall.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
linux-user/syscall.c +2 -1
index 95b1762..44485f2 100644
@@ -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;
 	}
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Le 11/01/2016 06:58, [email protected] a écrit :

From: Chen Gang <[email protected]>

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

---
 linux-user/syscall.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
linux-user/syscall.c +0 -0
index 95b1762..44485f2 100644

linux-user/syscall.c set_timeout: · line 1603

Quoted 9 lines
linux-user/syscall.c +2 -1
@@ -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;
 	}