datpath: Fix memory leak when a loop is detected.
authorJesse Gross <jesse@nicira.com>
Fri, 10 Dec 2010 00:40:15 +0000 (16:40 -0800)
committerJesse Gross <jesse@nicira.com>
Sat, 11 Dec 2010 23:19:47 +0000 (15:19 -0800)
commitf267de8ae6af2509128d28e1cd0dd21aee7c9734
tree2d28df05cfb37e7aa9acfa59d75411c02bde60a9
parent2d7ce2ee1af5c4925ebbc681bb72e660d87faa71
datpath: Fix memory leak when a loop is detected.

If we detect a packet that is looping we kill the flow but then
don't do anything with the packet that caused the problem in the
first place, so this frees the packet.  This isn't a very serious
leak because we try to shut off the flow that lead to the loop
as early as possible.  Once this happens, packets will no longer
hit the loop detector and will be freed just as any other packet
that should be dropped.

It also fixes an issue where the offset to the stats counter is
uninitialized after a loop is detected.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/datapath.c