-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
syscall: error in definition of constant RTNLGRP_IPV4_IFADDR #15080
Comments
As far as I can tell, the value of You are trying to use I don't think there is anything we should change in Go here. I agree that this code is subtle, and that the names look very similar, but we are correctly defining the new API constants and I think it's reasonable for us to omit the old API. If we decide that it's important to support the old API as well, we should do it in the x/sys/unix package, not the syscall package. I'm closing this but feel free to reopen if you disagree. |
Dear @ianlancetaylor, Thank you for correcting me. After some digging I found that many sources in C language mostly uses
Morover as part of your answer
If you see other So I suggest to add Here is some incorrect codes which people does not knew that it is incorrect. |
Sorry for the incorrect suggestion. The syscall package is frozen, so we won't be adding the |
Ok. It was suggestion. If it is frozen, I will understand. However how it can be possible to contribute to go lang documentation about this information? How I can join and help to improve networking part of go language? In order other will not have same problem as me. |
Thank you. |
Please answer these questions before submitting your issue. Thanks!
go version
)?1.6
go env
)?Ubuntu 14.04 64bit
Definition of
RTNLGRP_IPV4_IFADDR = 0x5
is incorrect from syscall.go. Because C language definition of this variable is equal to#define RTMGRP_IPV4_IFADDR 0x10
according here rtnetlink.hI cannot get
syscall.RTM_NEWADD
message due to this error. I did not create runnable code since to simulate you need IP address change. However this is my code which can be executed.if this line "groups := syscall.RTNLGRP_IPV4_IFADDR" will be changed to
groups := uint32(16)
it start working normaly.RTNLGRP_IPV4_IFADDR = 0x10
in syscall.goRTNLGRP_IPV4_IFADDR
= 0x5 in syscall.goThe text was updated successfully, but these errors were encountered: