Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Handle IPv6 Stack Unavailability in Traceroute Functionality (Generated by Ana - AI SDE) #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ana-ai-sde
Copy link

Description

This pull request addresses an issue where the traceroute functionality would fail on systems without an available IPv6 stack.

Specifically, the Tracer class in connvitals/traceroute.py now gracefully handles the absence of an IPv6 stack by checking for its availability before attempting to create IPv6 sockets. If the stack is not available, an EnvironmentError is raised, preventing crashes and providing a more informative error message.

Changes

  • Added a check for socket.has_ipv6 in the Tracer.__init__ method before creating IPv6 sockets.
  • If an IPv6 stack is not available, an EnvironmentError is raised with a message indicating that the IPv6 stack is not available on the system.

Fixes Issue 9

This patch was generated by Ana - AI SDE, an AI-powered software development assistant.

This commit addresses an issue where the Tracer class in connvitals/traceroute.py would throw an exception if the host machine did not have an IPv6 stack available.

The issue stemmed from the __init__ method attempting to create an IPv6 socket regardless of the system's capability. This commit resolves the problem by adding a check for socket.has_ipv6 before creating the socket.

If an IPv6 stack is not available, an EnvironmentError is raised with a descriptive message, preventing the exception and providing clearer feedback to the user.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

IPv6 stackless exception
2 participants