- if (!strcmp(c->target, "discover")) {
- ofproto_set_discovery(br->ofproto, true,
- c->discover_accept_regex,
- c->discover_update_resolv_conf);
- } else {
- struct iface *local_iface;
- struct in_addr ip;
- bool in_band;
-
- in_band = (!c->connection_mode
- || !strcmp(c->connection_mode, "out-of-band"));
- ofproto_set_discovery(br->ofproto, false, NULL, NULL);
- ofproto_set_in_band(br->ofproto, in_band);
-
- local_iface = bridge_get_local_iface(br);
- if (local_iface && c->local_ip && inet_aton(c->local_ip, &ip)) {
- struct netdev *netdev = local_iface->netdev;
- struct in_addr ip, mask, gateway;
-
- if (!c->local_netmask || !inet_aton(c->local_netmask, &mask)) {
- mask.s_addr = 0;
- }
- if (!c->local_gateway
- || !inet_aton(c->local_gateway, &gateway)) {
- gateway.s_addr = 0;
- }
-
- netdev_turn_flags_on(netdev, NETDEV_UP, true);
- if (!mask.s_addr) {
- mask.s_addr = guess_netmask(ip.s_addr);
- }
- if (!netdev_set_in4(netdev, ip, mask)) {
- VLOG_INFO("bridge %s: configured IP address "IP_FMT", "
- "netmask "IP_FMT,
- br->name, IP_ARGS(&ip.s_addr),
- IP_ARGS(&mask.s_addr));
- }
-
- if (gateway.s_addr) {
- if (!netdev_add_router(netdev, gateway)) {
- VLOG_INFO("bridge %s: configured gateway "IP_FMT,
- br->name, IP_ARGS(&gateway.s_addr));
- }
- }
- }
- }
-
- ofproto_set_failure(br->ofproto,
- (!c->fail_mode
- || !strcmp(c->fail_mode, "standalone")
- || !strcmp(c->fail_mode, "open")));
-
- probe = c->inactivity_probe ? *c->inactivity_probe / 1000 : 5;
- ofproto_set_probe_interval(br->ofproto, probe);
-
- max_backoff = c->max_backoff ? *c->max_backoff / 1000 : 8;
- ofproto_set_max_backoff(br->ofproto, max_backoff);
-
- rate_limit = c->controller_rate_limit ? *c->controller_rate_limit : 0;
- burst_limit = c->controller_burst_limit ? *c->controller_burst_limit : 0;
- ofproto_set_rate_limit(br->ofproto, rate_limit, burst_limit);
-
- ofproto_set_remote_execution(br->ofproto, NULL, NULL); /* XXX */
- } else {