Mabin, thanks a lot for your patch, it appears to have fixed this problem for me (with Ubuntu 16.04.5 x86_64 and rtl8812au-dkms 4.3.8.12175.20140902+dfsg-0ubuntu2)!
I have applied the patch in /usr/src/rtl8812au-4.3.8.12175.20140902+dfsg/ directory. Afterwards I could use "dkms remove" to remove a module that was built for an older kernel version, and then use "dkms autoinstall --kernelver ..." to build the module for that specific kernel version again. modinfo then showed that the newly built module had the correct kernel listed in its "vermagic" field.
Mabin, thanks a lot for your patch, it appears to have fixed this problem for me (with Ubuntu 16.04.5 x86_64 and rtl8812au-dkms 4.3.8.12175. 20140902+ dfsg-0ubuntu2) !
I have applied the patch in /usr/src/ rtl8812au- 4.3.8.12175. 20140902+ dfsg/ directory. Afterwards I could use "dkms remove" to remove a module that was built for an older kernel version, and then use "dkms autoinstall --kernelver ..." to build the module for that specific kernel version again. modinfo then showed that the newly built module had the correct kernel listed in its "vermagic" field.