@@ -495,24 +495,23 @@ func (c *spoc) findSubnetsInNatDomain0(domains []*natDomain, networks netList) {
495495 // as value of subnet_of.
496496 if natSubnet .subnetOf == bignet {
497497 subnet .subnetOfUsed = true
498- } else if ! ( bignet .hasSubnets &&
498+ } else if bignet .hasSubnets &&
499499 (bignet .ipp .Bits () == 0 ||
500500 zoneEq (bignet .zone , subnet .zone ) ||
501- isLoopbackAtZoneBorder (subnet , bignet ))) {
502-
503- if printType := c .conf .CheckSubnets ; printType != "" {
504- // Prevent multiple error messages in
505- // different NAT domains.
506- if natSubnet .subnetOf == nil {
507- natSubnet .subnetOf = bignet
508- natSubnet .subnetOfUsed = true
509- }
510- c .warnOrErr (printType ,
511- "%s is subnet of %s\n " +
512- " in %s.\n " +
513- " If desired, declare attribute 'subnet_of'" ,
514- natName (natSubnet ), natName (natBignet ), domain .name )
501+ isLoopbackAtZoneBorder (subnet , bignet )) {
502+ bignet .hasSubnetsUsed = true
503+ } else if printType := c .conf .CheckSubnets ; printType != "" {
504+ // Prevent multiple error messages in
505+ // different NAT domains.
506+ if natSubnet .subnetOf == nil {
507+ natSubnet .subnetOf = bignet
508+ natSubnet .subnetOfUsed = true
515509 }
510+ c .warnOrErr (printType ,
511+ "%s is subnet of %s\n " +
512+ " in %s.\n " +
513+ " If desired, declare attribute 'subnet_of'" ,
514+ natName (natSubnet ), natName (natBignet ), domain .name )
516515 }
517516 }
518517
@@ -624,10 +623,13 @@ func isLoopbackAtZoneBorder(sub, big *network) bool {
624623 return false
625624}
626625
627- func (c * spoc ) findUselessSubnetOf () {
626+ func (c * spoc ) findUselessSubnetAttr () {
628627 for _ , n := range c .allNetworks {
629628 if bignet := n .subnetOf ; bignet != nil && ! n .subnetOfUsed {
630- c .warn ("Useless 'subnet_of = %s' at %s" , bignet , n )
629+ c .warn ("Useless 'subnet_of = %s' at %s" , bignet , n .vxName ())
630+ }
631+ if n .hasSubnets && ! n .hasSubnetsUsed {
632+ c .warn ("Useless 'has_subnets' at %s" , n .vxName ())
631633 }
632634 }
633635}
@@ -753,5 +755,5 @@ func (c *spoc) findSubnetsInNatDomain(domains []*natDomain) {
753755 setMaxSecondaryNet (networks )
754756 }
755757 })
756- c .findUselessSubnetOf ()
758+ c .findUselessSubnetAttr ()
757759}
0 commit comments