Skip to content

Commit f38cd06

Browse files
committed
Fixed no rf-gate w/o digi bug
Turns out that when configured as an I-gate and NOT as a digipeater, aprx didn't add any heard stations to the historydb, since the receiver wasn't a source for the transmitter. This made being an implicit RF-gate without being a digipeater impossible.
1 parent 2949643 commit f38cd06

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

aprx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ extern int digipeater_config(struct configfile *cf);
667667
extern void digipeater_receive(struct digipeater_source *src, struct pbuf_t *pb);
668668
extern int digipeater_receive_filter(struct digipeater_source *src, struct pbuf_t *pb);
669669
extern dupecheck_t *digipeater_find_dupecheck(const struct aprx_interface *aif);
670+
extern struct digipeater* digipeater_find_by_iface(const struct aprx_interface *aif);
670671

671672
/* interface.c */
672673

digipeater.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,18 @@ dupecheck_t *digipeater_find_dupecheck(const struct aprx_interface *aif)
16721672
return NULL;
16731673
}
16741674

1675+
struct digipeater* digipeater_find_by_iface(const struct aprx_interface *aif) {
1676+
int i;
1677+
for (i = 0; i < digi_count; i++) {
1678+
if (aif == digis[i]->transmitter)
1679+
return digis[i];
1680+
}
1681+
1682+
if (debug > 1) printf(" Failed to find digipeater by aprx_interface\n");
1683+
return NULL;
1684+
}
1685+
1686+
16751687
static void digipeater_resettime(void *arg)
16761688
{
16771689
struct timeval *tv = (struct timeval *)arg;

interface.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,20 @@ void interface_receive_ax25(const struct aprx_interface *aif,
10071007
if (aif == NULL) return; // Not a real interface for digi use
10081008
if (aif->digisourcecount == 0) {
10091009
if (debug>1) printf("interface_receive_ax25() no receivers for source %s\n",aif->callsign);
1010+
1011+
if (!is_aprs) return;
1012+
if (debug > 1) printf(" Adding to histroydb anyways...");
1013+
struct digipeater *digi = digipeater_find_by_iface(aif);
1014+
if (digi == NULL) return;
1015+
historydb_t *historydb = digi->historydb;
1016+
struct pbuf_t *pb = pbuf_new(is_aprs, digi_like_aprs,
1017+
tnc2addrlen, tnc2buf, tnc2len,
1018+
axaddrlen, axbuf, axlen);
1019+
if (pb == NULL) return;
1020+
pb->source_if_group = aif->ifgroup;
1021+
parse_aprs(pb, historydb);
1022+
historydb_insert_heard(historydb, pb);
1023+
pbuf_put(pb);
10101024
return; // No receivers for this source
10111025
}
10121026

0 commit comments

Comments
 (0)