]> xenbits.xensource.com Git - qemu-upstream-4.3-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:17:57 +0000 (14:17 +0000)
commit8559a5f216947c1b6ed847b32124a9266b629be1
treeebea3653e4950d3d99e6f9fe72a0ff9531dc54af
parent34cc4117a7bcb212b527381a635a1acfd00c6d77
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