Skip to content

Commit 864c17c

Browse files
julianwiedmanndavem330
authored andcommitted
s390/qeth: try harder to get packets from RX buffer
Current code bails out when two subsequent buffer elements hold insufficient data to contain a qeth_hdr packet descriptor. This seems reasonable, but it would be legal for quirky hardware to leave a few elements empty and then present packets in a subsequent element. These packets would currently be dropped. So make sure to check all buffer elements, until we hit the LAST_ENTRY indication. Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8d68af6 commit 864c17c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/s390/net/qeth_core_main.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5214,13 +5214,11 @@ struct sk_buff *qeth_core_get_next_skb(struct qeth_card *card,
52145214
int use_rx_sg = 0;
52155215

52165216
/* qeth_hdr must not cross element boundaries */
5217-
if (element->length < offset + sizeof(struct qeth_hdr)) {
5217+
while (element->length < offset + sizeof(struct qeth_hdr)) {
52185218
if (qeth_is_last_sbale(element))
52195219
return NULL;
52205220
element++;
52215221
offset = 0;
5222-
if (element->length < sizeof(struct qeth_hdr))
5223-
return NULL;
52245222
}
52255223
*hdr = element->addr + offset;
52265224

0 commit comments

Comments
 (0)