- msg = xasprintf("%s\n"IP_FMT"\n%d\n",
- dev->real_name,
- IP_ARGS(&dev->local_addr.sin_addr),
- dev->local_netmask);
- reply = (char*)xmalloc(reply_size);
- if (!msg || !reply) {
- VLOG_ERR("Out of memory");
- error = ENOMEM;
- goto cleanup;
- }
- error = vsys_transaction("vif_up", msg, reply, reply_size);
- if (error) {
- dev->error = reply;
- reply = NULL; /* prevent free of reply msg */
- goto cleanup;
+ VLOG_DBG("sync_flags(%s): current: %s %s target: %s %s",
+ dev->real_name,
+ (dev->flags & NETDEV_UP ? "UP" : "-"),
+ (dev->flags & NETDEV_PROMISC ? "PROMISC" : "-"),
+ (dev->new_flags & NETDEV_UP ? "UP" : "-"),
+ (dev->new_flags & NETDEV_PROMISC ? "PROMISC" : "-"));
+
+ if ((dev->new_flags & NETDEV_UP) && !(dev->flags & NETDEV_UP)) {
+ (void) netdev_pltap_up(dev);
+ } else if (!(dev->new_flags & NETDEV_UP) && (dev->flags & NETDEV_UP)) {
+ (void) netdev_pltap_down(dev);