X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=vswitchd%2Fovs-brcompatd.c;h=585ab2c70576f3f080ddf84f890e0ebde5fc3fb9;hb=23935e8bcb5be3e82ed2fb16333fdbea36eedfcd;hp=09225439df6dec2c336ae6d4805409814f48094c;hpb=9c8149dca0d205631a5bda57b0ccde1367b3bb96;p=openvswitch diff --git a/vswitchd/ovs-brcompatd.c b/vswitchd/ovs-brcompatd.c index 09225439..585ab2c7 100644 --- a/vswitchd/ovs-brcompatd.c +++ b/vswitchd/ovs-brcompatd.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2009 Nicira Networks +/* Copyright (c) 2008, 2009, 2010 Nicira Networks * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -755,7 +755,7 @@ handle_fdb_query_cmd(const struct ovsrec_open_vswitch *ovs, struct mac *mac = &local_macs[n_local_macs]; struct netdev *netdev; - error = netdev_open(iface_name, NETDEV_ETH_TYPE_NONE, &netdev); + error = netdev_open_default(iface_name, &netdev); if (netdev) { if (!netdev_get_etheraddr(netdev, mac->addr)) { n_local_macs++; @@ -978,6 +978,14 @@ brc_recv_update(const struct ovsrec_open_vswitch *ovs) goto error; } + /* Just drop the request on the floor if a valid configuration + * doesn't exist. We don't immediately do this check, because we + * want to drain pending netlink messages. */ + if (!ovs) { + VLOG_WARN_RL(&rl, "could not find valid configuration to update"); + goto error; + } + switch (genlmsghdr->cmd) { case BRC_GENL_C_DP_ADD: handle_bridge_cmd(ovs, buffer, true); @@ -1136,6 +1144,7 @@ main(int argc, char *argv[]) struct ovsdb_idl *idl; int retval; + proctitle_init(argc, argv); set_program_name(argv[0]); time_init(); vlog_init(); @@ -1151,7 +1160,7 @@ main(int argc, char *argv[]) retval = unixctl_server_create(NULL, &unixctl); if (retval) { - ovs_fatal(retval, "could not listen for vlog connections"); + exit(EXIT_FAILURE); } if (brc_open(&brc_sock)) { @@ -1180,14 +1189,12 @@ main(int argc, char *argv[]) unixctl_server_run(unixctl); ovs = ovsrec_open_vswitch_first(idl); - if (ovs) { - brc_recv_update(ovs); - } else if (ovsdb_idl_get_seqno(idl)) { + brc_recv_update(ovs); + + if (!ovs && ovsdb_idl_has_ever_connected(idl)) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 1); VLOG_WARN_RL(&rl, "%s: database does not contain any Open vSwitch " "configuration", remote); - } else { - /* Haven't yet received initial database contents. */ } netdev_run();