diff --git a/src/Cedar/Connection.c b/src/Cedar/Connection.c index fc98dc28..eb4f1005 100644 --- a/src/Cedar/Connection.c +++ b/src/Cedar/Connection.c @@ -1082,12 +1082,12 @@ void ConnectionSend(CONNECTION *c, UINT64 now) for (i = 0;i < num;i++) { TCPSOCK *tcpsock = tcpsocks[i]; - if (tcpsock->Sock->Connected && tcpsock->Sock->AsyncMode && + if (s != NULL && tcpsock->Sock->Connected && tcpsock->Sock->AsyncMode && IS_SEND_TCP_SOCK(tcpsock)) { // Processing of KeepAlive if (now >= tcpsock->NextKeepAliveTime || tcpsock->NextKeepAliveTime == 0 || - (s != NULL && s->UseUdpAcceleration && s->UdpAccel != NULL && s->UdpAccel->MyPortByNatTServerChanged)) + (s->UseUdpAcceleration && s->UdpAccel != NULL && s->UdpAccel->MyPortByNatTServerChanged)) { // Send the KeepAlive SendKeepAlive(c, tcpsock); diff --git a/src/Cedar/Protocol.c b/src/Cedar/Protocol.c index 9cf11dff..77f3c592 100644 --- a/src/Cedar/Protocol.c +++ b/src/Cedar/Protocol.c @@ -2948,12 +2948,9 @@ bool ServerAccept(CONNECTION *c) // VLAN ID if (assigned_vlan_id != 0) { - if (policy != NULL) + if (policy->VLanId == 0) { - if (policy->VLanId == 0) - { - policy->VLanId = assigned_vlan_id; - } + policy->VLanId = assigned_vlan_id; } } @@ -3146,12 +3143,7 @@ bool ServerAccept(CONNECTION *c) s->Timeout = timeout; s->QoS = qos; s->NoReconnectToSession = no_reconnect_to_session; - - - if (policy != NULL) - { - s->VLanId = policy->VLanId; - } + s->VLanId = policy->VLanId; // User name s->Username = CopyStr(username);