+ if (FIELD_CHANGED_STR(ifname) || proto != if_new->proto_handler) {
+ D(INTERFACE, "Reload interface '%s' because of ifname/proto change\n",
+ if_old->name);
+ goto reload;
+ }
+
+ if (!proto->config_params)
+ D(INTERFACE, "No config parameters for interface '%s'\n",
+ if_old->name);
+ else if (!config_check_equal(old_config, if_new->config,
+ proto->config_params)) {
+ D(INTERFACE, "Reload interface '%s because of config changes\n",
+ if_old->name);
+ goto reload;
+ }
+
+#define UPDATE(field) ({ \
+ bool __changed = (if_old->field != if_new->field); \
+ if_old->field = if_new->field; \
+ __changed; \
+ })
+
+ if (UPDATE(metric) || UPDATE(proto_ip.no_defaultroute)) {
+ interface_ip_set_enabled(&if_old->config_ip, false);
+ interface_ip_set_enabled(&if_old->config_ip, if_new->config_ip.enabled);
+ interface_ip_set_enabled(&if_old->proto_ip, false);
+ interface_ip_set_enabled(&if_old->proto_ip, if_new->proto_ip.enabled);
+ }
+
+ UPDATE(proto_ip.no_dns);
+ interface_replace_dns(&if_old->config_ip, &if_new->config_ip);
+ interface_write_resolv_conf();
+
+#undef UPDATE
+
+ goto out;
+
+reload: