Don't send a RAD_NAS_IP_ADDRESS attribute as RAD_NAS_IDENTIFIER is

sufficient.

In fact, using both breaks the radiator RADIUS daemon when used with
a db as it maps both attributes to the same field value and then
fails the insert.

I decided to remove RAD_NAS_IP_ADDRESS on the basis that rfc2138 says:

      An Access-Request MUST contain a User-Name attribute.  It SHOULD
      contain either a NAS-IP-Address attribute or NAS-Identifier
      attribute (or both, although that is not recommended).  It MUST

despite the fact that this not recommended bit was removed from the
updated rfc.
This commit is contained in:
brian 2002-06-02 14:27:02 +00:00
parent b93a81cb4e
commit f1bf75d03d

View File

@ -548,7 +548,9 @@ radius_Authenticate(struct radius *r, struct authinfo *authp, const char *name,
struct timeval tv;
int got;
char hostname[MAXHOSTNAMELEN];
#if 0
struct hostent *hp;
#endif
struct in_addr hostaddr;
#ifndef NODES
struct mschap_response msresp;
@ -671,6 +673,7 @@ radius_Authenticate(struct radius *r, struct authinfo *authp, const char *name,
if (gethostname(hostname, sizeof hostname) != 0)
log_Printf(LogERROR, "rad_put: gethostname(): %s\n", strerror(errno));
else {
#if 0
if ((hp = gethostbyname(hostname)) != NULL) {
hostaddr.s_addr = *(u_long *)hp->h_addr;
if (rad_put_addr(r->cx.rad, RAD_NAS_IP_ADDRESS, hostaddr) != 0) {
@ -680,6 +683,7 @@ radius_Authenticate(struct radius *r, struct authinfo *authp, const char *name,
return 0;
}
}
#endif
if (rad_put_string(r->cx.rad, RAD_NAS_IDENTIFIER, hostname) != 0) {
log_Printf(LogERROR, "rad_put: rad_put_string: %s\n",
rad_strerror(r->cx.rad));
@ -717,7 +721,9 @@ radius_Account(struct radius *r, struct radacct *ac, struct datalink *dl,
struct timeval tv;
int got;
char hostname[MAXHOSTNAMELEN];
#if 0
struct hostent *hp;
#endif
struct in_addr hostaddr;
if (!*r->cfg.file)
@ -786,6 +792,7 @@ radius_Account(struct radius *r, struct radacct *ac, struct datalink *dl,
if (gethostname(hostname, sizeof hostname) != 0)
log_Printf(LogERROR, "rad_put: gethostname(): %s\n", strerror(errno));
else {
#if 0
if ((hp = gethostbyname(hostname)) != NULL) {
hostaddr.s_addr = *(u_long *)hp->h_addr;
if (rad_put_addr(r->cx.rad, RAD_NAS_IP_ADDRESS, hostaddr) != 0) {
@ -795,6 +802,7 @@ radius_Account(struct radius *r, struct radacct *ac, struct datalink *dl,
return;
}
}
#endif
if (rad_put_string(r->cx.rad, RAD_NAS_IDENTIFIER, hostname) != 0) {
log_Printf(LogERROR, "rad_put: rad_put_string: %s\n",
rad_strerror(r->cx.rad));