]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commit
rtl8139: avoid nested ifs in IP header parsing
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 15 Jul 2015 17:16:58 +0000 (18:16 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Mon, 3 Aug 2015 13:52:05 +0000 (13:52 +0000)
commit4b47e318c956c6cf7287870bf88cd306c1e4c068
tree5fe4bacb76c4695901d0cbf1b42fd5fc00177e50
parentf748613efca3cd444db26d5aae9244ffa7d7d313
rtl8139: avoid nested ifs in IP header parsing

Transmit offload needs to parse packet headers.  If header fields have
unexpected values the offload processing is skipped.

The code currently uses nested ifs because there is relatively little
input validation.  The next patches will add missing input validation
and a goto label is more appropriate to avoid deep if statement nesting.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
hw/net/rtl8139.c