]> xenbits.xensource.com Git - qemu-upstream-4.5-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:04:40 +0000 (14:04 +0000)
commite2e56d60ac9a197465ad3c8d18bd542554680315
treeb4aacedc8856668fa9462d73447213330ca09794
parent272a614387ac25f2727a7f5c292111975e33b2fb
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