]> xenbits.xensource.com Git - qemu-upstream-4.4-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:12:14 +0000 (14:12 +0000)
commit293bbdf5ceea9b7aa8fa08bc763c841fbdef5a89
tree04e065d486a4d19c47ca77d0769fe89161088889
parent2d8f5cf694d855fa06a5b06f1fd5cdcef3206dc6
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