Skip to content

Commit 4051df4

Browse files
Update library/helpers/mapIPv4ToIPv6.ts
Co-authored-by: BitterPanda <bitterpanda@proton.me>
1 parent 9378eb4 commit 4051df4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/helpers/mapIPv4ToIPv6.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ export default function mapIPv4ToIPv6(ip: string): string {
1010

1111
const parts = ip.split("/");
1212
const suffix = Number.parseInt(parts[1], 10);
13+
// we add 96 to the suffix, since ::ffff: already is 96 bits, so the 32 remaining bits are decided by the IPv4 address
1314
return `::ffff:${parts[0]}/${suffix + 96}`;
1415
}

0 commit comments

Comments
 (0)