Skip to content

Commit

Permalink
ignore zero IPs
Browse files Browse the repository at this point in the history
  • Loading branch information
flowtron committed Apr 6, 2022
1 parent 86beba8 commit c81b3b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/src/clients2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false)
int clockoffset = s->serverclock - s->clientclock;
if(curpeer && iabs(clockoffset) > 60 * 24) conoutf("\f3warning: server and client clock are offset more than one day (%d minutes)", clockoffset);

clientlogf("own IP: %s, censored own IP: %s, %s, clock offset %d hours %d minutes", iptoa(s->clientip, tmp1), iptoa(s->clientipcensored, tmp2), cc, clockoffset / 60, clockoffset % 60);
if(s->clientip>0) clientlogf("own IP: %s, censored own IP: %s, %s, clock offset %d hours %d minutes", iptoa(s->clientip, tmp1), iptoa(s->clientipcensored, tmp2), cc, clockoffset / 60, clockoffset % 60);
if(curpeer && s->serverip)
{
s->curpeerip = ENET_NET_TO_HOST_32(curpeer->address.host);
Expand All @@ -327,7 +327,10 @@ void parsemessages(int cn, playerent *d, ucharbuf &p, bool demo = false)

defformatstring(challenge)("SERVINFOCHALLENGE<(%d) cn: %d c: %s (%s) s: %s:%d", sessionid, s->cn, iptoa(s->clientipcensored, tmp1), cc, iptoa(s->serverip, tmp2), s->curpeerport);
concatformatstring(challenge, " %s st: %d ct: %d (%d)>", bin2hex(tmp1, s->serverpubkey, 32), s->serverclock, s->clientclock, s->clientsalt);
clientlogf("auth challenge: %s", challenge);
if(s->serverip>0)
{
clientlogf("auth challenge: %s", challenge);
}
int chlen = (int)strlen(challenge);
if(chlen >= MAXSTRLEN - 65)
{
Expand Down

0 comments on commit c81b3b7

Please sign in to comment.