aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2020-03-17 17:00:07 +0100
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-03-17 17:00:18 +0100
commiteb200b428b15f24e636a65ee314e1dd10611971f (patch)
treedab1d32b8f1779c5af3c0e24fd2dc93fda298908
parenta76398b6e1dbc17a096f28606593693ca319dd71 (diff)
downloadslirp-eb200b428b15f24e636a65ee314e1dd10611971f.zip
slirp-eb200b428b15f24e636a65ee314e1dd10611971f.tar.gz
slirp-eb200b428b15f24e636a65ee314e1dd10611971f.tar.bz2
Revert "socket: remove need for extra scope_id variable"
Oops, it turns out the variable is there for portability reasons. This reverts commit d65f3030a82743bf506b0611a6a1a0358ea5d52b. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r--src/socket.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c
index 6ad9c30..4cd9a64 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -840,7 +840,12 @@ static bool sotranslate_out4(Slirp *s, struct socket *so, struct sockaddr_in *si
static bool sotranslate_out6(Slirp *s, struct socket *so, struct sockaddr_in6 *sin)
{
if (in6_equal(&so->so_faddr6, &s->vnameserver_addr6)) {
- return get_dns6_addr(&sin->sin6_addr, &sin->sin6_scope_id) >= 0;
+ uint32_t scope_id;
+ if (get_dns6_addr(&sin->sin6_addr, &scope_id) >= 0) {
+ sin->sin6_scope_id = scope_id;
+ return true;
+ }
+ return false;
}
if (in6_equal_net(&so->so_faddr6, &s->vprefix_addr6, s->vprefix_len) ||