diff options
author | Ben Pfaff <blp@nicira.com> | 2014-08-04 12:16:25 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2014-08-05 10:52:16 -0700 |
commit | ff9d27602f0ffe73ab87ed1cc513616e10744ce9 (patch) | |
tree | cdb2dbfd713eedc574dabb0a84011ec3931e0ac5 | |
parent | 9bcefb956d8f712eded13e40e27e55f885c362f2 (diff) | |
download | openvswitch-ff9d27602f0ffe73ab87ed1cc513616e10744ce9.tar.gz |
dpif-netdev: Initialize upcall->packet when queuing to userspace.
Only the data and size members were being initialized, but all of them
should be.
This is inspired by commit b6f4590fa036 (dpif-netdev: Initialize
upcall->packet when queuing to userspace.) from master. The background is
not exactly the same as on master (the commit that it references is not
on branch-2.3).
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
-rw-r--r-- | lib/dpif-netdev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index fb3530671..69e15d7f5 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -2077,6 +2077,7 @@ dp_netdev_output_userspace(struct dp_netdev *dp, struct ofpbuf *packet, struct ofpbuf *buf = &u->buf; size_t buf_size; struct flow flow; + void *data; upcall->type = type; @@ -2100,8 +2101,8 @@ dp_netdev_output_userspace(struct dp_netdev *dp, struct ofpbuf *packet, NLA_ALIGN(userdata->nla_len)); } - ofpbuf_set_data(&upcall->packet, - ofpbuf_put(buf, ofpbuf_data(packet), ofpbuf_size(packet))); + data = ofpbuf_put(buf, ofpbuf_data(packet), ofpbuf_size(packet)); + ofpbuf_use_stub(&upcall->packet, data, ofpbuf_size(packet)); ofpbuf_set_size(&upcall->packet, ofpbuf_size(packet)); seq_change(q->seq); |