@@ -283,6 +283,7 @@ static char *dest_ssid_path[16] = {
283
283
static packet_t digipeat_match (int from_chan , packet_t pp , char * mycall_rec , char * mycall_xmit ,
284
284
regex_t * alias , regex_t * wide , int to_chan , enum preempt_e preempt , char * filter_str )
285
285
{
286
+ char source [AX25_MAX_ADDR_LEN ];
286
287
int ssid ;
287
288
int r ;
288
289
char repeater [AX25_MAX_ADDR_LEN ];
@@ -292,8 +293,6 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
292
293
/*
293
294
* First check if filtering has been configured.
294
295
*/
295
-
296
-
297
296
if (filter_str != NULL ) {
298
297
299
298
if (pfilter (from_chan , to_chan , filter_str , pp , 1 ) != 1 ) {
@@ -351,10 +350,13 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
351
350
352
351
353
352
/*
354
- * First check for explicit use of my call.
353
+ * First check for explicit use of my call, including SSID.
354
+ * Someone might explicitly specify a particular path for testing purposes.
355
+ * This will bypass the usual checks for duplicates and my call in the source.
356
+ *
355
357
* In this case, we don't check the history so it would be possible
356
358
* to have a loop (of limited size) if someone constructed the digipeater paths
357
- * correctly.
359
+ * correctly. I would expect it only for testing purposes.
358
360
*/
359
361
360
362
if (strcmp (repeater , mycall_rec ) == 0 ) {
@@ -370,13 +372,24 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
370
372
return (result );
371
373
}
372
374
375
+ /*
376
+ * Don't digipeat my own. Fixed in 1.4 dev H.
377
+ * Alternatively we might feed everything transmitted into
378
+ * dedupe_remember rather than only frames out of digipeater.
379
+ */
380
+ ax25_get_addr_with_ssid (pp , AX25_SOURCE , source );
381
+ if (strcmp (source , mycall_rec ) == 0 ) {
382
+ return (NULL );
383
+ }
384
+
385
+
373
386
/*
374
387
* Next try to avoid retransmitting redundant information.
375
388
* Duplicates are detected by comparing only:
376
389
* - source
377
390
* - destination
378
391
* - info part
379
- * - but none of the digipeaters
392
+ * - but not the via path. (digipeater addresses)
380
393
* A history is kept for some amount of time, typically 30 seconds.
381
394
* For efficiency, only a checksum, rather than the complete fields
382
395
* might be kept but the result is the same.
@@ -385,7 +398,6 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
385
398
*
386
399
*/
387
400
388
-
389
401
if (dedupe_check (pp , to_chan )) {
390
402
//#if DEBUG
391
403
/* Might be useful if people are wondering why */
@@ -399,7 +411,10 @@ static packet_t digipeat_match (int from_chan, packet_t pp, char *mycall_rec, ch
399
411
400
412
/*
401
413
* For the alias pattern, we unconditionally digipeat it once.
402
- * i.e. Just replace it with MYCALL don't even look at the ssid.
414
+ * i.e. Just replace it with MYCALL.
415
+ *
416
+ * My call should be an implied member of this set.
417
+ * In this implementation, we already caught it further up.
403
418
*/
404
419
err = regexec (alias ,repeater ,0 ,NULL ,0 );
405
420
if (err == 0 ) {
@@ -812,6 +827,7 @@ int main (int argc, char *argv[])
812
827
/*
813
828
* Drop duplicates within specified time interval.
814
829
* Only the first 1 of 3 should be retransmitted.
830
+ * The 4th case might be controversial.
815
831
*/
816
832
817
833
test ( "W1XYZ>TEST,R1*,WIDE3-2:info1" ,
@@ -823,6 +839,10 @@ int main (int argc, char *argv[])
823
839
test ( "W1XYZ>TEST,R3*,WIDE3-2:info1" ,
824
840
"" );
825
841
842
+ test ( "W1XYZ>TEST,R1*,WB2OSZ-9:has explicit routing" ,
843
+ "W1XYZ>TEST,R1,WB2OSZ-9*:has explicit routing" );
844
+
845
+
826
846
/*
827
847
* Allow same thing after adequate time.
828
848
*/
@@ -882,8 +902,23 @@ int main (int argc, char *argv[])
882
902
883
903
/*
884
904
* Did I miss any cases?
905
+ * Yes. Don't retransmit my own. 1.4H
885
906
*/
886
907
908
+ test ( "WB2OSZ-7>TEST14,WIDE1-1,WIDE1-1:stuff" ,
909
+ "WB2OSZ-7>TEST14,WB2OSZ-9*,WIDE1-1:stuff" );
910
+
911
+ test ( "WB2OSZ-9>TEST14,WIDE1-1,WIDE1-1:from myself" ,
912
+ "" );
913
+
914
+ test ( "WB2OSZ-9>TEST14,WIDE1-1*,WB2OSZ-9:from myself but explicit routing" ,
915
+ "WB2OSZ-9>TEST14,WIDE1-1,WB2OSZ-9*:from myself but explicit routing" );
916
+
917
+ test ( "WB2OSZ-15>TEST14,WIDE1-1,WIDE1-1:stuff" ,
918
+ "WB2OSZ-15>TEST14,WB2OSZ-9*,WIDE1-1:stuff" );
919
+
920
+
921
+
887
922
if (failed == 0 ) {
888
923
dw_printf ("SUCCESS -- All digipeater tests passed.\n" );
889
924
}
0 commit comments