コミットメタ情報

リビジョン4fa4caac9dfe64127e20c018642d765d3197dcb9 (tree)
日時2019-07-26 15:25:37
作者Satoshi Yasuda <7m3tjz@jarl...>
コミッターSatoshi Yasuda

ログメッセージ

modified: xchange.c
modified: xchange.h
modified: xchange_util.c

変更サマリ

差分

--- a/xchange.c
+++ b/xchange.c
@@ -72,7 +72,7 @@ void xchange_zr(void)
7272 zr_in_cnt++;
7373 send_zr_reply (zr_buff.zr_buffer);
7474 /* Location information update packet */
75- if ((zr_buff.zr_buffer[7] == 0x21) && (zr_length == 26))
75+ if (zr_buff.zr_buffer[7] == 0x21)
7676 {
7777 if ((zr_buff.zr_buffer[10] != 0x20)
7878 && (memcmp (&zr_buff.zr_buffer[10], "CQCQCQ", 6)))
--- a/xchange.h
+++ b/xchange.h
@@ -177,6 +177,7 @@ struct timeval tm0;
177177 struct FifoPkt
178178 {
179179 struct FifoPkt *next;
180+ time_t time;
180181 int length;
181182 unsigned char pkt[1024];
182183 };
--- a/xchange_util.c
+++ b/xchange_util.c
@@ -64,7 +64,6 @@ struct ModuleTable *module_check (char call[])
6464 return NULL;
6565 }
6666
67-
6867 struct ModuleTable *module_check_ex (unsigned char FrameID[])
6968 {
7069 struct ModuleTable *pnt;
@@ -393,6 +392,9 @@ void putFifo (int len, unsigned char pkt[])
393392 {
394393 struct FifoPkt *ret;
395394 time_t atime;
395+
396+fprintf (log_file, "debug %d\n", len);
397+fflush (log_file);
396398 if (gw_Fifo_cnt > 20)
397399 {
398400 if (gw_down_cnt < 12)
@@ -405,9 +407,9 @@ void putFifo (int len, unsigned char pkt[])
405407 //sleep (5);
406408 return; /* dsgwd down */
407409 }
408- if ((len == Wp->length) && (len != 26))
410+ if ((len == Wp->length) && (pkt[7] != 0x21))
409411 {
410- if (!memcmp (&pkt[6], &Wp->pkt[6], len-6)) return;
412+ if (!memcmp (&pkt[6], &Wp->pkt[6], len-6)) return;
411413 }
412414 ret = malloc (sizeof(struct FifoPkt) - 1024 + len);
413415 if (ret == NULL)
@@ -417,6 +419,7 @@ void putFifo (int len, unsigned char pkt[])
417419 return;
418420 }
419421 ret->next = NULL;
422+ time(&ret->time);
420423 ret->length = len;
421424 memcpy (ret->pkt, pkt, len);
422425 Wp->next = ret;
@@ -634,9 +637,9 @@ void put_zr_Fifo (int len, unsigned char pkt[])
634637 struct FifoPkt *ret;
635638 time_t atime;
636639
637- if (len == zr_Wp->length)
640+ if ((len == zr_Wp->length) && (pkt[7] != 0x21))
638641 {
639- if (!memcmp (&pkt[6], &zr_Wp->pkt[6], len-6)) return;
642+ if (!memcmp (&pkt[6], &zr_Wp->pkt[6], len-6)) return;
640643 }
641644 ret = malloc (sizeof(struct FifoPkt) - 1024 + len);
642645 if (ret == NULL)
@@ -646,6 +649,7 @@ void put_zr_Fifo (int len, unsigned char pkt[])
646649 return;
647650 }
648651 ret->next = NULL;
652+ time(&ret->time);
649653 ret->length = len;
650654 memcpy (ret->pkt, pkt, len);
651655 zr_Wp->next = ret;
旧リポジトリブラウザで表示