Skip to content

Routing profile CIDR fields are not trimmed, a trailing space fails the whole router #1805

Description

@rokokol

Operating system

Linux

System version

NixOS 26.11.20260816.e5bdc4a, kernel 6.18

Installation type

package manager

Version

1.2.2

Description

A value entered as ip: 100.64.0.0/10 — with a space after the colon, which reads naturally — is passed to the core verbatim, spaces included, and the whole router fails to initialise.

Trimming the value when the profile is saved would remove the class of failure entirely. The message does name the offending field, so it is recoverable, but the profile will not start until the space is spotted and removed.

Reproduction

  1. Open a routing profile
  2. In Direct, enter ip: 100.64.0.0/10 with a space after the colon
  3. Save and connect — the core refuses to start

Expected

Whitespace around a CIDR entry is trimmed on save, or rejected at input with a message pointing at the field, rather than failing the whole router at start.

Logs

create service: initialize router: parse rule[4]: ipcidr: parse [0]:
netip.ParsePrefix(" 100.64.0.0/10 "): ParseAddr(" 100.64.0.0"): unexpected character (at " 100.64.0.0")

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