Skip to content

IPv6 and ipv4 parser behave different #227

Open
@mroethke

Description

@mroethke

Description

Ipv4 addresses may be trailed by random characters(e.g. prefix length) and the parser will happily ignore it, the IPv6 address parser does not allow that.

Steps to reproduce the issue

Try to parse 192.168.0.0/24 and fc00::/56 with lrtr_ip_str_to_addr.

Expected results

Both should behave the same, ideally returning an error.

Actual results

The v4 address is parsed fine (ignoring the prefix) the v6 parser returns a error.

Since this could break existing applications I would like to discuss what we should do.
The best solution would be to return an error, but allowing trailing characters could of course also be implemented for the v6 parser to provide consistency and preserve compatibility.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions