mirror of
https://github.com/amnezia-vpn/amneziawg-tools.git
synced 2026-10-13 21:34:42 +00:00
[PR #75] fix: parse tab-delimited dump correctly in wg-json #76
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/amneziawg-tools#76
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amnezia-vpn/amneziawg-tools/pull/75
Author: @HeisLuka
Created: 9/14/2026
Status: 🔄 Open
Base:
master← Head:fix/wg-json-dump-parsing📝 Commits (1)
9a821b7fix: parse tab-delimited AWG dump in wg-json📊 Changes
1 file changed (+16 additions, -7 deletions)
View changed files
📝
contrib/json/wg-json(+16 -7)📄 Description
Summary
Fix
contrib/json/wg-jsonparsing ofawg show all dump.The dump format is tab-delimited, but the script parsed the remainder of each line with the shell's default whitespace
IFS. CPS values such as<b 0x...>,<r 8>and chained I1-I5 expressions contain spaces by design, so those spaces shifted every following field.Use tab-only
IFSfor both device and peer dump rows so spaces inside a field are preserved.The current dump format also has AWG 3.1 fields between I1-I5 and
fwmark. The script still used the older 2.0 column list, so on 3.1 those values were all shifted and the first 3.1 field was interpreted asfwmark. This change consumes the current fields and serializes non-default 3.1 values to JSON.It also treats the current
(null)placeholder for absent I1-I5 values as absent rather than emitting it as a literal value.Validation
Checked the tab parser with:
In both cases the CPS value stayed intact and the final fields remained aligned.
Fixes #36
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.