nMinPingUsecTime was left uninitialized in CNode.
The correct initialization for a minimum-until-now is int64_t's max value, so initialize it to that.
Thanks @MarcoFalke for noticing.
net: correctly initialize nMinPingUsecTime #6636
pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2015_09_initialize_minpingtime changing 1 files +1 −0-
laanwj commented at 1:45 PM on September 4, 2015: member
- laanwj added the label P2P on Sep 4, 2015
-
paveljanik commented at 2:15 PM on September 4, 2015: contributor
tested ACK It could be shocking for some people to see:
"minping": 0.39083, "minping": 0.139336, "minping": 9223372036854.775,;-)
-
sipa commented at 2:21 PM on September 4, 2015: member
Untested ACK.
However, if you care for bikeshedding: how about returning null, or not even including the entry if there is no result?
-
laanwj commented at 2:24 PM on September 4, 2015: member
I think there's some confusion here: I'm fine with changing what is returned on RPC, but that's not the point of this pull. RPC code isn't even touched. The idea is to fix the connection slot DoS exhaustion #6374, which uses this newly-introduced CNode field.
- laanwj force-pushed on Sep 4, 2015
- laanwj force-pushed on Sep 4, 2015
-
93ff1b9041
net: correctly initialize nMinPingUsecTime
`nMinPingUsecTime` was left uninitialized in CNode. The correct initialization for a minimum-until-now is int64_t's max value, so initialize it to that. Thanks @MarcoFalke for noticing.
-
sipa commented at 2:36 PM on September 4, 2015: member
ACK on this pull :)
- sipa cross-referenced this on Sep 4, 2015 from issue [net] Assume inital value of nMinPingUsecTime to be int64_max by MarcoFalke
- laanwj merged this on Sep 4, 2015
- laanwj closed this on Sep 4, 2015
- laanwj referenced this in commit 536207f316 on Sep 4, 2015
-
MarcoFalke commented at 3:27 PM on September 4, 2015: member
tested ACK (3f99d70 which is about the same as the merged one)
- laanwj cross-referenced this on Apr 8, 2016 from issue `getpeerinfo` should report minping differently if there never was a ping by laanwj
- defuse cross-referenced this on Aug 16, 2016 from issue Merge upstream anti DoS patches by bitcartel
- MarcoFalke cross-referenced this on Jan 5, 2019 from issue refactor: Use C++11 default member initializers by MarcoFalke
- laanwj referenced this in commit 3f12515199 on Jan 9, 2019
- MarcoFalke cross-referenced this on Jan 10, 2019 from issue [refactor] CNode: Use C++11 default member initializers by MarcoFalke
- laanwj referenced this in commit 070eaf7fe5 on Jan 14, 2019
- MarcoFalke cross-referenced this on Oct 9, 2019 from issue RFC: Rust code integration by fanquake
- Fuzzbawls cross-referenced this on Jun 23, 2020 from issue [Net] Pre-requirements for network encapsulation by Fuzzbawls
- random-zebra referenced this in commit 8bbc0650e6 on Jul 1, 2020
- pravblockc referenced this in commit a7a5a1c067 on Aug 9, 2021
- pravblockc referenced this in commit 8e21d90eed on Aug 11, 2021
- pravblockc referenced this in commit 95d588e9b4 on Aug 11, 2021
- 5tefan referenced this in commit bfba8f2211 on Aug 12, 2021
- bitcoin locked this on Sep 8, 2021
Contributors
Labels
Linked (view graph)
#6374 Connection slot exhaustion DoS mitigation#6638 [net] Assume inital value of nMinPingUsecTime to be int64_max#7837 `getpeerinfo` should report minping differently if there never was a ping#15109 refactor: Use C++11 default member initializers#15144 [refactor] CNode: Use C++11 default member initializers#17090 RFC: Rust code integration