Subject: | unparseable line errors |
Hello,
I was getting "unparseable line" errors periodically. Looking at the lines I noticed that tm_when is set to 1AD7F29ABCA which is apparently equivalent to -1 (see http://lists.openwall.net/netdev/2008/06/01/8). I fixed regular expression for tm_when to accept this value (see attached patch) and it solved the problem for me. Not sure how justified it is to return -1 for all [\dA-F]{11} values though.
--
Best regards
Pavel Shaydo
Subject: | unparseable-tm_when.patch |
diff --git a/lib/Linux/Proc/Net/TCP.pm b/lib/Linux/Proc/Net/TCP.pm
index cacf260..d3dd5ca 100644
--- a/lib/Linux/Proc/Net/TCP.pm
+++ b/lib/Linux/Proc/Net/TCP.pm
@@ -40,7 +40,7 @@ sub read {
([\dA-F]{8}(?:[\dA-F]{24})?):([\dA-F]{4})\s # remote address and port - 3 y 4
([\dA-F]{2})\s # st - 5
([\dA-F]{8}):([\dA-F]{8})\s # tx_queue and rx_queue - 6 y 7
- (\d\d):([\dA-F]{8}|(?:F{9,}))\s # tr and tm->when - 8 y 9
+ (\d\d):([\dA-F]{8}|(?:F{9,})|[\dA-F]{11})\s # tr and tm->when - 8 y 9
([\dA-F]{8})\s+ # retrnsmt - 10
(\d+)\s+ # uid - 11
(\d+)\s+ # timeout - 12
@@ -152,7 +152,7 @@ sub ip6 { length(shift->[ 1]) == 32 }
sub tm_when { # work around bug in Linux kernel
my $when = shift->[9];
- $when =~ /^F{8,}$/ ? -1 : hex $when
+ $when =~ /^(?:F{8,}|[\dA-F]{11})$/ ? -1 : hex $when
}