Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2343dd8

Browse files
committedApr 26, 2021
Update to fix using KISSPORT 0 to fully disable kiss ports
This commit also removes the KISSPORT 0 warning from initial commit
1 parent eb94921 commit 2343dd8

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed
 

‎src/config.c

+14-9
Original file line numberDiff line numberDiff line change
@@ -4535,13 +4535,6 @@ void config_init (char *fname, struct audio_s *p_audio_config,
45354535
continue;
45364536
}
45374537

4538-
if (tcp_port == 0) {
4539-
// If existing config files have KISSPORT 0, ignore it and move on
4540-
text_color_set(DW_COLOR_ERROR);
4541-
dw_printf ("Line %d: Warning: KISSPORT 0 setting no longer needed.\n", line);
4542-
continue;
4543-
}
4544-
45454538
t = split(NULL,0);
45464539
if (t != NULL) {
45474540
chan = atoi(t);
@@ -4552,6 +4545,16 @@ void config_init (char *fname, struct audio_s *p_audio_config,
45524545
}
45534546
}
45544547

4548+
// KISSPORT == 0, if slot 0 still unset, disable setting of default
4549+
// Use kiss_chan == -2 to indicate default disabled
4550+
// Subsequent KISSPORT settings can still overwrite this slot
4551+
if (tcp_port == 0) {
4552+
if (p_misc_config->kiss_port[0] == 0) {
4553+
p_misc_config->kiss_chan[0] = -2; // Don't set default
4554+
}
4555+
continue;
4556+
}
4557+
45554558
// Try to find an empty slot.
45564559
// A duplicate TCP port number will overwrite the previous value.
45574560

@@ -5352,9 +5355,11 @@ void config_init (char *fname, struct audio_s *p_audio_config,
53525355
p_misc_config->maxv22 = p_misc_config->retry / 3;
53535356
}
53545357

5355-
/* If no kiss port specified, add default to first slot */
5356-
if (p_misc_config->kiss_port[0] == 0) {
5358+
// If no kiss port specified, add default to first slot
5359+
// kiss_chan == -2 in slot 0 means a KISSPORT of 0 was set in config
5360+
if (p_misc_config->kiss_port[0] == 0 && p_misc_config->kiss_chan[0] != -2) {
53575361
p_misc_config->kiss_port[0] = DEFAULT_KISS_PORT;
5362+
p_misc_config->kiss_chan[0] = -1;
53585363
}
53595364

53605365
} /* end config_init */

0 commit comments

Comments
 (0)
Please sign in to comment.