From 2c7b58d47a59e65bcbef489946b1e3265c836d35 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 22 Nov 2022 09:24:18 -0500 Subject: [PATCH] Put brakes on configuration if no gateway and target is remote This configuration would certainly destroy remote connectivity. --- confluent_server/confluent/discovery/handlers/xcc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_server/confluent/discovery/handlers/xcc.py b/confluent_server/confluent/discovery/handlers/xcc.py index 5b612991..23f31fb0 100644 --- a/confluent_server/confluent/discovery/handlers/xcc.py +++ b/confluent_server/confluent/discovery/handlers/xcc.py @@ -594,6 +594,8 @@ class NodeHandler(immhandler.NodeHandler): } if netconfig['ipv4_gateway']: statargs['ENET_IPv4GatewayIPAddr'] = netconfig['ipv4_gateway'] + elif not netutil.address_is_local(newip): + raise exc.InvalidArgumentException('Will not remotely configure a device with no gateway') wc.grab_json_response('/api/dataset', statargs) elif self.ipaddr.startswith('fe80::'): self.configmanager.set_node_attributes(