- struct ofpbuf *request;
- ovs_be32 send_xid;
- bool done = false;
- bool found = false;
-
- request = ofputil_encode_port_desc_stats_request(vconn_get_version(vconn),
- port_no);
- send_xid = ((struct ofp_header *) request->data)->xid;
-
- send_openflow_buffer(vconn, request);
- while (!done) {
- ovs_be32 recv_xid;
- struct ofpbuf *reply;
-
- run(vconn_recv_block(vconn, &reply), "OpenFlow packet receive failed");
- recv_xid = ((struct ofp_header *) reply->data)->xid;
- if (send_xid == recv_xid) {
- struct ofp_header *oh = reply->data;
- enum ofptype type;
- struct ofpbuf b;
- uint16_t flags;
-
- ofpbuf_use_const(&b, oh, ntohs(oh->length));
- if (ofptype_pull(&type, &b)
- || type != OFPTYPE_PORT_DESC_STATS_REPLY) {
+ for (;;) {
+ if (pi->reply) {
+ int retval = ofputil_pull_phy_port(vconn_get_version(pi->vconn),
+ pi->reply, pp);
+ if (!retval) {
+ return true;
+ } else if (retval != EOF) {