datapath: Check for positive packet length in vport_send().
authorJesse Gross <jesse@nicira.com>
Mon, 13 May 2013 15:27:21 +0000 (08:27 -0700)
committerJesse Gross <jesse@nicira.com>
Mon, 13 May 2013 15:47:09 +0000 (08:47 -0700)
commit6f7b24e3240178fa6916ef534f127fd252ffdd9b
tree6110bbbce4237833630f1fce6c1b523270805f2f
parentb5d57fc87925cb3c029de19d0a94de5ca07ae28e
datapath: Check for positive packet length in vport_send().

When sending a packet, a positive length indicates success and a
negative length indicates failure. However, the check for success
looked for non-zero values which catches both of these cases. This
can result in incorrect stats and leak memory on failure.

Introduced by commit be7cd27e44258bdb3c4e7dd8fd7389b5db56d55a (datapath:
Unify vport error stats handling.).

CC: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
datapath/vport.c