Home » Networking » Net_Ping » Bug #5511
parseResultlinux does not detect presence of mdev
Details
| Submitted | 2005-09-24 15:55 UTC |
|---|---|
| From | gashalot at gashalot dot com |
| Assigned | cellog |
| Status | Closed |
| Package | Net_Ping |
| PHP Version | 4.4.0 |
| OS | Linux (Debian sarge) |
| Roadmaps | (Not assigned) |
Comments
[2005-09-24 15:55 UTC] gashalot at gashalot dot com
Description:
------------
When parsing output on Debian systems, the test to detect presence of the additional "mdev" output statistic does fails. When this fails, the results are reported incorrectly, as defined by this mapping (actual => reported): (min => NULL, avg => min, max => avg, mdev => max).
This bug renders Net::Ping unusable on affected architectures.
Patch follows:
--- /root/Ping.php 2005-09-24 11:39:57.491086784 -0400
+++ Ping.php 2005-09-24 11:41:39.430589624 -0400
@@ -682,7 +682,7 @@
$round_trip = explode('/', str_replace('=', '/', substr($this->_raw_data[$raw_data_len - 1], 0, -3)));
/* if mdev field exists, shift input one unit left */
- if (strpos($this->_raw_data[$raw_data_len - 1], 'mdev')) {
+ if (preg_match('/mdev/', $round_trip)) {
/* do not forget the rtt field */
$this->_round_trip['min'] = ltrim($round_trip[5]);
$this->_round_trip['avg'] = $round_trip[6];
Test script:
---------------
N/A. See discussion.
Expected result:
----------------
N/A. See discussion.
Actual result:
--------------
N/A. See discussion.