-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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(inputs.ping): Check addr length to avoid crash #15601
Conversation
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 👍 This pull request doesn't change the Telegraf binary size 📦 Click here to get additional PR build artifactsArtifact URLs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@powersj is there a way to detect the case where the interface goes down? I'm asking because when given the name, the interface might have another IP when coming up next time...
Approving anyway in case you think this is a premature optimization...
Ah good point - We would need to see if the error message had anything about the interface being down, otherwise probably not. I'm going to land as this was already an issue before since we were setting the address in init before, but if someone brings this up we can revisit. |
(cherry picked from commit 3a05c38)
Summary
This will check the length of the slice to avoid a crash and moves this set up to Gather and out of Init to allow continued operation.
Checklist
Related issues
fixes: #15591