summaryrefslogtreecommitdiff
path: root/src/system
AgeCommit message (Collapse)Author
2026-11-12keepalived: T9615: only ignore EAGAIN when reading the FIFOChristian Breunig
Any exception without an errno attribute raised an AttributeError inside the handler instead of being logged. EAGAIN is now caught on its own and everything else is logged.
2026-11-02Merge pull request #5588 from c-po/no-exec-bitChristian Breunig
T9477: remove no longer needed executable bit from conf_mode/migration scripts
2026-10-31interfaces: T3871: give a re-created Hyper-V NIC the name of the NIC it replacedAlex Kudentsov
A Hyper-V NIC is known by its MAC alone. One deleted and created again on the same VM - an Azure NIC re-created, or a Hyper-V adapter removed and added - comes back with a new MAC, so nothing on it matched the store: its name stayed reserved, the new NIC got a new name, and its configuration was left on a name with no NIC. cloud-init does not run again on the same instance, so nothing else repairs it. At boot, a vacant name now goes to a new NIC only when the pairing is not in doubt: - exactly one recorded name has no NIC, and exactly one new Hyper-V NIC appeared. With more of either, the order the NICs come up in does not say which replaced which, so nothing is handed over and the names stay reserved, as before; - the name went missing at this pass. The store records which names were missing at the last pass, so a NIC removed for good does not hand its name to a NIC added at a later boot; - the name's own NIC was a Hyper-V one. The store records which names sat on a Hyper-V NIC; a MAC-keyed name can belong to other hardware, and a store written before this was recorded hands nothing over (the boot pass logs that when it holds a name back); - only at boot. On a running system the configuration under a name is not applied to the NIC that takes it, so the hotplug unit passes --hotplug, which names the new NIC like any other and records the vacant name as missing, so the next boot does not hand it over either. An adoption is logged as a warning, reported under 'adopted' in the status file (kept there across hotplug passes while it holds), and repeated by vyos-router, as a slot match is: verify the port before relying on its configuration.
2026-10-31interfaces: T3871: keep an accelerated-networking VF off its NIC's .link fileAlex Kudentsov
On Azure every Hyper-V NIC shares one ID_PATH and has no slot, so it is keyed on its MAC. Its accelerated-networking VF carries the same MAC and matched the NIC's .link file, so udev tried to give the VF the NIC's name. The .link file of a Hyper-V NIC now also matches Driver=hv_netvsc, so the VF cannot match it. This holds for a lone NIC keyed on the VMBus path too. A NIC absent at a pass cannot say what it is, so its file keeps the pin it already carries. NICs that are not Hyper-V ones get no Driver line, and their files do not change. The 34-to-35 migration passes the hardware it found, so the pin is written on the first boot of an upgrade too.
2026-10-31interfaces: T3871: never rename an interface which is in useChristian Breunig
Editing the map and then plugging any card in applied the edit to every interface at once, because the pass re-resolves the whole system whatever woke it. A running port was renamed out from under the configuration still naming it, a bridge member included since members became discoverable. Leave a name alone while the system is relying on it - the port is up, or it has a master. At boot that is true of nothing, as the pass runs before the configuration is applied, so naming is unaffected; afterwards it is true of everything configured, and a card which has just arrived is still down. Say in the log and the status file when a rename was refused, as the map and the running system then disagree until the next boot.
2026-10-31interfaces: T3871: report a name which changed hands between known cardsChristian Breunig
Cards rearranged among themselves, or a map edited by hand, leave every name matched to a card the store knows - just not the one it had. That was filed as an ordinary match, indistinguishable from a machine where nothing moved, while the addresses configured under those names had quietly changed cable. Report it separately. Which name goes to which card is unchanged, the slot still decides; only the account of what happened is.
2026-10-31interfaces: T3871: warn about a replaced card when it is swapped, not only ↵Christian Breunig
at boot A card which takes over a slot also takes over the addresses configured under that name. The boot script says so by reading the status file, but a card swapped on a running system is only ever seen by the naming pass itself, and by the next boot it is already on record with nothing left to report. The warning could therefore never reach an operator who replaced a card without rebooting. Log it where the decision is taken, which covers both.
2026-10-31interfaces: T3871: name a card by the card, not only by the slot it sits inChristian Breunig
The map now records which card each name sat on. A card moved to another slot keeps its name rather than leaving it behind for whatever turns up next, and the slot it vacated does not lend that name out. Where the map and the hardware disagree, the map wins: a card the store already knows, found in a name's slot, takes that name. Only a card nothing knows about, sitting in a slot on record, is treated as a replacement - the one case which can quietly move a configured address onto another cable.
2026-10-31interfaces: T3871: name interfaces from a slot-anchored mapping storeChristian Breunig
Names used to be derived from 'hw-id' in config.boot. A node carrying an address but no hw-id had to be matched to some NIC, and nothing available at boot could say which one - every heuristic could bind a configured address to the wrong physical wire. Naming authority moves to a mapping store binding a name to the slot the hardware occupies. The slot is the identity, so a replacement card in that slot is that interface again. The store renders systemd .link files, leaving udev to apply names as devices appear.
2026-10-31Revert: T3871: make boot-time interface naming deterministic and hw-id awareChristian Breunig
This reverts commit 22cfee116c9935f4a33da4923eff189f2f646371.
2026-10-31Revert: T3871: never guess a pending node's hardware when ambiguousChristian Breunig
This reverts commit 4b92c2fe6f9928a1ff126c92e89e993de17fb0f5.
2026-10-24T9477: remove no longer needed executable bit from conf_mode scriptsChristian Breunig
With the full integration of vyos-configd, conf_mode scripts are loaded as Python modules and are no longer meant to be executed individually. Drop the executable bit and the now meaningless shebang. The remaining callers that ran a script directly (boot, op-mode, dhclient hook, vyshim fallback, ...) now invoke it through python3. The build now aborts if a conf_mode script is executable.
2026-09-15keepalived: T9256: keep incomplete FIFO lines between reads (#5430)Daniil Baturin
pipe_wait() reads at most 500 bytes per iteration and keeps no residual buffer between them. A VRRP transition involving enough instances emits more than that in a single burst, so a read lands mid-line: the tail of one chunk is queued as an incomplete fragment and the head of the next chunk as another. The dispatcher then fails to match the notify regex on both halves and silently runs no transition script. Observed on a pair with 14 instances in one sync group, where "GROUP" arrived as "ROUP" because the leading character ended the previous read. Hold the incomplete trailing line and prepend it to the next read, so only whole lines reach the queue. Only signal the processing thread when at least one complete line was queued.
2026-09-09interfaces: T9269: do not run the hw-id naming pass in a containerChristian Breunig
Container interfaces are veth pairs created by the runtime. They have no backing bus device in sysfs, so discover_physical_interfaces() never considers them, and their MAC is assigned by the host and regenerated on every start. A pending node could thus never be resolved. The pass only spent both bounded hardware waits and then asked for an hw-id that would not survive a restart: interface 'eth0' still has no hw-id configured after this boot's naming pass - bind it manually, e.g. ... Returning before write_status() leaves no status file behind, so warn_missing_interface_hardware() in vyos-router stays quiet by itself. setUpModule() pins the detection off for the test module - the build container would otherwise short-circuit every existing main() test.
2026-09-07T8497: vyos-system-update-check: fix vulnarabilityKyrylo Yatsenko
vyos-system-update-check.py was using data from untrusted source to pass to shell without escaping. Change to list in call to `call` to fix this.
2026-08-27keepalived: T9256: keep incomplete FIFO lines between readsrockfish-vyos
pipe_wait() reads at most 500 bytes per iteration and keeps no residual buffer between them. A VRRP transition involving enough instances emits more than that in a single burst, so a read lands mid-line: the tail of one chunk is queued as an incomplete fragment and the head of the next chunk as another. The dispatcher then fails to match the notify regex on both halves and silently runs no transition script. Observed on a pair with 14 instances in one sync group, where "GROUP" arrived as "ROUP" because the leading character ended the previous read. Hold the incomplete trailing line and prepend it to the next read, so only whole lines reach the queue. Only signal the processing thread when at least one complete line was queued.
2026-08-20Merge pull request #5338 from ritika0313/T8329-azure-interface-naming-fixJohn Estabrook
T8329: Fix interface naming for Azure VF interfaces with Accelerated Networking enabled
2026-08-15T3871: never guess a pending node's hardware when ambiguousChristian Breunig
Reported against the previous PCIe/MAC-sorted replacement fill: on a real, already-provisioned box (hw-id from historical probe-order rescan, unrelated to any PCIe/MAC sort), a configured node's address ended up silently applied to a different physical NIC. Deleting one interface's hw-id (keeping its settings) while a different, unrelated interface's config was fully removed in the same boot was enough - the two freed candidates' MAC order didn't match their old name order, so the deterministic sort swapped them. Once written back by the rescan helper, the wrong binding became permanent and self-reinforcing on every later boot. There's no way to verify, from MAC and PCIe position alone, which of several unconfigured candidates is genuinely a given node's own hardware once its hw-id is gone. Restore strict matching: a node only recovers its hw-id automatically when it's the sole pending node of its type this boot and exactly one candidate exists - any other count leaves it pending and reported rather than guessed. A candidate that isn't matched this way is not otherwise held back - it still gets an ordinary, settings-free bootstrap name instead of being lost, just never inherits another node's configuration. This necessarily changes what a combined "delete one interface fully, clear a different one's hw-id" reboot can auto-resolve; the accompanying test-harness change acknowledges that trade-off explicitly.
2026-08-14T8329: Skip enslaved interfaces to be considered as independent physical ↵Ritika Chopra
interfaces during hw-id naming These interfaces include the Azure VF interfaces which share the same mac address with their master synthetic interface
2026-08-08T3871: make boot-time interface naming deterministic and hw-id awareChristian Breunig
Multi-vendor PCIe NIC systems could lose or rename Ethernet/wireless interfaces on boot, because naming was decided from a single per-device udev event before all hardware had a chance to enumerate. Replace that with one authoritative pass, run once configuration is available during router startup: wait for configured hardware, apply every hw-id binding, and name whatever has none yet by PCIe distance from the root complex and MAC address - the same result every boot. A node with its hw-id deleted (NIC replacement) or its whole configuration removed is treated as an ordinary open slot, filled the same way - recovering its original hardware whenever the interfaces that vacated slots this boot also show up as candidates. Boot now reports any interface still unresolved, and the pass is covered by a new test suite in vyos-build named: make testifname Assisted-by: Claude:claude-sonnet-5
2026-07-17utils: T9008: migrate remaining cmd() callers to cmdl() and remove cmd()Christian Breunig
Complete the safer-subprocess migration started by the cmdl()/ifconfig refactoring and convert every remaining vyos.utils.process.cmd() call site to the list-based cmdl(). Drop the vyos.utils.process.cmd() implementation as it is no longer in use.
2026-07-13T9079: Fix IPv6 address in DHCP log messagessysteembeheerder
2026-06-15password-reset: T8985: Fix unbounded `sed` ranges corrupting other user blocksOleksandr Kuchmystyi
`sed` ranges keyed on a field name (`plaintext-password`, `encrypted-password`, `authentication {`) are not bounded to the target user's block. When the field is absent the range stays open past the user's closing brace and matches the first occurrence of that field in a later account.
2026-06-04password-reset: T8346: Fix password recovery when only `plaintext-password` ↵Oleksandr Kuchmystyi
is set When a user account was provisioned with only `plaintext-password` (e.g. via cloud-init), the password recovery tool failed to persist the new password across reboots. On the next boot, VyOS would re-apply the `plaintext-password` from config.boot, silently overwriting the recovered encrypted password.
2026-05-22snmp: T8538: Persist engineBoots counter across rebootsOleksandr Kuchmystyi
Per RFC 3414 section 2.2 (Replay Protection), the `snmpEngineBoots` counter must be stored in non-volatile storage and incremented on every snmpd restart. VyOS was not persisting this value, causing it to reset to 1 after every reboot. SNMP managers cache the engineBoots value from previous sessions. When VyOS resets the counter to 1 after reboot, managers reject incoming SNMPv3 trap packets as "too old", producing errors such as: ``` usm: Message too old. reboot count invalid ``` This change introduces `/config/snmp/engineboots.count` as a disk-backed persist file and it uses to sync the counter into snmpd's conf before the daemon starts.
2026-03-27T8410: Fix typos and mistakes for comments and messagesViacheslav Hletenko
Fix typos and mistakes No functional changes
2026-02-10update-check: T7945: Improve reliability during early boot and error handlingOleksandr Kuchmystyi
During early boot not all resources are ready for HTTP request, so `vyos.version.get_remote_version` may fail once and the update check is then delayed for 12 hours, leaving the router unaware of updates. Fix by adding retries/backoff and improved error handling so transient startup network failures don't suppress update checks for the next interval.
2025-11-12misc: T8008: remove the last remnants of pmacctDaniil Baturin
2025-10-02Merge pull request #4739 from roedie/T7852Daniil Baturin
T7852: Switch to yescrypt password encryption
2025-09-23kea: T7854: Use helper for Kea VRF systemd unitssarthurdev
2025-09-20T7852: Switch to yescypt for password encryptionroedie
Accidentally slipped in 2 whitespace corrections
2025-08-19Merge pull request #4508 from davi2367/vrf-dhcpDaniil Baturin
kea: T6211: add VRF support for KEA dhcp server
2025-08-15kea: T6211: add VRF support for KEA dhcp serverDavid Vølker
2025-06-28T7591: remove copyright years from source filesChristian Breunig
The legal team says years are not necessary so we can go ahead with it, since it will simplify backporting. Automatically removed using: git ls-files | grep -v libvyosconfig | xargs sed -i -E \ 's/^# Copyright (19|20)[0-9]{2}(-[0-9]{4})? VyOS maintainers.*/# Copyright VyOS maintainers and contributors <maintainers@vyos.io>/g' In addition we will error-out during "make" if someone re-adds a legacy copyright notice
2025-02-17dhcp: T6948: Keep DHCP server leases in sync with hostd recordsIndrajit Raychaudhuri
Keep DHCP server leases in sync with vyos-hostd records via helper script invoked with `ExecStartPost` directive in kea-dhcp4-server.service. The helper script updates VyOS hostd records from DHCP server leases. This ensures that hostd records with the DHCP server leases are kept in sync with VyOS hostd records right after DHCP server is started. This is similar to the capability exposed via kea hook `libdhcp_run_script.so` which is invoked internally by kea when a single lease changes state. Since the kea hook is currently implemented for DHCPv4 only, this helper script is implemented for DHCPv4 only as well.
2024-04-03T6199: drop unused Python importsChristian Breunig
found using "git ls-files *.py | xargs pylint | grep W0611"
2024-03-13grub: T4548: Fixed configuration files orderzsdc
To iterate files on ext* file systems GRUB reads their inodes one by one, ignoring names. This breaks our configuration logic that relies on proper loading order. This commit adds a helper `sort_inodes()` that needs to be used whenever GRUB configuration files are created. It recreates files, changing their inodes in a way where inodes order matches alphabetical order.
2024-02-19event-handler: T6048: handling exception when _PID is not foundgavol
2024-01-25Updates to Kea DHCPv6 PD route hook (#6)Chris Buechler
* Fix route deletion errors when interface is missing. Clarify variable names.
2024-01-24dhcp: T3316: Fix header on scriptsarthurdev
2024-01-24dhcpv6: T3771: Allow installation of routes for delegated prefixessarthurdev
2024-01-19dhcp: T5948: Strip trailing dot, detect if hostname is FQDNsarthurdev
2024-01-17dhcp: T5948: Strip trailing dot from hostnamessarthurdev
2024-01-12image-tools: T5923: update system_console.py for new GRUB file structureJohn Estabrook
Add util function to set serial console speed in accordance with revised GRUB file structure; in keeping with the intentions of the config_mode script, adjust the GRUB var 'console_speed' to only modify ttyS0.
2024-01-11image-tools: T5910: explicitly set transmission speed of serial consoleJohn Estabrook
GRUB defaults to 9600 in case of serial console; explicitly set to 115200.
2024-01-10dhcp: T3316: Workaround to append domain suffix to hostfile entriessarthurdev
2024-01-10dhcp: T5912: Fix hostfile not written for new leasessarthurdev
2023-12-31T5474: establish common file name pattern for XML conf mode commandsChristian Breunig
We will use _ as CLI level divider. The XML definition filename and also the Python helper should match the CLI node. Example: set interfaces ethernet -> interfaces_ethernet.xml.in set interfaces bond -> interfaces_bond.xml.in set service dhcp-server -> service_dhcp-server-xml.in
2023-12-17dhcp: T3316: Adjust dhcp-run script to align with kea hooksIndrajit Raychaudhuri
The hook arguments passed to `on-dhcp-event.sh` have changed in Kea. Adjust the script to align with the new arguments. Additionally, remove FQDN mangling from the script. No need to extract the domain name from `LEASE4_HOSTNAME` only to append it again. See: https://kea.readthedocs.io/en/latest/arm/hooks.html#hooks-run-script
2023-12-08dhcp: T3316: Migrate dhcp/dhcpv6 server to Keasarthurdev