@@ -141,9 +141,12 @@ func (d *nicPhysical) validateConfig(instConf instance.ConfigReader, partialVali
141141 // managed: no
142142 // shortdesc: The managed network to link the device to (instead of specifying the `nictype` directly)
143143 if d .config ["network" ] != "" {
144+ // List of properties we import from the parent network.
145+ networkFields := []string {"gvrp" , "mtu" , "vlan" , "vlan.tagged" }
146+
144147 requiredFields = append (requiredFields , "network" )
145148
146- bannedKeys := []string {"nictype" , "parent" , "mtu" , "vlan" , "vlan.tagged" , "gvrp" }
149+ bannedKeys := append ( []string {"nictype" , "parent" }, networkFields ... )
147150 for _ , bannedKey := range bannedKeys {
148151 if d .config [bannedKey ] != "" {
149152 return fmt .Errorf ("Cannot use %q property in conjunction with %q property" , bannedKey , "network" )
@@ -171,8 +174,8 @@ func (d *nicPhysical) validateConfig(instConf instance.ConfigReader, partialVali
171174 // Get actual parent device from network's parent setting.
172175 d .config ["parent" ] = netConfig ["parent" ]
173176
174- // Copy certain keys verbatim from the network's settings.
175- for _ , field := range optionalFields {
177+ // Copy certain keys verbatim from the parent network's settings.
178+ for _ , field := range networkFields {
176179 _ , found := netConfig [field ]
177180 if found {
178181 d .config [field ] = netConfig [field ]
0 commit comments