• R/O
  • HTTP
  • SSH
  • HTTPS

multi_forward: Commit


Commit MetaInfo

Revision282e516ce89782af9b865564baf8c731a9188da9 (tree)
Zeit2019-10-25 20:49:50
AutorSatoshi Yasuda <7m3tjz@jarl...>
CommiterSatoshi Yasuda

Log Message

modified: forward_in.c
modified: multi_forward_utils.c

Ändern Zusammenfassung

Diff

--- a/forward_in.c
+++ b/forward_in.c
@@ -315,22 +315,13 @@ void multi_connect (void)
315315 trust_read (length, &multi_buff);
316316 return;
317317 }
318- next = MultiConnectTablePnt;
319- while (next)
318+ if (length == 24)
320319 {
321- if ((multi_addr.sin_addr.s_addr == next->multi_addr.sin_addr.s_addr)
322- && (multi_addr.sin_port == next->multi_addr.sin_port))
320+ if (!memcmp (&multi_buff.multi_buffer, "DISCONNECT", 10))
323321 {
324- time (&next->AccessTime);
325- next->in++;
326- if (next->auth == AUTH_FALSE) return; // connect not permit
327- goto next;
322+ delete_MultiConnectTable (multi_addr);
323+ return;
328324 }
329- next = next->f_chain;
330- }
331- if (length == 24)
332- {
333- if (!memcmp (&multi_buff.multi_buffer, "DISCONNECT", 10)) return;
334325 if (!ja_check (&multi_buff.multi_buffer[16]))
335326 {
336327 time(&atime);
@@ -357,12 +348,22 @@ void multi_connect (void)
357348 }
358349 return;
359350 }
360-next:
361- if ((length == 24) && !memcmp(&multi_buff.multi_buffer, "DISCONNECT", 10))
351+
352+ next = MultiConnectTablePnt;
353+ while (next)
362354 {
363- delete_MultiConnectTable (multi_addr);
364- return;
355+ if ((multi_addr.sin_addr.s_addr == next->multi_addr.sin_addr.s_addr)
356+ && (multi_addr.sin_port == next->multi_addr.sin_port))
357+ {
358+ time (&next->AccessTime);
359+ next->in++;
360+ if (next->auth == AUTH_FALSE) return; // connect not permit
361+ break;
362+ }
363+ next = next->f_chain;
365364 }
365+ if (next == NULL) return;
366+next:
366367 if (!memcmp (multi_buff.d_packet.id, "DSTR", 4))
367368 {
368369 if (((multi_buff.d_packet.c & C_MASK) == VOICE)
--- a/multi_forward_utils.c
+++ b/multi_forward_utils.c
@@ -520,7 +520,7 @@ void trust_read (int length, unsigned char buff[])
520520 next->auth = AUTH_TRUE;
521521 time (&atime);
522522 fprintf (log_file, "%24.24s Connect from %8.8s %s(%d)\n", ctime(&atime),
523- next->auth_callsign, inet_ntoa (next->multi_addr.sin_addr), next->multi_addr.sin_port);
523+ next->auth_callsign, inet_ntoa (next->multi_addr.sin_addr), next->multi_addr.sin_port);
524524 fflush (log_file);
525525 ctbl();
526526 send_no_error_auth (next);
Show on old repository browser