Project

General

Profile

Actions

Bug #5505

closed

services_dnsmasq.php - Saving does not prompt to Apply, applies automatically, unless an override was edited

Added by Jim Pingle over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Low
Assignee:
Category:
DNS Forwarder
Target version:
Start date:
11/20/2015
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.3
Affected Architecture:
All

Description

The behavior of saving and applying on services_dnsmasq.php is inconsistent with itself and with the behavior in Unbound. Ideally it should always prompt to apply and then only run the apply action when apply is clicked. This isn't a regression, it's been like this for years but it's a good time to clean it up.

The Save action on the main page should:
  • Mark the "hosts" subsystem dirty so that "Apply" shows up
  • Perform a write_config()

The Apply action should run the following:

            // Reload filter (we might need to sync to CARP hosts)
            filter_configure();
            /* Update resolv.conf in case the interface bindings exclude localhost. */
            system_resolvconf_generate();
            /* Start or restart dhcpleases when it's necessary */
            system_dhcpleases_configure();
            if ($retval == 0) {
                clear_subsystem_dirty('hosts');
            }

Which is currently run during the Save action (and by consequence of how Apply is coded to work on that page, also on Apply)

This will also stop the extra write from happening on "Apply" which is unexpected/unnecessary.

Actions #1

Updated by Anonymous over 8 years ago

  • Status changed from Confirmed to Feedback
  • Assignee changed from Anonymous to Jim Pingle

Updated as requested, except:

$retval = filter_configure();

(Adding $retval = )

Actions #2

Updated by Anonymous over 8 years ago

  • % Done changed from 0 to 100
Actions #3

Updated by Jim Pingle over 8 years ago

  • Status changed from Feedback to Resolved

Still wasn't quite what I intended. I went ahead and fixed it up though and tested it after. Seems to behave consistently now. Save only saves, apply actually activates the settings in each case. No extraneous saves and no surprise applies.

Actions

Also available in: Atom PDF