diff options
author | Ursula Braun <ursula.braun@de.ibm.com> | 2008-10-24 11:16:55 +0200 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-10-27 14:49:00 -0400 |
commit | 2d488c2f514a6c5248a0773c78345626abdc1818 (patch) | |
tree | 5400c148987e270a38aa15b76144cbfc40a6b93c /drivers/s390 | |
parent | cc181282fb2fa1af6d532f1333dd42af4814ff17 (diff) | |
download | op-kernel-dev-2d488c2f514a6c5248a0773c78345626abdc1818.zip op-kernel-dev-2d488c2f514a6c5248a0773c78345626abdc1818.tar.gz |
qeth: avoid skb_under_panic for malformatted inbound data
To make the qeth driver more robust in case of malformatted inbound
packets due to hardware problems, an additional check for
OSN-card-type is added for OSN-type packets.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index fdf4ffa..1b1e803 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -449,12 +449,15 @@ static void qeth_l2_process_inbound_buffer(struct qeth_card *card, netif_rx(skb); break; case QETH_HEADER_TYPE_OSN: - skb_push(skb, sizeof(struct qeth_hdr)); - skb_copy_to_linear_data(skb, hdr, + if (card->info.type == QETH_CARD_TYPE_OSN) { + skb_push(skb, sizeof(struct qeth_hdr)); + skb_copy_to_linear_data(skb, hdr, sizeof(struct qeth_hdr)); - len = skb->len; - card->osn_info.data_cb(skb); - break; + len = skb->len; + card->osn_info.data_cb(skb); + break; + } + /* else unknown */ default: dev_kfree_skb_any(skb); QETH_DBF_TEXT(TRACE, 3, "inbunkno"); |