Skip to content

Update KISSPORT default handling #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update to fix using KISSPORT 0 to fully disable kiss ports
This commit also removes the KISSPORT 0 warning from initial commit
  • Loading branch information
bjpetit committed Apr 26, 2021
commit 2343dd8b8e264c48f9877243c01b73a31ab51e4a
23 changes: 14 additions & 9 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -4535,13 +4535,6 @@ void config_init (char *fname, struct audio_s *p_audio_config,
continue;
}

if (tcp_port == 0) {
// If existing config files have KISSPORT 0, ignore it and move on
text_color_set(DW_COLOR_ERROR);
dw_printf ("Line %d: Warning: KISSPORT 0 setting no longer needed.\n", line);
continue;
}

t = split(NULL,0);
if (t != NULL) {
chan = atoi(t);
Expand All @@ -4552,6 +4545,16 @@ void config_init (char *fname, struct audio_s *p_audio_config,
}
}

// KISSPORT == 0, if slot 0 still unset, disable setting of default
// Use kiss_chan == -2 to indicate default disabled
// Subsequent KISSPORT settings can still overwrite this slot
if (tcp_port == 0) {
if (p_misc_config->kiss_port[0] == 0) {
p_misc_config->kiss_chan[0] = -2; // Don't set default
}
continue;
}

// Try to find an empty slot.
// A duplicate TCP port number will overwrite the previous value.

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

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

} /* end config_init */
Expand Down