close
Skip to content

Fix _normalize_ip_key to properly normalize IP addresses#34

Merged
jonathan-kosgei merged 2 commits intomasterfrom
claude/fix-api-key-env-var-j6bTt
Feb 25, 2026
Merged

Fix _normalize_ip_key to properly normalize IP addresses#34
jonathan-kosgei merged 2 commits intomasterfrom
claude/fix-api-key-env-var-j6bTt

Conversation

@jonathan-kosgei
Copy link
Copy Markdown
Contributor

Use ipaddress module instead of socket.inet_pton so that network host bits are zeroed (e.g. 192.168.1.100/24 → 192.168.1.0/24) and IPv6 addresses are compressed (e.g. 2001:0db8:0000:… → 2001:db8::1).

https://claude.ai/code/session_01M3wRX9tnmc4qorVWRjmqTZ

Use ipaddress module instead of socket.inet_pton so that network host
bits are zeroed (e.g. 192.168.1.100/24 → 192.168.1.0/24) and IPv6
addresses are compressed (e.g. 2001:0db8:0000:… → 2001:db8::1).

https://claude.ai/code/session_01M3wRX9tnmc4qorVWRjmqTZ
Replace ipaddress module with socket.inet_pton/inet_ntop and manual
bit masking. Avoids the overhead of constructing full Python ipaddress
objects while still normalizing host bits and compressing IPv6.

https://claude.ai/code/session_01M3wRX9tnmc4qorVWRjmqTZ
@jonathan-kosgei jonathan-kosgei merged commit 4d57900 into master Feb 25, 2026
@jonathan-kosgei jonathan-kosgei deleted the claude/fix-api-key-env-var-j6bTt branch February 25, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants