# Changelog

All notable changes to **snetaid** are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.5.21] - 2026-08-14

### Fixed

- Hotplug stopped after "Physical connection detected": link-up netlink bursts
  kept resetting the 500 ms defer timer so connect never ran. Connect now
  starts immediately; carrier/IP waits stay in the async task.

## [1.5.20] - 2026-08-14

### Fixed

- Hotplug saw "Physical connection detected" but did not connect: do not block
  later hotplug with a stuck GTK connect flag; track carrier-down on every
  unplug; cancel in-flight hotplug tasks on disconnect.

## [1.5.19] - 2026-08-14

### Fixed

- Hotplug reconnect no longer fails with "Configuration error for eth0" while
  GTK connect works: hotplug now uses the same async ifup, carrier wait, and
  IP retry sequence as `wired_connection` ubus.

## [1.5.18] - 2026-08-14

### Fixed

- Hotplug works again after boot and after physical cable replug: software
  disconnect blocks auto-reconnect only while the cable remains plugged; unplug
  then replug restores hotplug. Hotplug connect success clears stale flags.

## [1.5.17] - 2026-08-14

### Changed

- Hotplug suppression is stateful: active only after intentional disconnect
  (`ifdown` via GTK) and cleared when `wired_connection` succeeds. Physical
  cable events work normally once connected again.

## [1.5.16] - 2026-08-14

### Fixed

- Software disconnect leaves the interface administratively UP again; hotplug
  suppression (not admin DOWN) prevents unwanted auto-reconnect.

## [1.5.15] - 2026-08-14

### Fixed

- GTK/software `disconnect`: no longer raises the link after teardown (avoids
  immediate netlink hotplug reconnect attempt while cable stays plugged).
- Suppress netlink hotplug during ubus disconnect/connect so GTK `wired_connection`
  does not race the synchronous hotplug `wired_connection()` path.
- `wired_connection` ubus accepts administratively DOWN interfaces (raises link
  before ifup).

## [1.5.14] - 2026-08-14

### Fixed

- Ethernet hotplug: `wired_connection()` and `wireless_connection()` passed
  `"/dev/null/"` to `posix_spawn` stderr (ENOTDIR); `ifup`/`ifdown` never ran
  and GTK showed "Configuration error for eth0" on cable replug.
- Run `wired_disconnect()` on carrier loss (kill dhcpcd, `ifdown --force`,
  flush addresses) so the next plug matches the WiFi reconnect path.
- Defer netlink hotplug `ifup` by 500 ms after carrier-up.

## [1.5.12] - 2026-06-04

### Fixed

- Restore writes to `/var/log/netaid_events.pipe` from `log_netlink_event()` so
  **simple-netaid-gtk** VTE (`cat` on the FIFO) shows netlink messages again.
- Create the events FIFO at netlink init when missing.
- UI notify (`SIGUSR1`) and ubus `network.log` events are still emitted when
  `ctx` is unavailable; only the ubus broadcast is skipped in that case.

## [1.5.11] - 2026-06-03

### Fixed

- Build on systems where `IFF_LOWER_UP` is not in `<net/if.h>`: include
  `<linux/if.h>` with a fallback definition in `netlink_monitor.c`.

## [1.5.10] - 2026-06-03

### Fixed

- WiFi task cancellation no longer signals the wrong PID (`ifup_proc` vs `wpa_supplicant`).
- INI parser reports allocation failures instead of silently skipping fields.
- `config_load_from_args` updates the `config_t` instance passed by the caller.
- `get_fullpath` uses bounded `snprintf` instead of unbounded `strcpy`/`strcat`.
- Netlink receive buffer sizing honors the requested `bufsize` and logs old/requested/actual sizes.

### Removed

- Unused WiFi helpers (`real_ifup_launch`, `get_wpa_status`, `check_auth_cb`,
  `check_final_ip_cb`, `wpa_launcher_done_cb`) and commented-out `wpa_process_cb` stub.

### Changed

- `BUGS.md` audit table marked complete for BUG-002 and BUG-026–036.

## [1.5.9] - 2026-06-03

### Fixed

- Use-after-free when uninstalling a WiFi profile in use (`uninstall_saved_wifi`).
- Double `ubus_complete_deferred_request` and unsafe task teardown in wireless connection flow.
- Null dereference when `passwd` is omitted in `wireless_connection` ubus calls.
- Open-network config could be written outside allowed directories.
- Netlink crash when `IFLA_MTU` attribute is missing.
- Ethernet hotplug did not reconnect after cable unplug/replug (`shall_connect`).
- `iwlist()` called `exit()` and could terminate the daemon on scan failure.
- WiFi scan buffer overflow and uninitialized Quality field in JSON output.
- Configuration file (`snetaid.conf`) was never loaded; CLI flags now override INI values.
- Interface names (`eth0`, `wlan0`) were incorrectly turned into `/tmp/eth0` paths.
- Default lockfile path had a leading space (`" /run/..."`).
- Zombie child in `append_wpa_config` when `malloc` fails.
- `get_pid_t()` crash when pidfile path is unset.

### Changed

- `task->path` enlarged to 1024 bytes; WPA config files use mode `0600`.
- Cancel any active connection task before starting a new one (`cancel_active_task`).
- Hotplug deferred via uloop; netlink socket non-blocking with message drain.
- Bounded netlink log buffers (`nl_msg_append`); discard truncated netlink packets.
- Safer signal shutdown; `kernel_init` failure stops daemon startup.

### Added

- `BUGS.md` — static audit report with tracked defect IDs.

## [1.5.8] - 2026-03-10

### Fixed

- Segmentation fault when evaluating `iproute()`.

## [1.5.7] - 2026-01-25

### Changed

- Minor changes in the policy module.

## [1.5.6] - 2024-12-24

### Fixed

- Clear IP addresses on interfaces before connecting to a selected device.

## [1.5.5] - 2024-05-04

### Changed

- Active WiFi scan results sent in JSON format.

[1.5.12]: https://genuen.org/snetaid/compare/v1.5.11...v1.5.12
[1.5.11]: https://genuen.org/snetaid/compare/v1.5.10...v1.5.11
[1.5.10]: https://genuen.org/snetaid/compare/v1.5.9...v1.5.10
[1.5.9]: https://genuen.org/snetaid/compare/v1.5.8...v1.5.9
