Skip to content

Commit

Permalink
Special case "unknown"
Browse files Browse the repository at this point in the history
Fixes #7864

(cherry picked from commit 3f27a1c)
  • Loading branch information
lukebakken authored and mergify[bot] committed Apr 25, 2023
1 parent 2fd5793 commit 372dbd6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,13 @@ join_tags(Tags) ->
string:join(Strings, " ").

-spec parse_peeraddr(inet:ip_address()) -> string().
parse_peeraddr(unknown) ->
rabbit_data_coercion:to_list(unknown);
parse_peeraddr(PeerAddr) ->
handle_inet_ntoa_peeraddr(inet:ntoa(PeerAddr), PeerAddr).

-spec handle_inet_ntoa_peeraddr({'error', term()} | string(), inet:ip_address()) -> string().
handle_inet_ntoa_peeraddr({error, einval}, PeerAddr) ->
rabbit_data_coercion:to_list(io_lib:format("~w", [PeerAddr]));
rabbit_data_coercion:to_list(PeerAddr);
handle_inet_ntoa_peeraddr(PeerAddrStr, _PeerAddr0) ->
PeerAddrStr.

0 comments on commit 372dbd6

Please sign in to comment.