← Commit list

6500d123d

Denys Vlasenko
Denys Vlasenko
2012-04-17
FAILED Duration: 193s

Subject

udhcp: make arpping code resistant to time jumps

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/udhcp/arpping.c+7 -2
@@ -118,8 +118,13 @@ int FAST_FUNC arpping(uint32_t test_nip,
break;
}
}
- timeout_ms -= (unsigned)monotonic_ms() - prevTime;
- } while (timeout_ms > 0);
+ timeout_ms -= (unsigned)monotonic_ms() - prevTime + 1;
+
+ /* We used to check "timeout_ms > 0", but
+ * this is more under/overflow-resistant
+ * (people did see overflows here when system time jumps):
+ */
+ } while ((unsigned)timeout_ms <= 2000);
ret:
close(s);