Fixed parsing the nodelist with dotted IP quads behind a flag

This commit is contained in:
Michiel Broek 2006-04-07 19:34:13 +00:00
parent 11492ba908
commit 1c6ff24229
2 changed files with 9 additions and 3 deletions

View File

@ -2,7 +2,9 @@ $Id$
v0.83.18 01-Apr-2006 v0.83.18 01-Apr-2006
Seems a good time to prepare for a stable release. mbselib.a:
Fixed parsing the nodelist when IBN:1.2.3.4 returned the IP
address 1.2.3.4 with port 1.
v0.83.17 27-Mar-2006 - 01-Apr-2006 v0.83.17 27-Mar-2006 - 01-Apr-2006

View File

@ -4,7 +4,7 @@
* Purpose ...............: Read nodelists information * Purpose ...............: Read nodelists information
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2005 * Copyright (C) 1997-2006
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -869,7 +869,11 @@ node *getnlent(faddr *addr)
*r++; *r++;
for (tmps = &nl_service; *tmps; tmps=&((*tmps)->next)) { for (tmps = &nl_service; *tmps; tmps=&((*tmps)->next)) {
if (strncmp(p, (*tmps)->flag, 3) == 0) { if (strncmp(p, (*tmps)->flag, 3) == 0) {
if (atoi(r)) { /*
* Check for format IBN:70.66.52.252 because this is not
* a port number but a dotted IP quad with default port number.
*/
if ((strchr(r, '.') == NULL) && atoi(r)) {
(*tmps)->tmpport = atoi(r); (*tmps)->tmpport = atoi(r);
Syslog('n', "getnlent: port override %s %d to %d", Syslog('n', "getnlent: port override %s %d to %d",
(*tmpm)->name, (*tmps)->defport, (*tmps)->tmpport); (*tmpm)->name, (*tmps)->defport, (*tmps)->tmpport);