]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: do_setsockopt: make ip_mreq_source local to the place where it is used
authorMichael Tokarev <mjt@tls.msk.ru>
Sun, 31 Mar 2024 10:07:36 +0000 (13:07 +0300)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 24 Apr 2024 22:46:00 +0000 (15:46 -0700)
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>
linux-user/syscall.c

index cca9cafe4f34168dfb668bb7dabd648f548d2219..1fedf16650fa441ecfc88c99762597c1cb888100 100644 (file)
@@ -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;
         }