Skip to content

luci-mod-system: add current host to reset reconnect#8548

Open
aslafy-z wants to merge 1 commit intoopenwrt:masterfrom
aslafy-z:patch-3
Open

luci-mod-system: add current host to reset reconnect#8548
aslafy-z wants to merge 1 commit intoopenwrt:masterfrom
aslafy-z:patch-3

Conversation

@aslafy-z
Copy link
Copy Markdown

@aslafy-z aslafy-z commented Apr 12, 2026

Pull Request details

Description

When performing a sysupgrade without keeping settings, ui.awaitReconnect()
only tries the hardcoded 192.168.1.1 and openwrt.lan. This fails silently
when the device uses a different static IP, forcing the user to manually
navigate to the correct address.

This change prepends window.location.host to the reconnect target list in
the factory reset code path, keeping 192.168.1.1 and openwrt.lan as
fallbacks. This matches the behavior already used when settings are kept.

Common use case: custom images built with the OpenWrt Image Builder with
pre-configured static IPs. After flashing, the device comes back on a known
address that differs from the defaults.

Screenshot or video of changes (If applicable)

N/A - behavior change only visible during sysupgrade reconnect.

Maintainer (Preferred)

@jow-


Tested on

OpenWrt version: 24.10.6
LuCI version: git-24.xxx (luci-mod-system)
Web browser: Firefox


Checklist

  • This PR is not from my main or master branch 💩, but a separate branch. ✅
  • Each commit has a valid ✒️ Signed-off-by: <my@email.address> row (via git commit --signoff).
  • Each commit and PR title has a valid 📝 <package name>: title first line subject for packages.

@aslafy-z aslafy-z marked this pull request as ready for review April 12, 2026 16:14
@github-actions

This comment has been minimized.

@systemcrash
Copy link
Copy Markdown
Contributor

This fails silently when the device uses a different static IP

In which cases does this happen? The defaults are what is set during a factory reset.

@aslafy-z
Copy link
Copy Markdown
Author

@systemcrash flashing does not mean factory reset. I wrongly mentioned factory reset in the PR desc, and just edited it. Here's the updated section:

Common use case: custom images built with the OpenWrt Image Builder with
pre-configured static IPs. After flashing, the device comes back on a known
address that differs from the defaults.

@systemcrash
Copy link
Copy Markdown
Contributor

OK - but when flashing without retaining settings ("aka factory reset"), the default is 192.168.1.1. So the question still stands - what do I need to do to find myself in your situation (to reproduce this issue)?

@aslafy-z
Copy link
Copy Markdown
Author

aslafy-z commented Apr 13, 2026

The situation is: "do a sysupgrade to a firmware image whose built-in default LAN IP is not 192.168.1.1".

"Without retaining settings" resets to the defaults of the flashed image, not necessarily to the stock OpenWrt defaults. So this is reproducible with custom images that change the LAN address at build time, for example through Image Builder files a baked /etc/config/network, or a uci-defaults script.

Example reproduction:

  1. Build an image with network.lan.ipaddr=192.168.42.1
  2. Trigger sysupgrade with "do not keep settings"
  3. After reboot, the device is reachable at 192.168.42.1, but awaitReconnect() only probes 192.168.1.1 and openwrt.lan

When performing a sysupgrade without keeping settings, the reconnect
logic only tries the hardcoded 192.168.1.1 and openwrt.lan. This fails
silently when the device uses a different static IP.

Prepend window.location.host to the reconnect target list, keeping the
existing defaults as fallbacks. This matches the behavior already used
when settings are kept.

Common use case: custom images built with the OpenWrt Image Builder and
pre-configured static IPs land on a known address that differs from the
defaults after a factory reset. The current host is the most likely
correct target since the user is already connected to it.


Signed-off-by: Zadkiel AHARONIAN <hello@zadkiel.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants