diff options
author | Michael Tokarev <mjt@tls.msk.ru> | 2024-03-31 13:07:36 +0300 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-04-24 15:46:00 -0700 |
commit | 166bd92e3b4dfcd058013453e4dd94ebe5e87819 (patch) | |
tree | c1a25beda3b2ff63c7f56e9ad144e8626a5c8768 /linux-user | |
parent | 124a1341a66287ab8f4ce3de3c98eed6747a639f (diff) | |
download | qemu-166bd92e3b4dfcd058013453e4dd94ebe5e87819.zip qemu-166bd92e3b4dfcd058013453e4dd94ebe5e87819.tar.gz qemu-166bd92e3b4dfcd058013453e4dd94ebe5e87819.tar.bz2 |
linux-user: do_setsockopt: make ip_mreq_source local to the place where it is used
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Message-Id: <20240331100737.2724186-4-mjt@tls.msk.ru>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/syscall.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index cca9caf..1fedf166 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2049,7 +2049,6 @@ static abi_long do_setsockopt(int sockfd, int level, int optname, { abi_long ret; int val; - struct ip_mreq_source *ip_mreq_source; switch(level) { case SOL_TCP: @@ -2123,6 +2122,9 @@ static abi_long do_setsockopt(int sockfd, int level, int optname, case IP_UNBLOCK_SOURCE: case IP_ADD_SOURCE_MEMBERSHIP: case IP_DROP_SOURCE_MEMBERSHIP: + { + struct ip_mreq_source *ip_mreq_source; + if (optlen != sizeof (struct target_ip_mreq_source)) return -TARGET_EINVAL; @@ -2133,7 +2135,7 @@ static abi_long do_setsockopt(int sockfd, int level, int optname, ret = get_errno(setsockopt(sockfd, level, optname, ip_mreq_source, optlen)); unlock_user (ip_mreq_source, optval_addr, 0); break; - + } default: goto unimplemented; } |