X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif-netdev.c;h=a33fe23ddca79057eb0df024e7d8fb05ebd196f8;hb=b5a36e3878937a489458f7a0ff42769e826ae88b;hp=16860870ef1f915d16a3a02dc51aff1a666ccba8;hpb=7c808e39518f563ff03d6d01323cb05b17312568;p=openvswitch diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 16860870..a33fe23d 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -777,24 +777,22 @@ dpif_netdev_flow_put(struct dpif *dpif, const struct dpif_flow_put *put) } static int -dpif_netdev_flow_del(struct dpif *dpif, - const struct nlattr *nl_key, size_t nl_key_len, - struct dpif_flow_stats *stats) +dpif_netdev_flow_del(struct dpif *dpif, const struct dpif_flow_del *del) { struct dp_netdev *dp = get_dp_netdev(dpif); struct dp_netdev_flow *flow; struct flow key; int error; - error = dpif_netdev_flow_from_nlattrs(nl_key, nl_key_len, &key); + error = dpif_netdev_flow_from_nlattrs(del->key, del->key_len, &key); if (error) { return error; } flow = dp_netdev_lookup_flow(dp, &key); if (flow) { - if (stats) { - get_dpif_flow_stats(flow, stats); + if (del->stats) { + get_dpif_flow_stats(flow, del->stats); } dp_netdev_free_flow(dp, flow); return 0; @@ -937,7 +935,8 @@ find_nonempty_queue(struct dpif *dpif) } static int -dpif_netdev_recv(struct dpif *dpif, struct dpif_upcall *upcall) +dpif_netdev_recv(struct dpif *dpif, struct dpif_upcall *upcall, + struct ofpbuf *buf) { struct dp_netdev_queue *q = find_nonempty_queue(dpif); if (q) { @@ -945,6 +944,9 @@ dpif_netdev_recv(struct dpif *dpif, struct dpif_upcall *upcall) *upcall = *u; free(u); + ofpbuf_uninit(buf); + *buf = *u->packet; + return 0; } else { return EAGAIN;