| Age | Commit message (Collapse) | Author |
|
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.
|
|
T9477: remove no longer needed executable bit from conf_mode/migration scripts
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
This reverts commit 22cfee116c9935f4a33da4923eff189f2f646371.
|
|
This reverts commit 4b92c2fe6f9928a1ff126c92e89e993de17fb0f5.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
T8329: Fix interface naming for Azure VF interfaces with Accelerated Networking enabled
|
|
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.
|
|
interfaces during hw-id naming
These interfaces include the Azure VF interfaces which share the same mac address with their master synthetic interface
|
|
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
|
|
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.
|
|
|
|
`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.
|
|
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.
|
|
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.
|
|
Fix typos and mistakes
No functional changes
|
|
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.
|
|
|
|
T7852: Switch to yescrypt password encryption
|
|
|
|
Accidentally slipped in 2 whitespace corrections
|
|
kea: T6211: add VRF support for KEA dhcp server
|
|
|
|
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
|
|
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.
|
|
found using "git ls-files *.py | xargs pylint | grep W0611"
|
|
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.
|
|
|
|
* Fix route deletion errors when interface is missing. Clarify variable names.
|
|
|
|
|
|
|
|
|
|
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.
|
|
GRUB defaults to 9600 in case of serial console; explicitly set to
115200.
|
|
|
|
|
|
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
|
|
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
|
|
|