-
Notifications
You must be signed in to change notification settings - Fork 45
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
When using IPv6 address, segmentation fault can occur due to incorrectly using IPv4 ping #149
Comments
Does it have a valid v4 address? What ping method are you using? What about the Cacti host, does it have an IPv6 address? |
Segmentation fault in spine 1.2.10 due to IPv6 address using IPv4 ICMP ping
Okay, I've pushed an update to the 1.2.x branch. Testing using that branch. Use the following option to make the testing a bit more simple: ./spine -R -V 3 -S -f host_id -l host_id Replace host_id with the IPv6 host. |
Please also answer the other questions. If the host also support IPv4, we could always use it's IPv4 address for ping. Long term, we just need to support ICMP, TCP, and UDP over IPv6, which we do not support today. |
Thank you for your work.
After opening the issue, I disabled the device as a workaround to stop the SIGSEGV. |
I recompiled spine with the paches from release/1.2.10...0a5cba7 and the SIGSEGV is gone.
Note:
TL;DR: the ICMP method is now broken whenever a device contains an AAAA record, even if it also contains an A record. |
So, if a device has an ipv4, do you want to bias to that address? |
When you ping6 to one of this hosts you don't need to specify an outbound interface do you? |
Answer the two questions, but with this update, you should be all set. There is still no ping6, but if you answer the questions, that'll help. It's not a big deal, just time, and I don't really want to enable ipv6 on my home router (need FW rules first). |
If ICMP is implemented for IPv6, it's better to use IPv6. If it's not implemented/working, at least fallback to IPv4 when the device also has an IPv4 address. This is better than having devices with both IPv4/IPv6 not work at all unless they're using SNMP.
I do have two interfaces on the machine, but one of them is for a local network only. I do not need to specify an outbound interface:
I'll test it and report back. Thanks. |
Cool |
Ok, so:
That being said, I think supporting ICMPv6 is another issue in itself and this issue "as-is" is resolved. Once again, thank you for your time and work. |
Yea, working on it. Before I fix the ping issue, I want to see how other OSS projects are handling the stack issues. Most seem to be written to do everything with the IPv6 stack and they simply place the IPv4 inside the IPv6 API. So, I'll give that a look, and then I have to enable IPv6 again on my router. Not a big deal, I just have to reset a bunch of NAT rules to protect the household. That way I'll be able to test properly. |
Those hosts should be fine, just use SNMP ping instead of ICMP|TCP|UDP for now. |
This should finish up what is currently in scope. Long term, instead of returnning the addr type, return a structure of the addr_type and the socket information so that we don't have to call getaddrinfo() a second time. That structure can be used in the various ping_* functions.
BTW, the ICMPv6 has been logged for some time, it's here: #127 if you feel up for doing a pull request, just let me know you are working on it. |
Can't use SNMP ping for host which don't have SNMP running :) One use case is monitoring IPv6-only hosts, for example, As for the pull-request: I don't have the time right now, but should I have some free time on my hands in the future, I will consider working on ICMPv6 and will let you know. |
@nuno-silva, no problem. I'm stuck at the house right now. Implementing ICMP|TCP|UDP ping are not that complicated, I've just never had a need for them. With that said, next I'll change the function to return the correct socket structure, and then pass that structure to the various pings. Should be done before the end of the week unless something get's in the way. I might not even do that. I'll have to look at it during the week. |
Close this when you are satisfied. |
to avoid a memory leak introduced by Cacti#149, as per Cacti@5644db7#r37979275 and http://man7.org/linux/man-pages/man3/getaddrinfo.3.html
to avoid a memory leak introduced by #149, as per 5644db7#r37979275 and http://man7.org/linux/man-pages/man3/getaddrinfo.3.html
Describe the bug
Spine runs and is able to populate (some?) graphs, but ends up crashing with SIGSEGV after (apparently) failing to resolve an IPv6 address.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Spine should not segfault. This was running fine using spine 1.2.8.
Server
Compiling
cacti-spine-1.2.10.tar.gz
)Additional context
gdb log
Also note that the
my-ipv6-host.example.com
is a dummy host that I have replaced for privacy. However, it was a valid DNS name that resolves to valid AAAA record.What I see in cacti.log is
The text was updated successfully, but these errors were encountered: