This reverts commit c7f8f6e363.
This commit is reverted because it introduces such issues as
monitor stops working. Before the issue is solved, we should
keep the code on main branch work
eth_hw_addr_set() was added in Linux 5.15 but has now been backported
to 4.19.291, 5.4.251, and 5.10.188. This currently results in build
failure for these stable branches.
There's no simple way to test for the addition of this function since
LINUX_VERSION_CODE limits version components to 255.
Work around this by defining an inline function rtw_eth_hw_addr_set()
and a macro eth_hw_addr_set(). This effectively shadows any
backported definition of the eth_hw_addr_set() function without any
conflict.
Signed-off-by: Ben Hutchings <ben.hutchings@mind.be>
The macro definition for kernels < 5.15 is changed so that it is consistent with usage prior #961. Change should not affect compilation for newer kernels.
The reliability of some attacks is increased by letting the device
retransmit injected frames. Since it may not always be desired to
retransmit injected frames, add a module parameter to enable it
manually.
This was tested with an Alfa AWUS036ACH. Even when using a spoofed
sender MAC address, the retransmission behaviour is as expected.
That is, when an ACK frame towards the spoofed MAC address is received,
the retransmission will stop.
The sequence number of inject frames was being overwritten. This prevents
certain older attacks against WEP fragmentation older TKIP attacks. Fix
this by tracking if a frames was injected in monitor mode, and if so, do
not overwrite its sequence number.
The patch also adds a module parameter to revert this behaviour if needed.
By setting rtw_monitor_overwrite_seqnum to 1, sequence numbers will again
be set by the driver/device. This may by useful if user-space relied on
the driver/device to set sequence numbers.
This patch was tested using an Alfa AWUS036ACH.
This commit is cherry-pick + refactoring of:
ff04a94b00
and
313311c14b
I'm not sure how this got lost in the latest version on GitHub (I guess merging issues).
But all credits go to @gordboy, @kimocoder and all the other authors.