Project

General

Profile

Actions

Bug #7835

closed

freeradius unit wrong for varusersmaxbandwidthup and varusersmaxbandwidthdown

Added by Azure it over 6 years ago. Updated over 6 years ago.

Status:
Not a Bug
Priority:
Low
Assignee:
-
Category:
FreeRADIUS
Target version:
-
Start date:
08/31/2017
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

When we add a new radius user, we can set Maximum Bandwidth Down/Up and in the help we can read:
Enter the maximum bandwidth for download in in kilobits per second (Kbps).
offtopic 'in' is repeated.

At the file /usr/local/pkg/freeradius.inc it will say the GUI uses KiloBit but it uses Kilobit.
and will multiply by 1024 when it should be 1000
// GUI uses KiloBit but RADIUS needs Bits so we do a multiplication
$varusersmaxbandwidthup = ($users['varusersmaxbandwidthup'] ?: '');
$varusersmaxbandwidthup = $varusersmaxbandwidthup * 1024;
$varusersmaxbandwidthdown = ($users['varusersmaxbandwidthdown'] ?: '');
$varusersmaxbandwidthdown = $varusersmaxbandwidthdown * 1024;

regards

Actions #1

Updated by Jim Pingle over 6 years ago

  • Status changed from New to Not a Bug

There are 1024 bits in a kilobit. Not 1000. I'll fix the "in in" typo.

Actions #2

Updated by Azure it over 6 years ago

Jim Pingle wrote:

There are 1024 bits in a kilobit. Not 1000. I'll fix the "in in" typo.

Freebsd uses 1000 bits in 1 kilobit.

[[https://github.com/freebsd/freebsd/blob/master/usr.bin/systat/convtbl.c]]

#define BIT        (8)
#define BITS        (1)
#define KILOBIT        (1000LL)
#define MEGABIT        (KILOBIT * 1000)
#define GIGABIT        (MEGABIT * 1000)
#define TERABIT        (GIGABIT * 1000)

#define BYTE        (1)
#define BYTES        (1)
#define KILOBYTE    (1024LL)
#define MEGABYTE    (KILOBYTE * 1024)
#define GIGABYTE    (MEGABYTE * 1024)
#define TERABYTE    (GIGABYTE * 1024)

This is explained at this freebsd patch from 2006:
[[https://lists.freebsd.org/pipermail/freebsd-bugs/2006-December/021240.html]]

wikipedia:

regards

Actions #3

Updated by Jim Pingle over 6 years ago

Then we can change the description to say kibibit instead. Changing the multiplier would result in people having an unexpected shift in the effect of their settings.

Actions #4

Updated by Kill Bill over 6 years ago

May I suggest "Enter the maximum bandwidth for download in Kbps" and moving on?

Actions

Also available in: Atom PDF