From: Ben Pfaff Date: Fri, 6 Mar 2009 18:57:30 +0000 (-0800) Subject: dpif: Don't log a warning in dpifmon_poll() for missing device. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca82eeba572289a427dec6adc9d80051c74e3cc5;p=openvswitch dpif: Don't log a warning in dpifmon_poll() for missing device. We were using dpif_port_query_by_name() here to see whether the device is part of the datapath, so there's no point in logging a warning if it isn't. --- diff --git a/lib/dpif.c b/lib/dpif.c index aa75f58c..8512ad7f 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -658,9 +658,13 @@ again: uint32_t master_ifindex = nl_attr_get_u32(attrs[IFLA_MASTER]); for_us = master_ifindex == mon->local_ifindex; } else { - struct odp_port odp_port; - for_us = (dpif_port_query_by_name(&mon->dpif, devname, - &odp_port) == 0); + /* It's for us if that device is one of our ports. This is + * open-coded instead of using dpif_port_query_by_name() to + * avoid logging a warning on failure. */ + struct odp_port port; + memset(&port, 0, sizeof port); + strncpy(port.devname, devname, sizeof port.devname); + for_us = !ioctl(mon->dpif.fd, ODP_PORT_QUERY, &port); } if (!for_us) {