Skip to contentSkip to conversation

Kernel commit d35a00b8e33dab7385f724e713ae71c8be0a49f4 breaks wireguard

DISCUSSION Bruno Wolff III 2 participants 10 messages Feb 27, 2017 – Feb 28, 2017

lore
Share & tools
lore
#0 lore raw

When building wireguard for Fedora's 4.11.0-0.rc0.git4.2.fc26.x86_64 kernel I get the following error:
/home/bruno/WireGuard/src/device.c: In function ‘open’:
/home/bruno/WireGuard/src/device.c:44:9: error: ‘struct inet6_dev’ has no member named ‘addr_gen_mode’

  dev_v6->addr_gen_mode = IN6_ADDR_GEN_MODE_NONE;
        ^~

It looks like addr_gen_mode was dropped from inet6_dev in include/net/if_inet6.h in commit d35a00b8e33dab7385f724e713ae71c8be0a49f4.

#1 lore raw

Hey Bruno,

This has now been fixed in the repo. Note that since rc1 hasn't been released, you'll need to adjust the kernel's make file to show 4.11 yourself. Alternatively, just wait a few days for rc1.

Jason

#2 lore raw
Quoted 5 lines · Jason A. Donenfeld

Hey Bruno,

This has now been fixed in the repo. Note that since rc1 hasn't been released, you'll need to adjust the kernel's make file to show 4.11 yourself. Alternatively, just wait a few days for rc1.

I think Fedora already does that. The build gets further, but it looks like another structure change is breaking things as well. I'll see if I can verify the change and get you the commit number. In the meantime here is he error I am seeing:
/home/bruno/WireGuard/src/data.c: In function ‘skb_reset’:
/home/bruno/WireGuard/src/data.c:128:5: error: ‘struct sk_buff’ has no member named ‘tc_verd’

#3 lore raw
Quoted 5 lines · Bruno Wolff III

I think Fedora already does that. The build gets further, but it looks like another structure change is breaking things as well. I'll see if I can verify the change and get you the commit number. In the meantime here is he error I am seeing:
/home/bruno/WireGuard/src/data.c: In function ‘skb_reset’:
/home/bruno/WireGuard/src/data.c:128:5: error: ‘struct sk_buff’ has no member named ‘tc_verd’

This changed in commit a5135bcfba7345031df45e02cd150a45add47cf8:
net-tc: convert tc_verd to integer bitfields

#4 lore raw

Thanks! I wasn't compiling with the options to hit this, so I didn't see it before. Should be fixed now.

Jason

#5 lore raw
Quoted 2 lines · Jason A. Donenfeld

Thanks! I wasn't compiling with the options to hit this, so I didn't see it before. Should be fixed now.

Thank you.

It now builds cleanly and it at least appears to be working correctly in simple testing.

#6 lore raw
Quoted 8 lines · Bruno Wolff III
Quoted 2 lines · Jason A. Donenfeld

Thanks! I wasn't compiling with the options to hit this, so I didn't see it before. Should be fixed now.

Thank you.

It now builds cleanly and it at least appears to be working correctly in simple testing.

I am now having a problem building it on a 4.10 kernel. (I already have a build from the weekend, so I don't need this to make anything work right now.)

This is from another Fedora machine that I haven't switched to a 4.11 kernel yet. The base system for this one is F25, the one that it work on was f26/rawhide and has a gcc 7 version. This one has gcc-6.3.1-1.fc25.i686.

make -C /lib/modules/4.10.0-1.fc26.i686+PAE/build M=/home/bruno/WireGuard/src modules
make[1]: Entering directory '/usr/src/kernels/4.10.0-1.fc26.i686+PAE'
CC [M] /home/bruno/WireGuard/src/main.o
In file included from <command-line>:0:0:
/home/bruno/WireGuard/src/compat/compat.h:165:40: warning: ‘struct sk_buff’ declared inside parameter list will not be visible outside of this definition or declaration static inline void skb_reset_tc(struct sk_buff *skb)

                                       ^~~~~~~
/home/bruno/WireGuard/src/compat/compat.h: In function ‘skb_reset_tc’:
/home/bruno/WireGuard/src/compat/compat.h:168:5: error: dereferencing pointer to incomplete type ‘struct sk_buff’
 skb->tc_verd = 0;
    ^~
#8 lore raw
Quoted 1 line · Jason A. Donenfeld

Fixed

Thanks!

I rebuilt the latest version on both 4.11 and 4.10 Fedora kernels and it seems to be working as expected.

#9 lore raw

Hey Bruno,

Excellent, thanks for checking.

By the way, after rc1 is released, wireguard.io/build-status/ will automatically start compiling every version on it, so we'll get good code coverage that way. You're just a bit ahead of the curve :).

Jason