code: func validateNetMode(c *container.Config, hc *container.HostConfig) error {
  	// We may not be passed a host config, such as in the case of docker commit
  	if hc == nil {
  		return nil
  	}
  
  	err := validateNetContainerMode(c, hc)
  	if err != nil {
  		return err
  	}
  
  	if hc.UTSMode.IsHost() && c.Hostname != "" {
  		return ErrConflictUTSHostname
  	}
  
  	if hc.NetworkMode.IsHost() && len(hc.Links) > 0 {
  		return ErrConflictHostNetworkAndLinks
  	}
  
  	return nil
  }
docs: // validateNetMode ensures that the various combinations of requested
  // network settings are valid.