parse_qc: don't double-add TCPIP* in path

git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@422 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
This commit is contained in:
Heikki Hannikainen 2012-06-07 18:07:05 +00:00
parent 2f984123b1
commit 4dadef2ca9
1 changed files with 5 additions and 1 deletions

View File

@ -524,7 +524,11 @@ int q_process(struct client_t *c, char *new_q, int new_q_size, char *via_start,
}
} else if (originated_by_client) {
/* FROMCALL matches the login */
return snprintf(new_q, new_q_size, ",TCPIP*,qAC,%s", mycall);
/* Add TCPIP* in the end of the path only if it's not there already */
if (pathlen > 7 && strncmp(*path_end-7, ",TCPIP*", 7) == 0)
return snprintf(new_q, new_q_size, ",qAC,%s", mycall);
else
return snprintf(new_q, new_q_size, ",TCPIP*,qAC,%s", mycall);
} else {
/* Append ,qAS,login */
new_q_len = snprintf(new_q, new_q_size, ",qAS,%s", c->username);