*** files_old.c Thu Oct 28 11:22:07 1999 --- files.c Thu Oct 28 11:19:46 1999 *************** *** 1,4 **** --- 1,10 ---- /* + + 10/21/99 SGS Added hack for a default NAS in the naslist file. When the code + searches for a NAS, it will always match on this name, if found. + Coded so as to avoid constantly creating new accounting directories + for ipass all the time. + * * RADIUS * Remote Authentication Dial In User Service *************** *** 1897,1904 **** c->ipaddr = get_ipaddr(hostnm); strNcpy(c->nastype, nastype, sizeof(c->nastype)); strNcpy(c->shortname, shortnm, sizeof(c->shortname)); ! strNcpy(c->longname, ip_hostname(c->ipaddr), sizeof(c->longname)); c->next = naslist; naslist = c; --- 1903,1916 ---- c->ipaddr = get_ipaddr(hostnm); strNcpy(c->nastype, nastype, sizeof(c->nastype)); strNcpy(c->shortname, shortnm, sizeof(c->shortname)); ! /* start 10/21/99 SGS hack */ ! if (strcmp(hostnm, "DEFAULT") != 0) { ! strNcpy(c->longname, ip_hostname(c->ipaddr), sizeof(c->longname)); + } else { + strNcpy(c->longname, hostnm, sizeof(hostnm)); + } + /* end 10/21/99 SGS hack */ c->next = naslist; naslist = c; *************** *** 1999,2009 **** NAS *nas_find(UINT4 ipaddr) { NAS *cl; for(cl = naslist; cl; cl = cl->next) ! if (ipaddr == cl->ipaddr) ! break; return cl; } --- 2011,2036 ---- NAS *nas_find(UINT4 ipaddr) { NAS *cl; + /* Start SGS 10/21/99 hack for default nas */ + NAS *default_found; + /* End SGS 10/21/99 hack for default nas */ for(cl = naslist; cl; cl = cl->next) ! /* Start SGS 10/21/99 hack for default nas */ ! { ! /* break when ip matches OR we hit the default entry */ ! if (ipaddr == cl->ipaddr) ! break; ! /* if we have a default entry, save value */ ! if (!strcmp(cl->longname,"DEFAULT")) ! default_found = cl; ! } + /* if no match found, but default exists, set return to default */ + if (!cl && default_found) + cl = default_found; + /* End SGS 10/21/99 hack for default nas */ + return cl; }