]> xenbits.xensource.com Git - qemu-upstream-4.2-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 14:22:43 +0000 (14:22 +0000)
commit92c2288071d701e993f0b6cf6572bb95e1209017
tree716253832150425db18fb35873500fa852c6e865
parentda2e633ec99da897f51f388217f070c53aea6674
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>
hw/rtl8139.c