提交 3ef83d74 编写于 作者: F Felix Fietkau 提交者: John W. Linville

ath9k: fix another source of corrupt frames

Atheros hardware supports receiving frames that span multiple
descriptors and buffers. In this case, the rx status of every
descriptor except for the last one is invalid and may contain random
data. Because the driver does not support this, it needs to drop such
frames.
Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 f3926b49
...@@ -57,13 +57,19 @@ static bool ath9k_rx_accept(struct ath_common *common, ...@@ -57,13 +57,19 @@ static bool ath9k_rx_accept(struct ath_common *common,
* rs_more indicates chained descriptors which can be used * rs_more indicates chained descriptors which can be used
* to link buffers together for a sort of scatter-gather * to link buffers together for a sort of scatter-gather
* operation. * operation.
* * reject the frame, we don't support scatter-gather yet and
* the frame is probably corrupt anyway
*/
if (rx_stats->rs_more)
return false;
/*
* The rx_stats->rs_status will not be set until the end of the * The rx_stats->rs_status will not be set until the end of the
* chained descriptors so it can be ignored if rs_more is set. The * chained descriptors so it can be ignored if rs_more is set. The
* rs_more will be false at the last element of the chained * rs_more will be false at the last element of the chained
* descriptors. * descriptors.
*/ */
if (!rx_stats->rs_more && rx_stats->rs_status != 0) { if (rx_stats->rs_status != 0) {
if (rx_stats->rs_status & ATH9K_RXERR_CRC) if (rx_stats->rs_status & ATH9K_RXERR_CRC)
rxs->flag |= RX_FLAG_FAILED_FCS_CRC; rxs->flag |= RX_FLAG_FAILED_FCS_CRC;
if (rx_stats->rs_status & ATH9K_RXERR_PHY) if (rx_stats->rs_status & ATH9K_RXERR_PHY)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册