Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Kepplinger
linux-next
Commits
cffaa1cc
Commit
cffaa1cc
authored
Sep 10, 2019
by
Angus Ainslie (Purism)
Browse files
net: wireless: redpine: add enhancement for MAC Spoofing
Signed-off-by:
Angus Ainslie (Purism)
<
angus@akkea.ca
>
parent
0e54df32
Changes
2
Hide whitespace changes
Inline
Side-by-side
drivers/net/wireless/redpine/rsi_91x_hal.c
View file @
cffaa1cc
...
...
@@ -142,6 +142,10 @@ int rsi_prepare_data_desc(struct rsi_common *common, struct sk_buff *skb)
wh
=
(
struct
ieee80211_hdr
*
)
&
skb
->
data
[
header_size
];
seq_num
=
le16_to_cpu
(
IEEE80211_SEQ_TO_SN
(
wh
->
seq_ctrl
));
vif
=
rsi_get_vif
(
adapter
,
wh
->
addr2
);
if
(
!
vif
)
{
status
=
-
ENOSPC
;
goto
err
;
}
vap_id
=
((
struct
vif_priv
*
)
vif
->
drv_priv
)
->
vap_id
;
frame_desc
[
2
]
=
cpu_to_le16
(
header_size
-
FRAME_DESC_SZ
);
...
...
drivers/net/wireless/redpine/rsi_91x_mac80211.c
View file @
cffaa1cc
...
...
@@ -215,6 +215,20 @@ static struct reg_map rsi_caracalla_reg_db[MAX_REG_COUNTRIES] = {
{
"MA"
,
NL80211_DFS_WORLD
},
{
"NL"
,
NL80211_DFS_ETSI
},
};
#endif
static
int
rsi_validate_mac_addr
(
struct
rsi_common
*
common
,
u8
*
addr_t
)
{
u8
addr
[
ETH_ALEN
]
=
{
0
};
if
(
!
memcmp
(
addr
,
addr_t
,
ETH_ALEN
))
{
rsi_dbg
(
ERR_ZONE
,
"%s: MAC addr is NULL
\n
"
,
__func__
);
return
-
1
;
}
else
if
(
memcmp
(
common
->
mac_addr
,
addr_t
,
ETH_ALEN
))
{
memcpy
(
common
->
mac_addr
,
addr_t
,
ETH_ALEN
);
}
return
0
;
}
static
int
rsi_mac80211_get_chan_survey
(
struct
ieee80211_hw
*
hw
,
int
idx
,
struct
survey_info
*
survey
)
{
...
...
@@ -412,6 +426,8 @@ static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw,
/* Scan already in progress. So return */
if
(
common
->
bgscan_en
||
common
->
scan_in_prog
)
return
-
EBUSY
;
if
(
rsi_validate_mac_addr
(
common
,
vif
->
addr
))
return
-
ENODEV
;
cancel_work_sync
(
&
common
->
scan_work
);
mutex_lock
(
&
common
->
mutex
);
...
...
@@ -606,9 +622,7 @@ static void rsi_mac80211_tx(struct ieee80211_hw *hw,
struct
ieee80211_bss_conf
*
bss
=
&
adapter
->
vifs
[
0
]
->
bss_conf
;
#ifndef CONFIG_REDPINE_P2P
if
((
memcmp
(
common
->
mac_addr
,
wlh
->
addr2
,
ETH_ALEN
)))
{
rsi_dbg
(
ERR_ZONE
,
"%s: MAC ID is not found and dropping this packets
\n
"
,
__func__
);
if
(
rsi_validate_mac_addr
(
common
,
wlh
->
addr2
))
{
ieee80211_free_txskb
(
common
->
priv
->
hw
,
skb
);
return
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment