• R/O
  • HTTP
  • SSH
  • HTTPS

dxchange: Commit


Commit MetaInfo

Revision592c450b5a1fd5157f1daff781d871e2671c581e (tree)
Time2016-06-27 01:08:19
AuthorSatoshi Yasuda <7m3tjz@jk1z...>
CommiterSatoshi Yasuda

Log Message

modified: repeater.c

Change Summary

Incremental Difference

--- a/repeater.c
+++ b/repeater.c
@@ -29,6 +29,8 @@ struct sockaddr_in zr_out_addr;
2929 struct sockaddr_in gw_in_addr;
3030 struct sockaddr_in gw_out_addr;
3131
32+char zr_frame_id[2] = {0x00, 0x00};
33+
3234 union
3335 {
3436 struct dstar_packet d_packet;
@@ -61,13 +63,24 @@ void repeater_zr(void)
6163 send_zr_reply (zr_buff.zr_buffer);
6264 send_gw (zr_buff.zr_buffer);
6365
64- pnt = forward_pnt;
65- while (pnt)
66- {
67- sendto (pnt->fwd_sd, &zr_buff, zr_length, 0,
68- pnt->fwd_info->ai_addr, pnt->fwd_info->ai_addrlen);
69- pnt = pnt->f_chain;
70- }
66+ if (zr_length == 58)
67+ {
68+ if (zr_port > 0)
69+ {
70+ memcpy (zr_frame_id, &zr_buff.zr_buffer[14], 2);
71+ }
72+ }
73+
74+ if (!memcmp (zr_frame_id, &zr_buff.zr_buffer[14], 2))
75+ {
76+ pnt = forward_pnt;
77+ while (pnt)
78+ {
79+ sendto (pnt->fwd_sd, &zr_buff, zr_length, 0,
80+ pnt->fwd_info->ai_addr, pnt->fwd_info->ai_addrlen);
81+ pnt = pnt->f_chain;
82+ }
83+ }
7184 }
7285 else if (zr_buff.zr_buffer[6] == 'r')
7386 {
@@ -76,7 +89,8 @@ void repeater_zr(void)
7689 if (seq_tmp != send_zr_seq_save)
7790 {
7891 time(&atime);
79- fprintf (log_file, "%24.24s zr seq. send:%d recv:%d\n", ctime(&atime), send_zr_seq_save, seq_tmp);
92+ fprintf (log_file, "%24.24s zr seq. send:%d recv:%d\n",
93+ ctime(&atime), send_zr_seq_save, seq_tmp);
8094 fflush (log_file);
8195 //send_zr_seq = seq_tmp;
8296 }
Show on old repository browser