Add dhcpd VLAN parameter to restrict dhcpd to given VLAN

This commit is contained in:
logicog
2026-03-09 22:11:29 +01:00
parent aa12adc098
commit 855d587243
6 changed files with 26 additions and 4 deletions
+5
View File
@@ -44,6 +44,7 @@ extern __xdata struct dhcp_state dhcp_state;
__xdata uint8_t vlan_names[VLAN_NAMES_SIZE];
__xdata uint16_t vlan_ptr;
extern __xdata uint16_t management_vlan;
extern __xdata uint16_t dhcpd_vlan;
__xdata uint8_t gpio_last_value[8] = { 0 };
// Temporatly for str to hex convertion value.
@@ -1001,6 +1002,10 @@ void cmd_parser(void) __banked
}
} else if (cmd_compare(0, "dhcpd")) {
if (cmd_words_b[1] > 0 && cmd_compare(1, "on")) {
if (cmd_words_b[2] > 0)
atoi_short(&dhcpd_vlan, cmd_words_b[2]);
else
dhcpd_vlan = 0;
dhcpd_start();
} else {
print_string("DHCP Server disabled\n");