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 compile error for in6_ifreq define changes #1070

Closed
wants to merge 1 commit into from

Conversation

madafoo
Copy link
Contributor

@madafoo madafoo commented Jun 21, 2017

After my debian sid upgrade the latest linux-libc-dev from 4.9.30 to 4.11.6, it break the compile for in6_ifreq changes. Please help me verify the changes on different platform to make sure it do not break anything elese.

* the same structures, leading to redefinition errors.
* For the second operand, we're grateful to android/bionic, platform level 21.
*/
#if !defined(_LINUX_IN6_H) && !defined(_UAPI_LINUX_IN6_H)
#if !defined(_IPV6_H) && !defined(_UAPI_IPV6_H)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it hurt to say:

#if !defined(_LINUX_IN6_H) && !defined(_UAPI_LINUX_IN6_H) && !defined(_IPV6_H) && !defined(_UAPI_IPV6_H)
.....

instead ?

@madafoo
Copy link
Contributor Author

madafoo commented Jun 21, 2017

In fact, old code
#if !defined(_LINUX_IN6_H) && !defined(_UAPI_LINUX_IN6_H)
is complete wrong, it is always be true.
I have look deep in the difference between linux-libc-dev 4.11.6 and 4.9.30 caused the problem is the change of /usr/include/linux/ipv6_route.h:

@@ -14,6 +14,7 @@
#define _LINUX_IPV6_ROUTE_H

#include <linux/types.h>
+#include <linux/in6.h> /* For struct in6_addr. */

#define RTF_DEFAULT 0x00010000 /* default - learned via ND /
#define RTF_ALLONLINK 0x00020000 /
(deprecated and will be removed)`

@madafoo
Copy link
Contributor Author

madafoo commented Jun 21, 2017

torvalds/linux@6c07ec0

The ipv6_route.h changes was brought into kernel about 4 month ago.

@cjdelisle
Copy link
Owner

cjdelisle commented Jun 21, 2017

Hmm, the old code was there because it fixed a problem at that time so it cannot have been completely wrong. How about we make a solution which is guaranteed to fix it by changing the name to struct Cjdns_in6_ifreq so it will never collide. Then we can drop the stupid ifdef entirely.

@madafoo
Copy link
Contributor Author

madafoo commented Jun 21, 2017

In fact, before 8efff0c#diff-014ec6296bbbd370c5bdfaa6bf461503L45 the code is still use the ipv6.h, and as the comment said:

We need to pull in linux/ipv6.h for in6_ifreq but a bunch
of structures are defined in in6.h and also in in.h causing
errors from redefinition.

@cjdelisle
Copy link
Owner

efd7d7f should close this

@cjdelisle cjdelisle closed this Jun 24, 2017
@madafoo madafoo deleted the fix_compile_error branch June 26, 2017 01:57
@vikulin
Copy link

vikulin commented Oct 14, 2017

See details in hyperboria/android#72:

Replace 7 years old NACL library to modern libsodium.
https://github.com/jedisct1/libsodium

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.

3 participants