+}
+
+static int alias_check_state(struct device *dev)
+{
+ struct alias_device *alias;
+ struct interface *iface;
+ struct device *ndev = NULL;
+
+ alias = container_of(dev, struct alias_device, dev);
+
+ iface = vlist_find(&interfaces, alias->name, iface, node);
+ if (iface && iface->state == IFS_UP)
+ ndev = iface->main_dev.dev;
+
+ __alias_notify_device(alias, ndev);
+
+ return 0;
+}
+
+static const struct device_type alias_device_type = {
+ .name = "Network alias",
+ .create = alias_device_create,
+ .free = alias_device_free,
+ .check_state = alias_check_state,
+};
+
+void
+alias_notify_device(const char *name, struct device *dev)
+{
+ struct alias_device *alias;
+
+ device_lock();
+
+ alias = avl_find_element(&aliases, name, alias, avl);
+ if (alias)
+ __alias_notify_device(alias, dev);