Page MenuHomeVyOS Platform

Wrong DHCP server pool size in statistics
Closed, ResolvedPublic

Description

Hi,

When running

show dhcp server statistics

the pool sizes seem to be not correct. This is due to the get_pool_size() function in src/op_mode/show_dhcp.py, which just subtracts a range's lower bound from its upper bound and uses the result as pool size. However, since according to the man page [0] both boundaries are inclusive, it should add +1 to the subtraction result:

The range statement gives the lowest and highest IP addresses in a range.

[0] https://linux.die.net/man/5/dhcpd.conf

I could file a PR if you like, already prepared it.

Best regards
Robert

Details

Difficulty level
Unknown (require assessment)
Version
1.3
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible

Event Timeline

efficiosoft created this task.
efficiosoft created this object in space S1 VyOS Public.
efficiosoft renamed this task from Fix DHCP pool size in statistics to Wrong DHCP server pool size in statistics.Jul 20 2020, 1:49 PM

I could file a PR if you like, already prepared it.

Please do, that would be very welcome!

Ok, done here.

As this is my first Phabricator experience, is there anything else I have to do?