summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko2016-09-26 19:53:04 +0200
committerDenys Vlasenko2016-09-26 19:53:04 +0200
commit3c18e3051dfdb5591afc18562e9d9da987a5945e (patch)
treef3d6a693bb0f8cb4dea6e1a3a8632698279d63d6 /libbb
parent525209ac9465f37a9ba292f1ff138dd80768e869 (diff)
downloadbusybox-3c18e3051dfdb5591afc18562e9d9da987a5945e.zip
busybox-3c18e3051dfdb5591afc18562e9d9da987a5945e.tar.gz
libbb: make xmalloc_sockaddr2dotted use NI_NUMERICSCOPE
Gives "mount -t cifs //fe80::6a05:caff:fe3e:dbf5%eth0/test test" a chance to work: mount must pass "ip=numeric_IPv6%numeric_iface_id" in the omunt option string. Currently, it does not. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xconnect.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index 6e78e63..3a0dc26 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -496,12 +496,15 @@ char* FAST_FUNC xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa)
{
return sockaddr2str(sa, NI_NAMEREQD | IGNORE_PORT);
}
+#ifndef NI_NUMERICSCOPE
+# define NI_NUMERICSCOPE 0
+#endif
char* FAST_FUNC xmalloc_sockaddr2dotted(const struct sockaddr *sa)
{
- return sockaddr2str(sa, NI_NUMERICHOST);
+ return sockaddr2str(sa, NI_NUMERICHOST | NI_NUMERICSCOPE);
}
char* FAST_FUNC xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa)
{
- return sockaddr2str(sa, NI_NUMERICHOST | IGNORE_PORT);
+ return sockaddr2str(sa, NI_NUMERICHOST | NI_NUMERICSCOPE | IGNORE_PORT);
}