Page MenuHomeVyOS Platform

DHCP server raises NameError
Closed, ResolvedPublicBUG

Description

Reported via Forums: https://forum.vyos.io/t/error-committing-dhcp-server-configuration-nameerror/6408

Reproducible via:

set service dhcp-server shared-network-name LAN authoritative
set service dhcp-server shared-network-name LAN subnet 192.168.2.0/24 default-router 192.168.2.1
set service dhcp-server shared-network-name LAN subnet 192.168.2.0/24 dns-server 192.168.2.1
set service dhcp-server shared-network-name LAN subnet 192.168.2.0/24 domain-name vyos.net
set service dhcp-server shared-network-name LAN subnet 192.168.2.0/24 exclude 192.168.2.1
set service dhcp-server shared-network-name LAN subnet 192.168.2.0/24 lease 86400
set service dhcp-server shared-network-name LAN subnet 192.168.2.0/24 range 0 start 192.168.2.10
set service dhcp-server shared-network-name LAN subnet 192.168.2.0/24 range 0 stop 192.168.2.200
Traceback (most recent call last):
  File "/usr/libexec/vyos/conf_mode/dhcp_server.py", line 291, in <module>
    c = get_config()
  File "/usr/libexec/vyos/conf_mode/dhcp_server.py", line 125, in get_config
    for slice in dhcp_slice_range(subnet_config['exclude'], r_config):
  File "/usr/libexec/vyos/conf_mode/dhcp_server.py", line 95, in dhcp_slice_range
    if ra not in output:
NameError: name 'ra' is not defined

Details

Difficulty level
Easy (less than an hour)
Version
1.3-rolling-202101021704
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

c-po claimed this task.
c-po triaged this task as Normal priority.
c-po changed Why the issue appeared? from Will be filled on close to Implementation mistake.
c-po changed Is it a breaking change? from Unspecified (possibly destroys the router) to Perfectly compatible.
c-po updated the task description. (Show Details)
c-po updated the task description. (Show Details)
SrividyaA set Issue type to Bug (incorrect behavior).Aug 30 2021, 1:00 PM