Closed lifesboy closed 2 years ago
Important notices
Describe the bug
Choose an existed static gateway for wan interface then click on save. It's saving old gateway, not new gateway.
To Reproduce
Steps to reproduce the behavior:
...<interfaces><wan><gateway>{saved_value}</gateway></wan>...
Expected behavior saved_value should be new gateway: 'WAN_GWv4'
Describe alternatives you considered in src/www/interfaces.php#L1341, it's updating $a_interfaces[$if] = $new_config but write_config() is saving global $config, which is not updated with $new_config. https://github.com/opnsense/core/blob/41a0a938f844f96450bc13dc35a9102016e650fd/src/www/interfaces.php#L1341
$a_interfaces[$if] = $new_config
write_config()
$new_config
Screenshots
Relevant log files
<interfaces> <wan> <if>eno1</if> <descr>WAN</descr> <enable>1</enable> <spoofmac/> <blockpriv>1</blockpriv> <blockbogons>1</blockbogons> <ipaddr>192.168.1.18</ipaddr> <subnet>24</subnet> <gateway>WAN_GWv46</gateway> </wan> ...
I cannot reproduce this. $a_interfaces is a reference to $config[interfaces]:
https://github.com/opnsense/core/blob/ea7709e2683f2754b7fb2150679020fef9964b80/src/www/interfaces.php#L310
Cheers, Franco
After use latest from master branch, this issue has been fixed. Thank you for your support!
Important notices
Describe the bug
Choose an existed static gateway for wan interface then click on save. It's saving old gateway, not new gateway.
To Reproduce
Steps to reproduce the behavior:
...<interfaces><wan><gateway>{saved_value}</gateway></wan>...
saved_value is old: 'WAN_GWv46'Expected behavior saved_value should be new gateway: 'WAN_GWv4'
Describe alternatives you considered in src/www/interfaces.php#L1341, it's updating
$a_interfaces[$if] = $new_config
butwrite_config()
is saving global $config, which is not updated with$new_config
. https://github.com/opnsense/core/blob/41a0a938f844f96450bc13dc35a9102016e650fd/src/www/interfaces.php#L1341Screenshots
Relevant log files