static struct bridge *bridge_create(const char *name);
static void bridge_destroy(struct bridge *);
static struct bridge *bridge_lookup(const char *name);
-static int if_up(const char *netdev_name);
static int bridge_run_one(struct bridge *);
static void bridge_reconfigure_one(struct bridge *);
static void bridge_get_all_ifaces(const struct bridge *, struct svec *ifaces);
next_port_no = 1;
for (i = 0; i < add_ifaces.n; i++) {
const char *if_name = add_ifaces.names[i];
- if_up(if_name);
for (;;) {
int error = dpif_port_add(&br->dpif, if_name, next_port_no++);
if (error != EEXIST) {
return br ? ofproto_get_datapath_id(br->ofproto) : 0;
}
-static int
-if_up(const char *netdev_name)
-{
- struct netdev *netdev;
- int retval;
-
- retval = netdev_open(netdev_name, NETDEV_ETH_TYPE_NONE, &netdev);
- if (!retval) {
- retval = netdev_turn_flags_on(netdev, NETDEV_UP, true);
- netdev_close(netdev);
- }
- return retval;
-}
-
static int
bridge_run_one(struct bridge *br)
{
error = netdev_open(br->name, NETDEV_ETH_TYPE_NONE, &netdev);
if (!error) {
- netdev_turn_flags_on(netdev, NETDEV_UP, true);
if (cfg_is_valid(CFG_IP | CFG_REQUIRED, "%s.ip", pfx)) {
struct in_addr ip, mask, gateway;
ip.s_addr = cfg_get_ip(0, "%s.ip", pfx);
mask.s_addr = cfg_get_ip(0, "%s.netmask", pfx);
gateway.s_addr = cfg_get_ip(0, "%s.gateway", pfx);
+ netdev_turn_flags_on(netdev, NETDEV_UP, true);
if (!mask.s_addr) {
mask.s_addr = guess_netmask(ip.s_addr);
}