X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=vswitchd%2Fbridge.c;h=3faeee1e897869faacaa26f1f3d8df1e8f904f8c;hb=d825e2a5dcc5193067215cbf2466417cebebab9b;hp=f0ff91d92ee736b33608584f99a09e367a4a2e14;hpb=76ed83fc3f82f6d3074c4f87a38dd9ef164b6dc0;p=openvswitch diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index f0ff91d9..3faeee1e 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -791,7 +791,7 @@ iface_set_ofp_port(struct iface *iface, int ofp_port) assert(iface->ofp_port < 0 && ofp_port >= 0); iface->ofp_port = ofp_port; hmap_insert(&br->ifaces, &iface->ofp_port_node, hash_int(ofp_port, 0)); - + iface_set_ofport(iface->cfg, ofp_port); } static void @@ -927,7 +927,6 @@ bridge_add_ofproto_ports(struct bridge *br) /* Already exists, nothing to do. */ ofproto_port_destroy(&ofproto_port); } - ofproto_port_destroy(&ofproto_port); } } } @@ -1630,7 +1629,11 @@ bridge_create(const struct ovsrec_bridge *br_cfg) br->name = xstrdup(br_cfg->name); br->type = xstrdup(ofproto_normalize_type(br_cfg->datapath_type)); br->cfg = br_cfg; - eth_addr_nicira_random(br->default_ea); + + /* Derive the default Ethernet address from the bridge's UUID. This should + * be unique and it will be stable between ovs-vswitchd runs. */ + memcpy(br->default_ea, &br_cfg->header_.uuid, ETH_ADDR_LEN); + eth_addr_mark_random(br->default_ea); hmap_init(&br->ports); hmap_init(&br->ifaces);