Commit 3e71f42c authored by Philip Withnall's avatar Philip Withnall

pseudotcp: Use labs() rather than abs() for handling long integers

This fixes a compiler warning and prevents a possible truncation.
Reviewed-by: default avatarOlivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D345
parent 53283c21
......@@ -1607,7 +1607,7 @@ process(PseudoTcpSocket *self, Segment *seg)
priv->rx_rttvar = rtt / 2;
} else {
priv->rx_rttvar = (3 * priv->rx_rttvar +
abs((long)(rtt - priv->rx_srtt))) / 4;
labs((long)(rtt - priv->rx_srtt))) / 4;
priv->rx_srtt = (7 * priv->rx_srtt + rtt) / 8;
}
priv->rx_rto = bound(MIN_RTO,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment