- SHASH_FOR_EACH(node, args) {
- VLOG_DBG("arg: %s->%s", node->name, node->data);
- }
- data = shash_find_data(args, "remote_ip");
- if (data) {
- struct in_addr addr;
- int error = lookup_ip(data, &addr);
- if (error)
- return error;
- netdev_dev->remote_addr.sin_addr = addr;
- netdev_dev->got_remote_ip = true;
- return netdev_tunnel_connect(netdev_dev);
+ SMAP_FOR_EACH(node, args) {
+ VLOG_DBG("arg: %s->%s", node->name, (char*)node->data);
+ if (!strcmp(node->name, "remote_ip")) {
+ struct in_addr addr;
+ if (lookup_ip(node->data, &addr)) {
+ VLOG_WARN("%s: bad 'remote_ip'", node->name);
+ } else {
+ netdev_dev->remote_addr.sin_addr = addr;
+ netdev_dev->valid_remote_ip = true;
+ }
+ } else if (!strcmp(node->name, "remote_port")) {
+ netdev_dev->remote_addr.sin_port = htons(atoi(node->data));
+ netdev_dev->valid_remote_port = true;
+ } else {
+ VLOG_WARN("%s: unknown argument '%s'",
+ netdev_dev_get_name(dev_), node->name);
+ }