X-Git-Url: http://git.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=system-linux.c;fp=system-linux.c;h=b64c00755606330d1f8acb9df6c68ee9867a4eba;hp=b7b11579b8afd5bb9bb736595ee50f7acfbefe77;hb=8f2806a37fe16de6c24ad133107eeb6cb7a090dc;hpb=cc9e928f0a12f04c82356c02dd9a84ac6b383fb9 diff --git a/system-linux.c b/system-linux.c index b7b1157..b64c007 100644 --- a/system-linux.c +++ b/system-linux.c @@ -2259,6 +2259,15 @@ system_if_apply_settings(struct device *dev, struct device_settings *s, uint64_t apply_mask &= s->flags; + if (apply_mask & DEV_OPT_MASTER) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0) + system_set_master(dev, s->master_ifindex); + system_refresh_orig_macaddr(dev, &dev->orig_settings); +#else + netifd_log_message(L_WARNING, "%s Your kernel is older than linux 6.1.0, changing DSA port conduit is not supported!", dev->ifname); +#endif + } + memset(&ifr, 0, sizeof(ifr)); strncpy(ifr.ifr_name, dev->ifname, sizeof(ifr.ifr_name) - 1); if (apply_mask & DEV_OPT_MTU) { @@ -2347,14 +2356,6 @@ system_if_apply_settings(struct device *dev, struct device_settings *s, uint64_t system_set_drop_unsolicited_na(dev, s->drop_unsolicited_na ? "1" : "0"); if (apply_mask & DEV_OPT_ARP_ACCEPT) system_set_arp_accept(dev, s->arp_accept ? "1" : "0"); - if (apply_mask & DEV_OPT_MASTER) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0) - system_set_master(dev, s->master_ifindex); - system_refresh_orig_macaddr(dev, &dev->orig_settings); -#else - netifd_log_message(L_WARNING, "%s Your kernel is older than linux 6.1.0, changing DSA port conduit is not supported!", dev->ifname); -#endif - } system_set_ethtool_settings(dev, s); }