diff --git a/src/Cedar/Command.c b/src/Cedar/Command.c index 7f380b33..2fbbddd5 100644 --- a/src/Cedar/Command.c +++ b/src/Cedar/Command.c @@ -19678,30 +19678,17 @@ UINT PsDhcpDisable(CONSOLE *c, char *cmd_name, wchar_t *str, void *param) } else { - bool ok = true; - t.UseDhcp = false; - if (ok == false) + ret = ScSetSecureNATOption(ps->Rpc, &t); + + if (ret != ERR_NO_ERROR) { - // Parameter is invalid - ret = ERR_INVALID_PARAMETER; + // An error has occured CmdPrintError(c, ret); FreeParamValueList(o); return ret; } - else - { - ret = ScSetSecureNATOption(ps->Rpc, &t); - - if (ret != ERR_NO_ERROR) - { - // An error has occured - CmdPrintError(c, ret); - FreeParamValueList(o); - return ret; - } - } } FreeParamValueList(o); diff --git a/src/Cedar/IPsec_PPP.c b/src/Cedar/IPsec_PPP.c index e95e68cb..6721172a 100644 --- a/src/Cedar/IPsec_PPP.c +++ b/src/Cedar/IPsec_PPP.c @@ -2142,11 +2142,6 @@ PPP_PACKET *ParsePPPPacket(void *data, UINT size) buf = (UCHAR *)data; - // Address - if (size < 1) - { - goto LABEL_ERROR; - } if (buf[0] != 0xff) { goto LABEL_ERROR; @@ -2370,20 +2365,10 @@ PPP_LCP *ParseLCP(USHORT protocol, void *data, UINT size) Zero(&o, sizeof(o)); - // Type - if (len < 1) - { - goto LABEL_ERROR; - } o.Type = buf[0]; buf++; len--; - // Length - if (len < 1) - { - goto LABEL_ERROR; - } o.DataSize = buf[0]; if (o.DataSize < 2) { diff --git a/src/Cedar/Interop_OpenVPN.c b/src/Cedar/Interop_OpenVPN.c index 151bd159..9d42c466 100644 --- a/src/Cedar/Interop_OpenVPN.c +++ b/src/Cedar/Interop_OpenVPN.c @@ -1623,11 +1623,6 @@ OPENVPN_PACKET *OvsParsePacket(UCHAR *data, UINT size) ret = ZeroMalloc(sizeof(OPENVPN_PACKET)); - // OpCode + KeyID - if (size < 1) - { - goto LABEL_ERROR; - } uc = *((UCHAR *)data); data++; size--; diff --git a/src/Cedar/Logging.c b/src/Cedar/Logging.c index e25c4eb4..87330318 100644 --- a/src/Cedar/Logging.c +++ b/src/Cedar/Logging.c @@ -1145,14 +1145,7 @@ bool PacketLog(HUB *hub, SESSION *src_session, SESSION *dest_session, PKT *packe pl->Cedar = hub->Cedar; pl->Packet = p; pl->NoLog = no_log; - if (src_session != NULL) - { - pl->SrcSessionName = CopyStr(src_session->Name); - } - else - { - pl->SrcSessionName = CopyStr(""); - } + pl->SrcSessionName = CopyStr(src_session->Name); if (dest_session != NULL) { pl->DestSessionName = CopyStr(dest_session->Name); diff --git a/src/Cedar/Protocol.c b/src/Cedar/Protocol.c index d5919c3c..3d21257f 100644 --- a/src/Cedar/Protocol.c +++ b/src/Cedar/Protocol.c @@ -6112,51 +6112,12 @@ bool ServerDownloadSignature(CONNECTION *c, char **error_detail_str) { // Root directory SERVER *s = c->Cedar->Server; - bool is_free = false; *error_detail_str = "HTTP_ROOT"; { - if (is_free == false) - { - // Other than free version - HttpSendForbidden(c->FirstSock, h->Target, ""); - } - else - { - // Free version - BUF *b = ReadDump("|free.htm"); - - if (b != NULL) - { - char *src = ZeroMalloc(b->Size + 1); - UINT dst_size = b->Size * 2 + 64; - char *dst = ZeroMalloc(dst_size); - char host[MAX_PATH]; - char portstr[64]; - - GetMachineName(host, sizeof(host)); - ToStr(portstr, c->FirstSock->LocalPort); - - Copy(src, b->Buf, b->Size); - ReplaceStrEx(dst, dst_size, src, - "$HOST$", host, false); - ReplaceStrEx(dst, dst_size, dst, - "$PORT$", portstr, false); - - FreeHttpHeader(h); - h = NewHttpHeader("HTTP/1.1", "202", "OK"); - AddHttpValue(h, NewHttpValue("Content-Type", HTTP_CONTENT_TYPE4)); - AddHttpValue(h, NewHttpValue("Connection", "Keep-Alive")); - AddHttpValue(h, NewHttpValue("Keep-Alive", HTTP_KEEP_ALIVE)); - PostHttp(c->FirstSock, h, dst, StrLen(dst)); - - Free(src); - Free(dst); - - FreeBuf(b); - } - } + // Other than free version + HttpSendForbidden(c->FirstSock, h->Target, ""); } } else diff --git a/src/Cedar/Server.c b/src/Cedar/Server.c index 5ec4ecba..51ede8e7 100644 --- a/src/Cedar/Server.c +++ b/src/Cedar/Server.c @@ -5766,7 +5766,6 @@ void SiLoadServerCfg(SERVER *s, FOLDER *f) char tmp[MAX_SIZE]; X *x = NULL; K *k = NULL; - bool cluster_allowed = false; UINT num_connections_per_ip = 0; FOLDER *params_folder; UINT i; @@ -6028,13 +6027,8 @@ void SiLoadServerCfg(SERVER *s, FOLDER *f) } Unlock(c->TrafficLock); - // Get whether the current license allows cluster mode - cluster_allowed = true; - - // Type of server - s->UpdatedServerType = s->ServerType = - cluster_allowed ? CfgGetInt(f, "ServerType") : SERVER_TYPE_STANDALONE; + s->UpdatedServerType = s->ServerType = CfgGetInt(f, "ServerType"); // Password if (CfgGetByte(f, "HashedPassword", s->HashedPassword, sizeof(s->HashedPassword)) != sizeof(s->HashedPassword))