- fix a minor (haha) bug: tc reports minor class numbers in hexadecimal,
[mom.git] / pl_mom.pl
index 55da825..5b4e676 100755 (executable)
--- a/pl_mom.pl
+++ b/pl_mom.pl
@@ -248,15 +248,15 @@ sub get_baseline_counts {
     }
 
     my $status = `tc -s -d qdisc show`;
-    my $sliceid = "9999";
+    my $sliceid = 0xffff;
     @Lines = split(/\n/, $status);
     foreach $line ( @Lines ) {
        if ($line =~ /qdisc pfifo (.*): dev/) {
-           $sliceid = $1;
+           $sliceid = hex($1);
        } else {
            if ($line =~ /Sent (.*) bytes/) {
                my $bytes = $1;
-               if ($sliceid != 9999) {
+               if ($sliceid != 0xffff) {
                    my $slice = $Name{$sliceid};
                    if ($debug && $bytes) {
                        print "Slice: $slice ($sliceid), bytes $bytes\n";