- struct netdev *netdev, *next;
- LIST_FOR_EACH_SAFE(netdev, next, node, &netdev_list) {
- netdev_close(netdev);
+ struct shash_node *node;
+
+ SHASH_FOR_EACH (node, &netdev_dev_shash) {
+ struct netdev_dev *dev = node->data;
+ const struct netdev_saved_flags *sf;
+ enum netdev_flags saved_values;
+ enum netdev_flags saved_flags;
+
+ saved_values = saved_flags = 0;
+ LIST_FOR_EACH (sf, node, &dev->saved_flags_list) {
+ saved_flags |= sf->saved_flags;
+ saved_values &= ~sf->saved_flags;
+ saved_values |= sf->saved_flags & sf->saved_values;
+ }
+ if (saved_flags) {
+ enum netdev_flags old_flags;
+
+ dev->netdev_class->update_flags(dev,
+ saved_flags & saved_values,
+ saved_flags & ~saved_values,
+ &old_flags);
+ }