rtl8812a: add module parameter to retransmit injected frames

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.
This commit is contained in:
Mathy Vanhoef 2020-06-26 16:23:46 +04:00
parent 1b86121806
commit 849bbf0698
3 changed files with 11 additions and 1 deletions

View File

@ -4485,7 +4485,11 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
pattrib->stbc = 0; pattrib->stbc = 0;
} }
pattrib->retry_ctrl = _FALSE;
if (pregpriv->monitor_retransmit)
pattrib->retry_ctrl = _TRUE;
else
pattrib->retry_ctrl = _FALSE;
pattrib->pktlen = len; pattrib->pktlen = len;
pmlmeext->mgnt_seq = GetSequence(pwlanhdr); pmlmeext->mgnt_seq = GetSequence(pwlanhdr);
pattrib->seqnum = pmlmeext->mgnt_seq; pattrib->seqnum = pmlmeext->mgnt_seq;

View File

@ -459,6 +459,7 @@ struct registry_priv {
#endif/*CONFIG_TDMADIG*/ #endif/*CONFIG_TDMADIG*/
u8 monitor_overwrite_seqnum; u8 monitor_overwrite_seqnum;
u8 monitor_retransmit;
u8 monitor_disable_1m; u8 monitor_disable_1m;
}; };

View File

@ -76,6 +76,10 @@ int rtw_monitor_overwrite_seqnum = 0;
module_param(rtw_monitor_overwrite_seqnum, int, 0644); module_param(rtw_monitor_overwrite_seqnum, int, 0644);
MODULE_PARM_DESC(rtw_monitor_overwrite_seqnum, "Overwrite the sequence number of injected frames"); MODULE_PARM_DESC(rtw_monitor_overwrite_seqnum, "Overwrite the sequence number of injected frames");
int rtw_monitor_retransmit = 0;
module_param(rtw_monitor_retransmit, int, 0644);
MODULE_PARM_DESC(rtw_monitor_retransmit, "Retransmit injected frames");
int rtw_monitor_disable_1m = 0; int rtw_monitor_disable_1m = 0;
module_param(rtw_monitor_disable_1m, int, 0644); module_param(rtw_monitor_disable_1m, int, 0644);
MODULE_PARM_DESC(rtw_monitor_disable_1m, "Disable default 1Mbps rate for monitor injected frames"); MODULE_PARM_DESC(rtw_monitor_disable_1m, "Disable default 1Mbps rate for monitor injected frames");
@ -1228,6 +1232,7 @@ uint loadparam(_adapter *padapter)
#endif #endif
registry_par->monitor_overwrite_seqnum = (u8)rtw_monitor_overwrite_seqnum; registry_par->monitor_overwrite_seqnum = (u8)rtw_monitor_overwrite_seqnum;
registry_par->monitor_retransmit = (u8)rtw_monitor_retransmit;
registry_par->monitor_disable_1m = (u8)rtw_monitor_disable_1m; registry_par->monitor_disable_1m = (u8)rtw_monitor_disable_1m;
return status; return status;