<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">*** 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-&gt;ipaddr = get_ipaddr(hostnm);
  		strNcpy(c-&gt;nastype, nastype, sizeof(c-&gt;nastype));
  		strNcpy(c-&gt;shortname, shortnm, sizeof(c-&gt;shortname));
! 		strNcpy(c-&gt;longname, ip_hostname(c-&gt;ipaddr),
  			sizeof(c-&gt;longname));
  
  		c-&gt;next = naslist;
  		naslist = c;
--- 1903,1916 ----
  		c-&gt;ipaddr = get_ipaddr(hostnm);
  		strNcpy(c-&gt;nastype, nastype, sizeof(c-&gt;nastype));
  		strNcpy(c-&gt;shortname, shortnm, sizeof(c-&gt;shortname));
! /* start 10/21/99 SGS hack */
!                 if (strcmp(hostnm, "DEFAULT") != 0) {
! 		  strNcpy(c-&gt;longname, ip_hostname(c-&gt;ipaddr),
  			sizeof(c-&gt;longname));
+ 		} else {
+ 		  strNcpy(c-&gt;longname, hostnm, sizeof(hostnm));
+ 		}
+ /* end 10/21/99 SGS hack */
  
  		c-&gt;next = naslist;
  		naslist = c;
***************
*** 1999,2009 ****
  NAS *nas_find(UINT4 ipaddr)
  {
  	NAS *cl;
  
  	for(cl = naslist; cl; cl = cl-&gt;next)
! 		if (ipaddr == cl-&gt;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-&gt;next)
! /* Start SGS 10/21/99 hack for default nas */
!         {
!                 /* break when ip matches OR we hit the default entry */
!                 if (ipaddr == cl-&gt;ipaddr) 
!                         break;
!                 /* if we have a default entry, save value */
!                 if (!strcmp(cl-&gt;longname,"DEFAULT"))
!                         default_found = cl;
!         }
  
+         /* if no match found, but default exists, set return to default */
+         if (!cl &amp;&amp; default_found)
+                 cl = default_found;
+ /* End SGS 10/21/99 hack for default nas */
+ 
  	return cl;
  }
</pre></body></html>