Commit df93556
committed
motd/20-ip-info: align (LAN)/(WAN) labels across IPv4 + IPv6 rows
The IPv4 row used a 14-char prefix (` IPv4:` + 8 trailing spaces);
the IPv6 row used 15 (` IPv6:` + 9 trailing spaces). The extra
space on v6 was an attempt to make the v6 address column line up
with the v4 address column when v4 had a `(LAN)` label and v6
didn't (v6's LAN appendix had no label at all, just the bare
address). Worked when v4 had `(LAN)` and v6 had something — broke
the moment LAN got dropped against WAN by the dedup at lines
76-81 and only the `(WAN)` half remained.
Net visible bug (addresses are RFC 5737 / RFC 3849 examples):
IPv4: (WAN) 192.0.2.42
IPv6: (WAN) 2001:db8::42
^ shifted by one column
Fix:
- Use the same 13-char prefix for both rows (IPv4: / IPv6: + 7
padding, no trailing space).
- Both `(LAN)` and `(WAN)` appendices start with a single
leading space — the label always sits at the same column
regardless of which (or both) are present.
- Add a `(LAN)` label to v6 too; the asymmetry was the original
reason the spacing was offset, and removing it lets v4 and v6
structurally mirror each other.
- Drop the trailing space the appendices used to carry — pure
EOL whitespace, never visible.
Verified across all four cases (LAN+WAN / LAN only / WAN only /
nothing): `(LAN)` and `(WAN)` always align column-for-column on
both rows.1 parent 7138b33 commit df93556
1 file changed
Lines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
83 | 94 | | |
84 | 95 | | |
85 | 96 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
92 | 103 | | |
93 | 104 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
| |||
0 commit comments