提交 7a88efe9 编写于 作者: C Chuck Lever 提交者: Trond Myklebust

SUNRPC: Don't display zero scope IDs

A zero scope ID means that it wasn't set, so we don't need to append
it to presentation format addresses.
Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
Acked-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 f1a89a11
......@@ -73,6 +73,8 @@ static size_t rpc_ntop6(const struct sockaddr *sap,
if (!(ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LINKLOCAL))
return len;
if (sin6->sin6_scope_id == 0)
return len;
rc = snprintf(scopebuf, sizeof(scopebuf), "%c%u",
IPV6_SCOPE_DELIMITER, sin6->sin6_scope_id);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册