diff options
author | Ben Pfaff <blp@nicira.com> | 2009-07-23 14:50:55 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2009-07-30 16:07:14 -0700 |
commit | 07c318f40481d0fd10516193fdf472c6356f0cd3 (patch) | |
tree | 3b1740edf9031c12a27254d1ebc05bae412c3e1f /vswitchd/ovs-brcompatd.c | |
parent | 795fe1fba0ffd036bf68c237f4857ce7a4003068 (diff) |
vswitchd: Avoid netdev_nodev_*() functions.
The netdev_nodev_*() functions have always been a bit of a kluge. It's
better to keep a network device open than to open it every time that it is
needed. This commit converts all of the users of these functions to use
the corresponding functions that take a "struct netdev *" instead.
Diffstat (limited to 'vswitchd/ovs-brcompatd.c')
-rw-r--r-- | vswitchd/ovs-brcompatd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c index ff829846..306de136 100644 --- a/vswitchd/ovs-brcompatd.c +++ b/vswitchd/ovs-brcompatd.c @@ -611,8 +611,14 @@ handle_fdb_query_cmd(struct ofpbuf *buffer) for (i = 0; i < ifaces.n; i++) { const char *iface_name = ifaces.names[i]; struct mac *mac = &local_macs[n_local_macs]; - if (!netdev_nodev_get_etheraddr(iface_name, mac->addr)) { - n_local_macs++; + struct netdev *netdev; + + error = netdev_open(iface_name, NETDEV_ETH_TYPE_NONE, &netdev); + if (netdev) { + if (!netdev_get_etheraddr(netdev, mac->addr)) { + n_local_macs++; + } + netdev_close(netdev); } } svec_destroy(&ifaces); |