• R/O
  • HTTP
  • SSH
  • HTTPS

multi_forward: Commit


Commit MetaInfo

Revision30b8110219e983c13947d49e134b02de4ab23adf (tree)
Zeit2019-09-12 13:49:36
AutorSatoshi Yasuda <yasuda@jk1z...>
CommiterSatoshi Yasuda

Log Message

modified: forward_in.c
modified: multi_forward_utils.c

Ändern Zusammenfassung

Diff

--- a/forward_in.c
+++ b/forward_in.c
@@ -138,6 +138,7 @@ create:
138138 ar_call_next->next = ar_callsign_pnt;
139139 ar_callsign_pnt = ar_call_next;
140140 }
141+ send_hole_punch();
141142 skip:
142143 time (&ar_call_next->status_time);
143144 if (forward_buff.d_packet.c & ZR)
--- a/multi_forward_utils.c
+++ b/multi_forward_utils.c
@@ -186,9 +186,9 @@ void send_hole_punch (void)
186186 struct addrinfo *result, *rp;
187187 char PORT[10];
188188 int ret;
189- double version;
190- int ver;
191189 time_t atime;
190+ char temp[10];
191+ char *pnt;
192192
193193 memset (&hints, 0x00, sizeof(struct addrinfo));
194194 hints.ai_family = AF_UNSPEC;
@@ -213,11 +213,12 @@ void send_hole_punch (void)
213213 memcpy (&hole_punch[4], ar_temp->ar_callsign, 8);
214214 hole_punch[12] = (multi_port >> 8) & 0xff;
215215 hole_punch[13] = multi_port & 0xff;
216- version = atof(VERSION);
217- ver = version;
218- hole_punch[14] = ver & 0xff;
219- ver = version * 100;
220- hole_punch[15] = ver % 100;
216+ memset (temp, 0x00, sizeof(temp));
217+ memcpy (temp, VERSION, strlen(VERSION));
218+ pnt = strtok(temp, ".");
219+ hole_punch[14] = atoi(pnt) & 0xff;
220+ pnt = strtok(NULL,".");
221+ hole_punch[15] = atoi(pnt) & 0xff;
221222 memcpy (&hole_punch[16], zr_callsign, 8);
222223 //hole_punch[23] = 0x20;
223224 ret = sendto(multi_sd, hole_punch, 24, 0,
Show on old repository browser