Skip to content

Commit

Permalink
linux-user: do_setsockopt: make ip_mreq_source local to the place whe…
Browse files Browse the repository at this point in the history
…re 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>
  • Loading branch information
Michael Tokarev authored and rth7680 committed Apr 24, 2024
1 parent 124a134 commit 166bd92
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions linux-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down

0 comments on commit 166bd92

Please sign in to comment.