]> xenbits.xensource.com Git - qemu-xen-traditional.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)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 10 May 2016 18:10:50 +0000 (19:10 +0100)
commite1a6f9038069494d43604eb00e5ff8eb5e83e389
tree784276b2535462d9e997672465791c27f8e5ed6e
parent1f9da382d49765ce9f7e4d301fe1e51945b29218
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>
[Backport to qemu-xen-tradition]
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
hw/rtl8139.c