diff options
author | Thomas Pedersen <thomas@cozybit.com> | 2011-09-01 15:32:14 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-14 13:56:16 -0400 |
commit | 2157fdd6ae3f760a95c5c50072a1b4ac656eb9f5 (patch) | |
tree | 9964525f86c7d6deb9c55a1ebbc8e4f2871a8e60 /net/mac80211/rx.c | |
parent | 8c771244fbab51661da7dbbabfa5dceffb3e3cce (diff) |
mac80211: check if mesh frame is in RMC after decrypt
To check whether a frame is in the RMC, we need access to the mesh
header. This header is encrypted in encrypted data frames, so make this
check after the frame has been decrypted.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index f45fd2fedc24..d479d48e8d18 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -476,7 +476,6 @@ static ieee80211_rx_result | |||
476 | ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx) | 476 | ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx) |
477 | { | 477 | { |
478 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; | 478 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; |
479 | unsigned int hdrlen = ieee80211_hdrlen(hdr->frame_control); | ||
480 | char *dev_addr = rx->sdata->vif.addr; | 479 | char *dev_addr = rx->sdata->vif.addr; |
481 | 480 | ||
482 | if (ieee80211_is_data(hdr->frame_control)) { | 481 | if (ieee80211_is_data(hdr->frame_control)) { |
@@ -524,14 +523,6 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx) | |||
524 | 523 | ||
525 | } | 524 | } |
526 | 525 | ||
527 | #define msh_h_get(h, l) ((struct ieee80211s_hdr *) ((u8 *)h + l)) | ||
528 | |||
529 | if (ieee80211_is_data(hdr->frame_control) && | ||
530 | is_multicast_ether_addr(hdr->addr1) && | ||
531 | mesh_rmc_check(hdr->addr3, msh_h_get(hdr, hdrlen), rx->sdata)) | ||
532 | return RX_DROP_MONITOR; | ||
533 | #undef msh_h_get | ||
534 | |||
535 | return RX_CONTINUE; | 526 | return RX_CONTINUE; |
536 | } | 527 | } |
537 | 528 | ||
@@ -1840,6 +1831,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1840 | hdrlen = ieee80211_hdrlen(hdr->frame_control); | 1831 | hdrlen = ieee80211_hdrlen(hdr->frame_control); |
1841 | mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen); | 1832 | mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen); |
1842 | 1833 | ||
1834 | /* frame is in RMC, don't forward */ | ||
1835 | if (ieee80211_is_data(hdr->frame_control) && | ||
1836 | is_multicast_ether_addr(hdr->addr1) && | ||
1837 | mesh_rmc_check(hdr->addr3, mesh_hdr, rx->sdata)) | ||
1838 | return RX_DROP_MONITOR; | ||
1839 | |||
1843 | if (!ieee80211_is_data(hdr->frame_control)) | 1840 | if (!ieee80211_is_data(hdr->frame_control)) |
1844 | return RX_CONTINUE; | 1841 | return RX_CONTINUE; |
1845 | 1842 | ||