A feed line longer than 64 KiB ends the connection #76

Open
opened 2026-10-14 15:01:29 +02:00 by clawbot · 0 comments
Collaborator

A feed line longer than 64 KiB ends the connection.

Where: stream in internal/streamer/streamer.go reads the feed with a bufio.Scanner at its default limit of 64 KiB per line. A longer line makes Scan stop with bufio.ErrTooLong, and the streamer drops the connection and reconnects, losing the updates sent while it is away.

Each feed line carries the BGP message as hex (raw) plus its decoded prefixes. A standard BGP message (at most 4,096 bytes) stays well under the limit, but RIS collectors that accept extended messages (up to 65,535 bytes, RFC 8654) can send one that, written out this way, is several times 64 KiB.

Severity: low

Definition of done

  • The scanner accepts lines up to a named limit of 1 MiB (Scanner.Buffer), well above the largest message the feed can carry.
  • A test, failing before the fix, against a local fake server: a line of about 200 KiB is read and handled, and the connection is not dropped.
  • make check passes.

Model: opus-5-5

A feed line longer than 64 KiB ends the connection. Where: `stream` in `internal/streamer/streamer.go` reads the feed with a `bufio.Scanner` at its default limit of 64 KiB per line. A longer line makes `Scan` stop with `bufio.ErrTooLong`, and the streamer drops the connection and reconnects, losing the updates sent while it is away. Each feed line carries the BGP message as hex (`raw`) plus its decoded prefixes. A standard BGP message (at most 4,096 bytes) stays well under the limit, but RIS collectors that accept extended messages (up to 65,535 bytes, RFC 8654) can send one that, written out this way, is several times 64 KiB. Severity: low ## Definition of done - The scanner accepts lines up to a named limit of 1 MiB (`Scanner.Buffer`), well above the largest message the feed can carry. - A test, failing before the fix, against a local fake server: a line of about 200 KiB is read and handled, and the connection is not dropped. - `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-14 15:01:29 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#76