| Age | Commit message (Collapse) | Author |
|
No functional change, pylint reported a used-before-assignment as it
does not know the other branch exits.
|
|
The show_commit_data and test_commit wrappers were removed by commit
09cb7801d790 ("T7272: drop test functions"), but the helper scripts using
them were left behind and failed on import.
|
|
The /config-file endpoint wrote config strings to /tmp/config.file,
readable by any local user and never removed. A file pre-created at
that path by another user made every later request fail.
The string now goes to a private temp file that is always removed.
The load and merge helpers, and the vyconf session, also remove their
own /tmp copy when loading raises, e.g. on a syntax error.
|
|
Radios were taken out of the mapping file, as every interface on a phy
carries that phy's address and there is nothing there to anchor a name to.
The rescan still took its whole list from that file, so no radio was left in
it and none ever got a node - a fresh boot with a card present no longer
wrote its physical-device, and the branch which does that became unreachable.
Take radios from the system instead. A configured radio was unaffected,
keeping the node it already had.
|
|
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.
|
|
|
|
firewall: T9474: multiple issues in rule processing (time based rules, fragment matching and failing commits)
|
|
nft converts hour matches to UTC when the ruleset is loaded, using the
offset of that moment. After a daylight saving change, or a change of the
system time-zone, every hour window was off until the next firewall commit.
- A new helper loads only the rules with an hour match again, in place, so
sets such as dynamic, domain and GeoIP groups and all counters are kept.
It is scheduled as a systemd timer for the next UTC offset change and
re-arms itself; firewall and policy route commits arm or remove it.
- Changing the time-zone re-runs firewall and policy route.
The smoketest moves the clock to just before a change in Europe/Berlin and
checks that the window is refreshed and a dynamic group entry survives. It
only runs in the smoketest harness, as it changes the system clock.
|
|
The WAN load-balancing ruleset only deleted the existing table when its
rule file in /run was present. A table removed while the file stayed made
the delete, and with it the ruleset reload, fail.
The table is now declared right before it is deleted, so each reload
rebuilds it regardless of what is currently loaded.
|
|
Every commit touching WAN load-balancing - or any firewall group - restarted
the health daemon. Until it was back, its rules, routes and ip rules were
gone: new connections were neither balanced nor source NATed. The health
state was reset as well, an interface known to be down got new connections
until its failure count was reached again.
A commit now reloads the daemon. It waits for the commit to finish, then
replaces its rules in one transaction and only adds or removes the routes
and ip rules of changed interfaces. Interfaces staying configured keep
their health state.
|
|
The routing table and mark of a WAN interface followed its position in the
sorted interface list. Adding an interface which sorts before the others
renumbered all of them. Existing connections still carried their old mark
in conntrack and were routed into the wrong table - they broke.
Every interface now keeps its table as long as it stays configured, new
interfaces get the lowest free table. The assignment is dropped once WAN
load-balancing is removed.
|
|
On start the health daemon forces a state change so the hook learns the
initial state of the WAN interfaces. The flag doing so was reset after the
first interface, every other interface was only reported once its state
actually changed.
The flag is now reset after all interfaces have been checked. The existing
hook smoketest relied on the old behaviour: it now keeps all hook events
and no longer reads a file left over from an earlier run.
|
|
The ttl test considered the interface healthy whenever ping failed. A dead
uplink, where nothing answers, therefore stayed ACTIVE, while a target
answering the ping marked the interface FAILED.
The test now passes if the hop where the TTL runs out reports it, or if the
target is closer and answers itself. If nothing answers within resp-time,
the test fails.
|
|
"inbound-interface any", offered by completion, was rendered as an
interface literally named "any" and matched no packet, so the rule never
balanced anything.
It now matches traffic entering on any interface except the WAN interfaces
themselves. Matching those as well would also restore the routing mark on
replies arriving from an ISP and send them straight back to that ISP.
|
|
The health daemon read its configuration with tag node values mangled, so
an interface such as "wlb-isp1" became "wlb_isp1". The daemon then checked
an interface which does not exist, marked it FAILED and never installed
its routes - the interface was never used.
The smoketest gains a traffic lab: a LAN and one ISP per WAN interface in
network namespaces, every ISP answering on the same address with its name
and the source address it sees.
|
|
frrender: T9454: render FRR after a DHCP lease only once the commit completed
|
|
dhcp: T9108: restart dhclient when unicast RENEW is overdue
|
|
A lease event during a commit rendered FRR from the active configuration, which
the commit has not replaced yet. When the lease arrived after the commit's own
FRR render but before the commit finished, the stale render was applied and
nothing corrected it: moving a DHCP interface into a VRF left the VRF without
its default route.
The lease hook now starts the render detached and the render waits for the
running commit to complete. Detaching is required, as a commit stopping the
DHCP client waits for the release hook. Waiting is opt-in, as the commit itself
uses the same helper when it cannot reach the configuration daemon.
|
|
Reconciling the FRR configuration after a DHCP lease event was requested from
the configuration daemon over the socket the commit pipeline uses. The daemon
serves one client at a time and assumes it is the running commit, so
the request either landed in the middle of the handshake which hands over the
configuration, or kept the daemon busy past the 10ms a commit waits for it.
Either way the commit fell back to running the conf-mode scripts directly.
Those never render FRR, only the daemon does, so the commit succeeded while FRR
kept the configuration rendered before it, until the next lease event.
A lease event now renders FRR in its own process, and a commit which could not
use the daemon renders FRR itself instead of skipping the reload. Both take the
same lock. A commit post-hook would remove the second case, for a full render
on every commit.
|
|
is_systemd_service_active, directories['isc_dhclient_dir'], rc_cmd,
read_file/write_file for cooldown (skip restart if the marker cannot
be written). Drop unused rebind from the lease-time regex. Shorter
postinst enable/start for the timer.
|
|
A successful restart followed by a failed state-file write left no
marker, so the next 5-minute tick restarted the same client again.
Write the cooldown first and skip the restart if it cannot be
recorded; unlink the marker if the restart itself fails.
|
|
debian/rules copies src/helpers/* into usr/libexec/vyos, but
debian/vyos-1x.install only shipped *.py and *.sh. The extensionless
watchdog was missing from images while its systemd unit and timer
were installed, so the timer failed with ENOENT.
Also drop the iface.endswith('v6') skip: VyOS IPv6 DHCP is dhcp6c,
not a dhclient_*v6.conf file.
|
|
|
|
- Parse ISC default lease civil times as UTC (not host local)
- Write cooldown state only after a successful systemctl restart
- postinst: log timer enable/start failures instead of silent || true
|
|
ISC dhclient can sit in unicast RENEW to a server that has lost the
session until the lease expires (hours), with the modem link still up.
That is distinct from T9085 (successful RENEW that does not reinstall a
missing default).
Add a lightweight oneshot helper and systemd timer (every 5m) that parses
each active interface ISC lease DB: if renew is more than 15 minutes in
the past while expire is still in the future, restart dhclient@iface
(30m cooldown). Enable the timer from the package postinst.
|
|
/etc/cron.d/vyos-wwan re-ran the conf_mode script every 5 minutes via
op-mode "connect interface wwanN" to re-establish a session lost to RF
signal loss. Re-entering conf_mode from cron is unsafe: the cron job knows
nothing about the boot commit or about a commit in flight, so when a tick
lands before the running config is populated, get_config() returns nothing
but {'ifname', 'deleted'} and apply() takes the teardown branch instead of
dialling. It then stops the DHCP clients, stops ModemManager and unlinks its
own cron file, leaving wwan0 down with no way to recover until the next
commit:
CRON[1869]: (root) CMD (/usr/libexec/vyos/vyos-check-wwan.py)
systemd[1]: Stopping DHCP client on wwan0...
systemd[1]: Stopping Modem Manager...
This is timing dependent - it only bites when a */5 tick coincides with
boot - which is why it presents as an intermittently dead WWAN interface.
Move the re-dial into vyos-netlinkd, which already tracks these interfaces
for DHCP and already gates all of its work behind boot_configuration_complete()
and commit_in_progress2(). A re-dial can therefore no longer land on a
half-applied configuration. It also dials ModemManager directly rather than
re-entering conf_mode, so the teardown branch is no longer reachable from
the recovery path at all.
|
|
wan-load-balance: T9145: add health script interface env
|
|
- Replaced direct file reads from `/proc/cmdline` with `get_kernel_boot_arg()`
for fetching kernel command-line arguments in multiple modules.
- Improved memory information retrieval by utilizing `get_memory_info()`.
|
|
|
|
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.
|
|
shutil.copytree() defaults to symlinks=False, so it recurses into
symlinked directories and recreates them as real directories instead
of preserving the symlink.
cloud-init creates /opt/vyatta/etc/config/cloud/instance as a symlink
to instances/i-<id>. Enabling/disabling config encryption copied this
tree with copytree() and silently turned that symlink into a real
directory, causing cloud-init to fail on later runs with:
IsADirectoryError: [Errno 21] Is a directory: '.../cloud/instance'
Pass symlinks=True to preserve symlinks during the copy.
|
|
Reaches a clean typos baseline for the T8490 ruleset pilot. Categories:
- Comments/docs: recursivly, taret, passsed, characted, arhive, AtrributeError;
"ned" -> "new" (migration comments).
- Messages/strings: writeable -> writable (x5); OCaml log "Commandis" -> "Command is".
- Local variables (all refs in-function): commited, formating, presistent;
inpt_range -> input_range; tz_datas -> tz_data_raw (avoids the tz_data collision).
- Self-contained renames (definition + all references in-file): formated_stats,
_get_formatted_output_conections -> ..._connections, expension_failure ->
expansion_failure (ping + traceroute), snmpd_restart_reqired -> ..._required.
False positives are allowlisted centrally (vyos/.github, separate PR), NOT changed
here: mke2fs, Maya-calendar "Mak", RFC 4122 "IDentifier" (hostapd), and VPP's
"U-Forwrd" bridge-domain column header (op_mode/vpp.py + the VPP smoketest assert
the real upstream `vppctl` output). Verified: typos clean, py_compile of every
edited .py, zero remaining old-identifier references.
🤖 Generated by [robots](https://vyos.io)
|
|
|
|
|
|
|
|
WLB per-interface routing tables only contain a default route. When
LAN traffic is fwmarked by WLB nftables rules, ip rule policy routes
it to these tables where internal destinations (BGP, connected, DNAT)
have no matching route and incorrectly exit via WAN.
Add ip rule with table main suppress_prefixlength 0 before each
per-interface table rule. This checks the main routing table first
for specific routes but suppresses the default route, so only
internet-bound traffic falls through to WLB per-interface tables.
Signed-off-by: doctorpangloss <2229300+doctorpangloss@users.noreply.github.com>
|
|
* wan: T8481: scope flush-connections to WLB connection marks
flush-connections runs conntrack --delete which destroys all conntrack
entries system-wide, including unrelated NAT translations and
established connections that have nothing to do with WLB.
WLB tags every connection it manages with a conntrack mark via the
wlb_mangle_isp_<ifname> chain (ct mark set 0xc9, 0xca, etc.). Scope
the flush to these marks so only WLB-managed connections are affected.
Signed-off-by: doctorpangloss <2229300+doctorpangloss@users.noreply.github.com>
* wan: T8481: replace conntrack deletion from state changed block
---------
Signed-off-by: doctorpangloss <2229300+doctorpangloss@users.noreply.github.com>
Co-authored-by: doctorpangloss <2229300+doctorpangloss@users.noreply.github.com>
|
|
Introduce src/helpers/write-config-file-value.py to patch a saved config.boot
from scripts by writing a quoted CLI path with an optional value (omit --value
to create a valueless node).
Extend vyos.utils.config.write_saved_value() to safely update saved configs:
create missing parent nodes before tagging (ConfigTree.set_tag requires nodes
to exist) and then write the requested value/valueless leaf back to disk.
Remove the legacy serial console activation script which is now replaced by the
helper-based approach. The helper is run once during ISO Image assembly and will
inject the approprate serial console defintiions into config.boot.default.
|
|
|
|
Fix typos and mistakes in the commands and comments
No functional changes
|
|
|
|
geoip: T7926: T8049: Refactor geoip code and add MaxMind support
|
|
Large config commits (`service config-sync`) can block the REST API request
path and sometimes must be deferred (e.g., when changing `service https`).
This commit introduces an in-memory background operation manager
that queues (FIFO) full configure operations (commands + commit/commit-confirm)
as single jobs, tracks status/result, and exposes active operations
via `/retrieve/background-operations`.
|
|
|
|
* Move core logic to separate vyos.geoip module
* Use a sqlite database for storing and querying address ranges by country
* Remove downloaded geoip ranges once loaded into sqlite db
* No longer rebuild geoip sets on each commit unless necessary
* Allows for extensibility using other geoip data vendors
|
|
T8146: Confirm the key when config encryption is configured without TPM
|
|
|
|
|