Project

General

Profile

Actions

Bug #14115

closed
CM JP

DHCP Server page does not properly select a default interface tab if neither WAN nor LAN are capable of being DHCP servers

Bug #14115: DHCP Server page does not properly select a default interface tab if neither WAN nor LAN are capable of being DHCP servers

Added by Christian McDonald over 3 years ago. Updated over 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
DHCP (IPv4)
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.05
Release Notes:
Default
Affected Version:
Affected Architecture:

Description

When both WAN and LAN are set to DHCP, the DHCP server web interface doesn't appropriately select an interface tab.

This results in a weird state where the web interface is pointing to a null interface definition.


Files

2023-03-15_13-15.png (917 KB) 2023-03-15_13-15.png Christian McDonald, 03/15/2023 12:16 PM
no-click.png (65.1 KB) no-click.png Alhusein Zawi, 03/18/2023 06:28 PM
click.png (65.8 KB) click.png Alhusein Zawi, 03/18/2023 06:28 PM

JP Updated by Jim Pingle over 3 years ago Actions #1

  • Category changed from Web Interface to DHCP (IPv4)
  • Target version set to 2.7.0
  • Plus Target Version set to 23.05

CM Updated by Christian McDonald over 3 years ago Actions #2

  • Subject changed from Unable to DHCP on OPT interfaces if WAN and LAN are DHCP to Unable to configure DHCP on OPT interfaces if WAN and LAN are DHCP

AZ Updated by Alhusein Zawi over 3 years ago Actions #3

this state occurs with previous versions too.

click on the tab of opt interface and you will be able to configure the DHCP server .

JP Updated by Jim Pingle over 3 years ago Actions #4

Looks like one test is reversed when it's trying to locate the starting interface. I don't have a setup to test this handy, but this should work:

diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php
index 7dc327a129..a1a34e70c8 100644
--- a/src/usr/local/www/services_dhcp.php
+++ b/src/usr/local/www/services_dhcp.php
@@ -80,7 +80,7 @@ if (!$if || !isset($iflist[$if])) {
                        /* Not static IPv4 or subnet >= 31 */
                        if (!is_ipaddrv4(config_get_path("interfaces/{$ifent}/ipaddr")) ||
                            empty($oc['subnet']) ||
-                           ((int) config_get_path("interfaces/{$ifent}/subnet", 0) < 31)) {
+                           ((int) config_get_path("interfaces/{$ifent}/subnet", 0) >= 31)) {
                                continue;
                        }

JP Updated by Jim Pingle over 3 years ago Actions #5

  • Assignee changed from Christian McDonald to Jim Pingle

JP Updated by Jim Pingle over 3 years ago Actions #6

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

Applied in changeset commit:53dbfb25ff1a611806f81f39a6fd8b5b9938f175.

GT Updated by Georgiy Tyutyunnik over 3 years ago Actions #7

tested on:
Version 23.01-RELEASE (amd64)
built on Fri Feb 10 20:06:33 UTC 2023
FreeBSD 14.0-CURRENT

patch fixes the issue

JP Updated by Jim Pingle over 3 years ago Actions #8

  • Status changed from Feedback to Resolved

JP Updated by Jim Pingle over 3 years ago Actions #9

  • Subject changed from Unable to configure DHCP on OPT interfaces if WAN and LAN are DHCP to DHCP Server page does not properly select a default interface tab if neither WAN nor LAN are capable of being DHCP servers

Updating subject for release notes.

Actions

Also available in: Atom