[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in sfq.cc ?



On Tue, 02 Feb 1999 09:24:18 +0100, Roman A Pletka wrote: 
>Hi,
>
>I use ns-2.1b4a. There seems to be a baug in sfq.cc line 161:
>
>int SFQ::command(int argc, const char*const* argv)
>{
>  if (argc == 3) {
>    if (strcmp(argv[1], "limit") == 0) {
>      maxqueue_ = atoi(argv[2]);
>      fairshare = maxqueue_ / buckets_;
>      return (TCL_OK);
>    }
>    if (strcmp(argv[1], "buckets") == 0) {
>      clear();
>      maxqueue_ = atoi(argv[2]);
>      return (TCL_OK);
>    }
>  }
>  return (Queue::command(argc, argv));
>}
>
>The second time "maxqueue_ = atoi(argv[2]);" should be "buckets_ = ..."

Yes, clearly a bug.  Thanks.  Fixed in the next versin.

(Better code would make buckets a bound variable rather than a
command, though.)

   -John Heidemann