ofproto-dpif-upcall: ofproto_dpif_send_packet_in() needs object on heap.
authorYAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Fri, 16 Aug 2013 05:17:23 +0000 (14:17 +0900)
committerBen Pfaff <blp@nicira.com>
Fri, 16 Aug 2013 18:42:33 +0000 (11:42 -0700)
commitd5ff77e22c97dfe93df9b98beefdcc8182dd94f1
tree5f799c524ef2be6d28850d05622531f85a09473f
parentf4aa1da85a3c404d7f8d7c70db7ab9990c0804ab
ofproto-dpif-upcall: ofproto_dpif_send_packet_in() needs object on heap.

fix a bug introduced by commit e1ec7dd46 (ofproto-dpif: Implement
multi-threaded miss handling.), in which execute_flow_miss() passes a
stack-allocated object to ofproto_dpif_send_packet_in() whereas that
function requires a heap-allocated object.  Also fixes two related bugs:
the 'packet' previously used in the packet-in was invalid and its data
was not copied with xmemdup().

Previously, when there were multiple packets in a single flow miss,
execute_flow_miss() would only send the first one to the controller.  This
was intentional (the goal is to find out whether the controller is
operational, and sending a single packet is sufficient for that) but
possibly confusing to the reader.  This commit switches to sending all of
the packets (the common case is a single packet anyhow).

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-dpif.c