From a0e445d1b19e8da4e0c11479fee4bf15c703ca6d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 28 Aug 2019 09:16:42 -0400 Subject: [PATCH 1/3] Force MSS down for forwarded connections Some endpoints may not be able to fully handle the natural MSS suggested by MTU. --- confluent_server/confluent/forwarder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_server/confluent/forwarder.py b/confluent_server/confluent/forwarder.py index 676c2e57..a6b5b80b 100644 --- a/confluent_server/confluent/forwarder.py +++ b/confluent_server/confluent/forwarder.py @@ -49,6 +49,7 @@ def forward_port(sock, target, clientip, sessionid): continue try: client = socket.create_connection((target, 443)) + client.setsockopt(socket.IPPROTO_TCP, socket.TCP_MAXSEG, 1456) except Exception: conn.close() continue @@ -68,6 +69,7 @@ def forward_video(): try: vidclient = socket.create_connection((vidtargetbypeer[cli[0]], 3900)) + vidclient.setsockopt(socket.IPPROTO_TCP, socket.TCP_MAXSEG, 1456) except Exception: conn.close() continue From 97a950b145a104a57b4691551163b23c36fade99 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 28 Aug 2019 09:46:35 -0400 Subject: [PATCH 2/3] Retain XCC IP on discovery if already set Do not change from DHCP if DHCP is working the way intended. --- .../confluent/discovery/handlers/xcc.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/confluent_server/confluent/discovery/handlers/xcc.py b/confluent_server/confluent/discovery/handlers/xcc.py index 1ae0b160..d7809dde 100644 --- a/confluent_server/confluent/discovery/handlers/xcc.py +++ b/confluent_server/confluent/discovery/handlers/xcc.py @@ -386,11 +386,17 @@ class NodeHandler(immhandler.NodeHandler): raise exc.NotImplementedException('IPv6 remote config TODO') netconfig = netutil.get_nic_config(self.configmanager, nodename, ip=newip) newmask = netutil.cidr_to_mask(netconfig['prefix']) - # do not change the ipv4_config if the current config looks - statargs = {'ENET_IPv4Ena': '1', 'ENET_IPv4AddrSource': '0', 'ENET_IPv4StaticIPAddr': newip, 'ENET_IPv4StaticIPNetMask': newmask} - if netconfig['ipv4_gateway']: - statargs['ENET_IPv4GatewayIPAddr'] = netconfig['ipv4_gateway'] - wc.grab_json_response('/api/dataset', statargs) + currinfo = wc.grab_json_response('/api/providers/logoninfo') + currip = currinfo.get('items', [{}])[0].get('ipv4_address', '') + # do not change the ipv4_config if the current config looks right already + if currip != newip: + statargs = { + 'ENET_IPv4Ena': '1', 'ENET_IPv4AddrSource': '0', + 'ENET_IPv4StaticIPAddr': newip, 'ENET_IPv4StaticIPNetMask': newmask + } + if netconfig['ipv4_gateway']: + statargs['ENET_IPv4GatewayIPAddr'] = netconfig['ipv4_gateway'] + wc.grab_json_response('/api/dataset', statargs) elif self.ipaddr.startswith('fe80::'): self.configmanager.set_node_attributes( {nodename: {'hardwaremanagement.manager': self.ipaddr}}) From f03bb36dbe3c998213cb469f1e08091b5c6f08ac Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 29 Aug 2019 15:24:14 -0400 Subject: [PATCH 3/3] Fix nodeconfig treatment of bmc attributes Make bmc behave like other categories/settings. --- confluent_client/bin/nodeconfig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/confluent_client/bin/nodeconfig b/confluent_client/bin/nodeconfig index b68888b3..5b752826 100755 --- a/confluent_client/bin/nodeconfig +++ b/confluent_client/bin/nodeconfig @@ -99,6 +99,7 @@ assignment = {} queryparms = {} printsys = [] printbmc = [] +printallbmc = False setsys = {} forceset = False needval = None @@ -123,7 +124,7 @@ def _assign_value(): def parse_config_line(arguments): - global setmode, forceset, key, value, needval, candidate, path, attrib + global setmode, printallbmc, forceset, key, value, needval, candidate, path, attrib for param in arguments: if param == 'show': continue # forgive muscle memory of pasu users @@ -155,6 +156,8 @@ def parse_config_line(arguments): if setmode != False: bailout('Cannot do set and query in same command') if '.' not in param: + if param == 'bmc': + printallbmc = True matchedparms = False for candidate in cfgpaths: if candidate.startswith('{0}.'.format(param)): @@ -266,7 +269,7 @@ else: NullOpt(), queryparms[path]) if rc: sys.exit(rc) - if printbmc: + if printbmc or printallbmc: rcode = client.print_attrib_path( '/noderange/{0}/configuration/management_controller/extended/all'.format(noderange), session, printbmc, options, attrprefix='bmc.')