Skip to content

IPv4 addresses enclosed in brackets against RFC3986 #3647

@mkowalski

Description

@mkowalski

Currently toml files use the following syntax for addresses of control services

Address = "[242.254.0.22]:31005"

According to RFC3986 this syntax is reserved for IPv6 and futures

A host identified by an Internet Protocol literal address, version 6
   [RFC3513] or later, is distinguished by enclosing the IP literal
   within square brackets ("[" and "]").  This is the only place where
   square bracket characters are allowed in the URI syntax.

The current behaviour is inconsistent as toml files also contain IPs without enclosing brackets, like agent = "172.17.0.1:6831".

Probably the following regex (https://github.com/scionproto/scion/blob/master/go/lib/snet/udpaddr.go#L29-L30) should be updated to handle this more properly

var addrRegexp = regexp.MustCompile(
    `^(?P<ia>\d+-[\d:A-Fa-f]+),\[(?P<host>[^\]]+)\](?P<port>:\d+)?$`)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions