Explorar o código

prevent ingress creation on NATed host

Matthew R Kasun %!s(int64=2) %!d(string=hai) anos
pai
achega
47ff309510
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      logic/gateway.go

+ 3 - 0
logic/gateway.go

@@ -112,6 +112,9 @@ func CreateIngressGateway(netid string, nodeid string, ingress models.IngressReq
 	if host.FirewallInUse == models.FIREWALL_NONE {
 		return models.Node{}, errors.New("firewall is not supported for ingress gateways")
 	}
+	if host.NatType != models.NAT_Types.Public {
+		return models.Node{}, errors.New("ingress cannot be created on nodes behind NAT")
+	}
 
 	network, err := GetParentNetwork(netid)
 	if err != nil {