Project

General

Profile

Actions

Regression #13663

closed

Feature #13446: Upgrade PHP from 7.4 to 8.1

WIFI interface configuration creates invalid xml

Added by Steve Wheeler about 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Wireless
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.01
Release Notes:
Force Exclusion
Affected Version:
2.7.x
Affected Architecture:
All

Description

Saving the config for a wifi interface creates a bad config file causing it to be rejected and rolled back:

Nov 15 14:35:10     php-fpm     66987     /interfaces.php: Configuration Change: admin@172.21.16.8 (Local Database): Interfaces settings changed
Nov 15 14:35:10     php-fpm     66987     /interfaces.php: XML error: > required at line 2979 in /conf/config.xml
Nov 15 14:35:10     php-fpm     66987     /interfaces.php: Netgate pfSense Plus is restoring the configuration /cf/conf/backup/config-1668522748.xml
Nov 15 14:35:10     php-fpm     66987     /interfaces.php: New alert found: Netgate pfSense Plus is restoring the configuration /cf/conf/backup/config-1668522748.xml

The invalid line create is in the wireless section:

    <wireless>
        <clone>
            <if>ath0</if>
            <mode>hostap</mode>
            <descr><![CDATA[WPEA-127N]]></descr>
            <cloneif>ath0_wlan0</cloneif>
            <mode)>hostap</mode)>
        </clone>
        <interfaces>
            <ath0>
                <standard>11ng</standard>
                <protmode>off</protmode>
                <channel>13</channel>
                <distance></distance>
                <regdomain></regdomain>
                <regcountry>GB</regcountry>
                <reglocation>indoor</reglocation>
            </ath0>
        </interfaces>
    </wireless>

Actions #1

Updated by Jim Pingle about 2 years ago

  • Tracker changed from Bug to Regression
  • Status changed from New to In Progress
  • Assignee set to Jim Pingle

Looks like it's a typo in a key name.

diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index fffdd58b1c..3cc2e966af 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -3231,7 +3231,7 @@ function interface_sync_wireless_clones(&$ifcfg, $sync_changes = false) {
                foreach (config_get_path('wireless/clone', []) as $key => $clone) {
                        if ($clone['cloneif'] == $ifcfg['if']) {
                                if ($sync_changes) {
-                                       config_set_path("wireless/clone/{$key}/mode)", $ifcfg['wireless']['mode']);
+                                       config_set_path("wireless/clone/{$key}/mode", $ifcfg['wireless']['mode']);
                                } else {
                                        $ifcfg['wireless']['mode'] = $clone['mode'];
                                }

Commit inbound.

Actions #2

Updated by Steve Wheeler about 2 years ago

Yup, that fixes it here.

Actions #3

Updated by Jim Pingle about 2 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Steve Wheeler about 2 years ago

  • Status changed from Feedback to Resolved

This is fixed in current snapshots.

Tested:

23.01-DEVELOPMENT (amd64)
built on Mon Nov 21 06:05:21 UTC 2022
FreeBSD 14.0-CURRENT

Actions #5

Updated by Jim Pingle almost 2 years ago

  • Category changed from Interfaces to Wireless
  • Parent task set to #13446
  • Release Notes changed from Default to Force Exclusion
Actions

Also available in: Atom PDF