| ... | @@ -161,7 +161,7 @@ pub const Ip6Address = extern struct { | ... | @@ -161,7 +161,7 @@ pub const Ip6Address = extern struct { |
| 161 | pub fn nprint(adr: Ip6Address, writer: anytype) !void { | 161 | pub fn nprint(adr: Ip6Address, writer: anytype) !void { |
| 162 | const parts: [8]u16 = @bitCast(adr.sa.addr.addr); | 162 | const parts: [8]u16 = @bitCast(adr.sa.addr.addr); |
| 163 | const port = @byteSwap(adr.sa.port); | 163 | const port = @byteSwap(adr.sa.port); |
| 164 | try writer.print("{x}.{x}.{x}.{x}.{x}.{x}.{x}.{x}:{d}", .{ parts[0], parts[1], parts[2], parts[3], parts[4], parts[5], parts[6], parts[7], port }); | 164 | try writer.print("[{x:0>4}:{x:0>4}:{x:0>4}:{x:0>4}:{x:0>4}:{x:0>4}:{x:0>4}:{x:0>4}]:{d}", .{ parts[0], parts[1], parts[2], parts[3], parts[4], parts[5], parts[6], parts[7], port }); |
| 165 | } | 165 | } |
| 166 | }; | 166 | }; |
| 167 | | 167 | |