aboutsummaryrefslogtreecommitdiff
path: root/slirp/socket.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-03-20 15:16:21 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-07-03 23:29:13 +0200
commitef763fa4bd47892d9949dbaf292b032e2fc16475 (patch)
treeef3d2e2271f1d4c9f1899eff111ab1a48ca8e26b /slirp/socket.c
parent1d17654e762ed1e31bfb16915fd03499c03d2063 (diff)
slirp: Support link-local DNS addresses
They look like fe80::%eth0 Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Thomas Huth <thuth@redhat.com> --- Changes since last submission: - fix windows build
Diffstat (limited to 'slirp/socket.c')
-rw-r--r--slirp/socket.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/slirp/socket.c b/slirp/socket.c
index 8e8de88044..02e89ce1f2 100644
--- a/slirp/socket.c
+++ b/slirp/socket.c
@@ -816,7 +816,10 @@ void sotranslate_out(struct socket *so, struct sockaddr_storage *addr)
if (in6_equal_net(&so->so_faddr6, &slirp->vprefix_addr6,
slirp->vprefix_len)) {
if (in6_equal(&so->so_faddr6, &slirp->vnameserver_addr6)) {
- if (get_dns6_addr(&sin6->sin6_addr) < 0) {
+ uint32_t scope_id;
+ if (get_dns6_addr(&sin6->sin6_addr, &scope_id) >= 0) {
+ sin6->sin6_scope_id = scope_id;
+ } else {
sin6->sin6_addr = in6addr_loopback;
}
} else {