-
Notifications
You must be signed in to change notification settings - Fork 230
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
Not able to create IPv6 raw socket #517
Comments
Quick search through the Linux code (https://github.com/search?q=repo%3Atorvalds%2Flinux+IP_HDRINCL&type=code) it seems that But I don't use raw socket myself, so this could be a red herring. |
Thanks for the hint. But strange. The C code works without errors. soc = socket (AF_INET6, SOCK_RAW, IPPROTO_RAW);
if (soc < 0)
return NULL;
if (setsockopt (soc, IPPROTO_IPV6, IP_HDRINCL, (char *) &opt_on,
sizeof (opt_on))
< 0)
perror ("setsockopt"); In that code, of course I don't get an error. |
The difference is that your C code uses Lines 1151 to 1156 in 6a13053
I think that's the problem. We should split |
Thanks! I have test your suggestion and it worked. I have prepare a PR. |
I have the following function (also one for IPv4 with the IPV4 domain, which works as expected)
If I call the function and try to set an option:
I get the following error:
send_v6packet: Not possible to create a raw socket: Protocol not available (os error 92)
Is this a bug or I am doing something wrong? This is working as expected in the program written in C. So, I discard some permission issue or OS issue. Thanks in advance.
The text was updated successfully, but these errors were encountered: