Skip to contentSkip to conversation

linux-user: Return correct errno for unsupported netlink socket

PATCH In review Ed Swierk 2 participants 2 messages May 6, 2014 – May 9, 2014

lore
Share & tools
lore

Ed Swierk

author
#0 lore raw

PATCH 1/1 linux-user: Return correct errno for unsupported netlink socket

This fixes "Cannot open audit interface - aborting." when the EAFNOSUPPORT errno differs between the target and host architectures (e.g. mips target and x86_64 host).

---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/syscall.c +1 -1
index 9864813..271d28a 100644
@@ -1861,7 +1861,7 @@ static abi_long do_socket(int domain, int type, int protocol)
     }
 
     if (domain == PF_NETLINK)
-        return -EAFNOSUPPORT; /* do not NETLINK socket connections possible */
+        return -TARGET_EAFNOSUPPORT;
     ret = get_errno(socket(domain, type, protocol));
     if (ret >= 0) {
         ret = sock_flags_fixup(ret, target_type);
Signature · 1 line
1.8.3.2
#1 lore raw

Hi,

Quoted 3 lines · Ed Swierk

This fixes "Cannot open audit interface - aborting." when the EAFNOSUPPORT errno differs between the target and host architectures (e.g. mips target and x86_64 host).

Thanks, looks good - applied to linux-user tree.

Quoted 21 lines
---
 linux-user/syscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
linux-user/syscall.c +1 -1
index 9864813..271d28a 100644
@@ -1861,7 +1861,7 @@ static abi_long do_socket(int domain, int type, int protocol)
     }
 
     if (domain == PF_NETLINK)
-        return -EAFNOSUPPORT; /* do not NETLINK socket connections possible */
+        return -TARGET_EAFNOSUPPORT;
     ret = get_errno(socket(domain, type, protocol));
     if (ret >= 0) {
         ret = sock_flags_fixup(ret, target_type);
Signature · 1 line
1.8.3.2