Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when shortening ipv6 adresses with long zero runs. #22440

Open
bondehagen opened this issue Jan 7, 2025 · 0 comments · May be fixed by #22441
Open

Error when shortening ipv6 adresses with long zero runs. #22440

bondehagen opened this issue Jan 7, 2025 · 0 comments · May be fixed by #22441
Labels
bug Observed behavior contradicts documented or intended behavior standard library This issue involves writing Zig code for the standard library.
Milestone

Comments

@bondehagen
Copy link

Zig Version

0.13.0

Steps to Reproduce and Observed Behavior

Running the following:

const std = @import("std");

pub fn main() !void {
    const addr = try std.net.Address.parseIp6("2001:db8:0000:0000:0001:0000:0000:0002", 0);
    const addr2 = try std.net.Address.parseIp6("2001:db8:0000:0000:0000:0000:0001:0002", 0);
    std.debug.print("Parsed address: \n{}\n", .{addr});
    std.debug.print("{}", .{addr2});
}

Gives the following output:

Parsed address: 
[2001:db8::1:2]:0
[2001:db8::1:2]:0

Expected Behavior

This is the correct compressed form:

Parsed address: 
[2001:db8::1:0:0:2]:0
[2001:db8::1:2]:0
@bondehagen bondehagen added the bug Observed behavior contradicts documented or intended behavior label Jan 7, 2025
@mlugg mlugg added the standard library This issue involves writing Zig code for the standard library. label Jan 7, 2025
@mlugg mlugg added this to the 0.15.0 milestone Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants