aircrack-ng / rtl8812au

RTL8812AU/21AU and RTL8814AU driver with monitor mode and frame injection
GNU General Public License v2.0
3.4k stars 749 forks source link

Use eth_hw_addr_set instead of dev_addr_set #1089

Closed CGarces closed 12 months ago

CGarces commented 1 year ago

Instead of define a dev_addr_set alias, eth_hw_addr_set should be declared for kernels < 5.15

eth_hw_addr_set was introduced on v5.15-rc1 https://github.com/torvalds/linux/commit/48eab831ae8b9f7002a533fa4235eed63ea1f1a3 For old kernels memcpy() is used, so we do the same is this patch.

It's aligned with the solution used by similar drivers on Linux kernel. memcopy to ether_addr_copy to eth_hw_addr_set

See for example https://github.com/torvalds/linux/commit/b57ceb19aba7d40403ca985ec565db8db20f4331 https://github.com/torvalds/linux/commit/349f631da4e1bdcb1b4a2a3ee630d689bfe6724d

Kernels < v5.15 will works in the same way with or without this patch, but maybe solve some issues with newer kernels, where eth_hw_addr_set has been improved. ping @fariouche to test #1088 @Anoncheg1 for #1075 and @Reflexe to test on ArchLinux #961

Fix #1088