From ca82eeba572289a427dec6adc9d80051c74e3cc5 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 6 Mar 2009 10:57:30 -0800 Subject: [PATCH] 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. --- lib/dpif.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) { -- 2.30.2