From: Mark Huang Date: Wed, 22 Feb 2006 23:47:37 +0000 (+0000) Subject: - fix a minor (haha) bug: tc reports minor class numbers in hexadecimal, X-Git-Tag: planetlab-3_3-branch-point~26 X-Git-Url: http://git.onelab.eu/?p=mom.git;a=commitdiff_plain;h=aa2ae2c70a6582431404aab2520aa4afa288b344 - fix a minor (haha) bug: tc reports minor class numbers in hexadecimal, not decimal. Fix things so that it works with VNET, which classifies packets from xid 500 into class 1:1f4, *not* 1:500. - set the "default" minor class number to ffff to emphasize this point. --- diff --git a/pl_mom.pl b/pl_mom.pl index 55da825..5b4e676 100755 --- 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";