Page MenuHomeVyOS Platform

Wrong dhcp-server static route subnet bytes
Closed, ResolvedPublicBUG

Description

Network bytes calculated wrong here:
https://github.com/vyos/vyos-1x/blob/current/src/conf_mode/dhcp_server.py#L596-L600

if the network_address (with /24 netmask) is 10.10.0.X or 10.0.10.X, the resulted string will be same: "10, 10,"

Details

Difficulty level
Unknown (require assessment)
Version
1.3
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Perfectly compatible

Event Timeline

elbandi created this task.Feb 22 2020, 11:51 AM
pasik added a subscriber: pasik.Feb 23 2020, 10:23 AM
elbandi added a comment.EditedMar 3 2020, 12:29 AM

Here is a solution (based from https://github.com/jansegre/dhcplib/blob/master/dhcplib/rfc.py#L225-L232):

# add network bytes
if net.prefixlen:
    width = net.prefixlen // 8
    if net.prefixlen % 8:
        width += 1
    string += ','.join(map(str,tuple(net.network_address.packed)[:width])) + ','
dmbaturin changed Why the issue appeared? from Will be filled on close to Implementation mistake.
dmbaturin changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
dmbaturin closed this task as Resolved.Thu, Jun 25, 7:52 AM
dmbaturin claimed this task.