Files
coredns/plugin/hosts/hostsfile.go
Baltasar Blanco 14ed42bd1f plugin/hosts: don't drop over-long fields silently (#8551)
#8496 fixed a silent truncation here and named the invariant in its own commit
message: entries were dropped and the hosts file simply looked shorter than it
is, with nothing in the log.

#8516 replaced that mechanism with a streaming parser bounded by maxFieldSize.
The error log #8496 added is still in parse(), but it can no longer report a
dropped entry: bufio.ErrBufferFull is consumed by the read loop, so only a real
I/O error reaches it. A field over maxFieldSize is discarded in lineParser with
no log at all, and when that field is the address the whole line goes with it.

Report both cases, once per dropped field, with the line number and the source
the entries came from.

Signed-off-by: Baltasar Blanco <baltasarblanco.dev@gmail.com>
2026-09-15 19:24:23 -07:00

10 KiB