*/
static int file_authorize(void *instance, REQUEST *request)
{
- int nas_port = 0;
VALUE_PAIR *namepair;
VALUE_PAIR *request_pairs;
VALUE_PAIR *check_tmp;
name = namepair ? (char *) namepair->strvalue : "NONE";
/*
- * Find the NAS port ID.
- */
- if ((tmp = pairfind(request_pairs, PW_NAS_PORT_ID)) != NULL)
- nas_port = tmp->lvalue;
-
- /*
* Find the entry for the user.
*/
#if defined(WITH_DBM) || defined(WITH_NDBM)
return RLM_MODULE_NOTFOUND;
/*
- * Add the port number to the Framed-IP-Address if
- * vp->addport is set, or if the Add-Port-To-IP-Address
- * pair is present.
- *
- * FIXME: this should not happen here, but
- * after module_authorize in the main code!
- */
- if ((tmp = pairfind(*reply_pairs, PW_FRAMED_IP_ADDRESS)) != NULL) {
- VALUE_PAIR *tmp2;
-
- tmp2 = pairfind(*reply_pairs, PW_ADD_PORT_TO_IP_ADDRESS);
- if (tmp->addport || (tmp2 && tmp2->lvalue)) {
- tmp->lvalue = htonl(ntohl(tmp->lvalue) + nas_port);
- tmp->addport = 0;
- }
- pairdelete(reply_pairs, PW_ADD_PORT_TO_IP_ADDRESS);
- }
-
- /*
* Remove server internal parameters.
*/
pairdelete(reply_pairs, PW_FALL_THROUGH);
pairfree(check_tmp);
- /*
- * Fix dynamic IP address if needed.
- */
- if ((tmp = pairfind(request->reply->vps, PW_ADD_PORT_TO_IP_ADDRESS)) != NULL){
- if (tmp->lvalue != 0) {
- tmp = pairfind(request->reply->vps, PW_FRAMED_IP_ADDRESS);
- if (tmp) {
- /*
- * FIXME: This only works because IP
- * numbers are stored in host order
- * everywhere in this program.
- */
- tmp->lvalue += nas_port;
- }
- }
- pairdelete(request->reply->vps, PW_ADD_PORT_TO_IP_ADDRESS);
- }
-
return RLM_MODULE_OK;
}