Re: [PATCH iproute2-main] libnetlink: handle failed time seeds and sequence wrap

From
Stephen Hemminger <stephen@networkplumber.org>
Date
2026-11-09 01:58:19
Reply to
Florian Fainelli, 2026-11-03
On Tue,  3 Nov 2026 13:59:32 -0800
Florian Fainelli [off-list ref] wrote:
A 32-bit time_t overflows when the board clock is beyond 2038. time()
returns -1, and the first request then has sequence zero. The sequence
range check underflows and discards the valid reply, leaving ip blocked
in recvmsg(). The same range check also fails on a normal counter wrap.

Use zero as a fallback seed when time() fails. Compare the unsigned
sequence distance against the number of requests, allowing wraparound
and rejecting the sequence immediately before the first request.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
I put a better more general solution into the recent netlink fixes
Thread (2 messages) 2 messages, 2 authors, last reply 12d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help