X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif-linux.c;h=7013bc542763468b575a9f2df38e5d5d53deb18a;hb=7e041ba51410125ec74cba2b5f0b6f1b0481baa9;hp=ad67ae76ae4178c534064b032b5294134c526bf7;hpb=95b1d73a4a6944a44c028b771a339d2971d93071;p=openvswitch diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index ad67ae76..7013bc54 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -418,9 +418,15 @@ dpif_linux_port_query__(const struct dpif *dpif, uint32_t port_no, error = dpif_linux_vport_transact(&request, &reply, &buf); if (!error) { - dpif_port->name = xstrdup(reply.name); - dpif_port->type = xstrdup(netdev_vport_get_netdev_type(&reply)); - dpif_port->port_no = reply.port_no; + if (reply.dp_ifindex != request.dp_ifindex) { + /* A query by name reported that 'port_name' is in some datapath + * other than 'dpif', but the caller wants to know about 'dpif'. */ + error = ENODEV; + } else { + dpif_port->name = xstrdup(reply.name); + dpif_port->type = xstrdup(netdev_vport_get_netdev_type(&reply)); + dpif_port->port_no = reply.port_no; + } ofpbuf_delete(buf); } return error;