Network: static IP addressing
net.dhcp = false applies ip/mask/gw/dns on link up (DHCP client stopped). PTP/TX/SAP sockets are bound to the address, so a changed IP setup reboots the device; with DHCP on, the static fields (UI fills them with the lease) don't count as a change. Validation: contiguous netmask, not the network or broadcast address, gateway in the subnet. The page follows the device to the new address after saving. Checked: DHCP -> static .245 (PTP, TX, SAP, SDP origin, mDNS on the new address) -> DHCP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -417,7 +417,15 @@ async function save(e) {
|
||||
const c = read();
|
||||
c.aes67.session_ver = (Number(cfg.aes67?.session_ver) || 0) + 1; // SDP version bump per RFC 4566
|
||||
await api('POST', '/api/config', c);
|
||||
// A changed IP setup reboots the device: follow it to the new address.
|
||||
const addr = n => n.dhcp ? 'dhcp' : [n.ip, n.mask, n.gw, n.dns].join('/');
|
||||
const moved = addr(cfg.net || {}) !== addr(c.net);
|
||||
cfg = c; fill(); msg.textContent = 'Saved.';
|
||||
if (moved) {
|
||||
const to = c.net.dhcp ? location.host : c.net.ip;
|
||||
msg.textContent = `Rebooting with the new IP setup. Opening http://${to}/ in 20 s.`;
|
||||
setTimeout(() => location.href = `http://${to}/`, 20000);
|
||||
}
|
||||
}
|
||||
|
||||
// PTP display follows the Riedel (Bolero/Artist) status layout, IEEE 1588-2019 terms.
|
||||
|
||||
Reference in New Issue
Block a user