@@ -494,7 +494,7 @@ func (c *spoc) findSubnetsInNatDomain0(domains []*natDomain, networks netList) {
494494 // there's no method to specify a natted network
495495 // as value of subnet_of.
496496 if natSubnet .subnetOf == bignet {
497- subnet .subnetOfUsed = true
497+ natSubnet .subnetOfUsed = true
498498 } else if bignet .hasSubnets &&
499499 (bignet .ipp .Bits () == 0 ||
500500 zoneEq (bignet .zone , subnet .zone ) ||
@@ -629,12 +629,18 @@ func isLoopbackAtZoneBorder(sub, big *network) bool {
629629}
630630
631631func (c * spoc ) findUselessSubnetAttr () {
632- for _ , n := range c . allNetworks {
632+ check := func ( n * network ) {
633633 if bignet := n .subnetOf ; bignet != nil && ! n .subnetOfUsed {
634- c .warn ("Useless 'subnet_of = %s' at %s" , bignet , n . vxName ( ))
634+ c .warn ("Useless 'subnet_of = %s' at %s" , bignet , natName ( n ))
635635 }
636636 if n .hasSubnets && ! n .hasSubnetsUsed {
637- c .warn ("Useless 'has_subnets' at %s" , n .vxName ())
637+ c .warn ("Useless 'has_subnets' at %s" , natName (n ))
638+ }
639+ }
640+ for _ , n := range c .allNetworks {
641+ check (n )
642+ for _ , nn := range n .nat {
643+ check (nn )
638644 }
639645 }
640646}
0 commit comments