Skip to content

Commit

Permalink
SUNRPC: Don't display zero scope IDs
Browse files Browse the repository at this point in the history
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: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Feb 10, 2010
1 parent f1a89a1 commit 7a88efe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sunrpc/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7a88efe

Please sign in to comment.