Commit Graph
30 Commits
Author SHA1 Message Date
Alex MelanandGitHub dd056e006c fix: avoid panics on edge-case input across modules (#1343)
## Summary
- ipv6rwc: validate IPv6 packet length before reading the version nibble
in writePC
- config: guard the BOM check against configs shorter than two bytes
- admin: replace unchecked net.Error type assertion with errors.As;
tolerate empty unix socket paths
- multicast: log and continue on ReadFrom errors instead of panicking;
use checked type assertion on UDPAddr
- mobile: reject negative length in SendBuffer; nil-check AddrForKey in
GetPeersJSON and SummaryForConfig
- admin/get{tree,paths,sessions}: skip entries when AddrForKey returns
nil instead of dereferencing
- core/nodeinfo: validate the requested public key length in
nodeInfoAdminHandler, matching the other proto handlers
- add regression tests for the panic paths

## Why
A handful of error paths and platform-API edge cases reach fixed-size
indexing or unchecked type assertions before any length validation.
Most are reachable only locally (an empty config piped to -useconf,
a 0-byte packet from the mobile bindings, an admin DialTimeout error
that doesn't satisfy net.Error on some platforms), but they crash the
daemon hard. Have them return errors or skip the entry instead.

## Testing
- go test ./...
- go vet ./...
2026-05-12 21:42:57 +01:00
Neil Alexander 5b8dbc8b1e Add summary helpers to mobile wrapper 2025-03-31 10:18:57 +01:00
Neil Alexander 42873be09b Reusable peer lookup/dial logic 2024-11-17 21:14:54 +00:00
c4b29b735c Link costing based on average RTT (#1171)
This PR updates Ironwood to include the new RTT-based link costing and
updates `yggdrasilctl` to report the cost in `getPeers`.

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2024-09-21 22:05:23 +00:00
Paul DonaldandGitHub f56f9c124c Minor Fixes (#1107)
* Minor comment fixes.

* Optimize PeerEntry for memory efficiency

* Improve NodeConfig for memory alignment
2024-05-27 21:57:28 +01:00
Arceliar d17ac39789 update ironwood dependency, add a debug API call for lookups 2023-10-28 05:26:43 -05:00
Revertron 6873fd44ff Fixes logger, adds some log messages. 2023-10-25 20:59:19 +02:00
Neil Alexander 094f80f39c Fix RetryPeersNow, move startup logging, don't set TUN address if not available 2023-10-22 15:51:30 +01:00
6a9493757d mobile: add support for Listen in config (#1063)
Co-authored-by: Neil <git@neilalexander.dev>
2023-10-21 17:33:17 +00:00
Neil Alexander aceb037c57 Fix panic in mobile GetPeersJSON 2023-10-18 22:38:10 +01:00
Neil Alexander 2a21241738 Multicast passwords 2023-10-11 19:28:28 +01:00
Neil Alexander 45b773eade Remove TLS root validation
This is just too complicated compared to the per-peer/per-listener/per-interface password
approach.
2023-10-11 18:25:35 +01:00
NeilandGitHub 9defa35c66 Merge branch 'develop' into future 2023-09-03 13:18:47 +01:00
Neil Alexander c8b9aaeb67 Only set mobile memory limit on supported Go versions 2023-09-03 13:13:53 +01:00
NeilandGitHub 6ab0639b82 Merge branch 'develop' into future 2023-09-03 12:58:55 +01:00
Neil Alexander db9b57c052 Update contrib/mobile for the latest iOS build 2023-06-06 22:11:49 +01:00
Neil Alexander 7afa23be4c Link refactoring, admin socket changes 2023-05-19 19:09:05 +01:00
Neil Alexander c7ea223a9a Update mobile bindings 2023-05-14 10:16:33 +01:00
Neil Alexander a148f4cfec More updates for Ygg v0.5 2023-03-19 10:33:07 +00:00
Neil AlexanderandGitHub 7efd66932f Redial failed connections if possible (#983) 2022-11-12 11:30:03 +00:00
Neil Alexander 590d83aa9c Fix #975 by not exporting uint8 2022-11-01 17:42:52 +00:00
RevertronandGitHub ee33bd248f Added two new methods to mobile package (#974)
* Added two new methods

In order to implement https://github.com/yggdrasil-network/yggdrasil-android/issues/25 we need these new methods.

* Renamed methods, changed comments
2022-11-01 12:10:50 +00:00
Neil AlexanderandGitHub f08dec822a Priority support (#964)
* Allow setting link priorities

* Fix a bug

* Allow setting priority on listeners and multicast interfaces

* Update `yggdrasilctl`

* Update to Arceliar/ironwood#5
2022-10-26 09:24:24 +01:00
Neil AlexanderandGitHub 5ef61faeff Link refactor (#941)
* Link refactoring

* More refactoring

* More tweaking

* Cleaner shutdowns, UNIX socket support, more tweaks

* Actorise links, remove mutex

* SOCKS support
2022-09-17 20:07:00 +01:00
Alexander IvanovandGitHub 414aaf6eb9 Update mobile.go (#942) 2022-09-05 12:55:35 +01:00
Neil Alexander 493208fb37 Refactor multicast setup (isolated config, etc) 2022-09-03 11:42:05 +01:00
ArceliarandGitHub a182fad8d6 Merge branch 'develop' into neilalexander/refactor 2022-08-28 13:39:26 -05:00
f8e626dbe1 Fix Android multicast crash (#930)
* Do not exit on multicast errors (mobile)

* Consistency with cmd/yggdrasil/main.go

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-08-10 22:54:02 +01:00
Neil Alexander 4c889703b1 Continue refactoring 2022-08-06 15:05:12 +01:00
Neil AlexanderandGitHub 6d92edd405 Move src/mobile into main repository (#864)
* Move `src/mobile` into main repository

* Update go.mod/go.sum

* Move to `contrib`, separate mobile build script
2022-01-30 19:48:32 +00:00