#endif
typedef struct attr_flags {
- unsigned int addport : 1; /* add NAS-Port to IP address */
unsigned int has_tag : 1; /* tagged attribute */
unsigned int do_xlat : 1; /* strvalue is dynamic */
unsigned int unknown_attr : 1; /* not in dictionary */
* cannot be resolved, or resolve later!
*/
s = NULL;
- if ((p = strrchr(value, '+')) != NULL && !p[1]) {
- cs = s = strdup(value);
- if (!s) return NULL;
- p = strrchr(s, '+');
- *p = 0;
- vp->flags.addport = 1;
- } else {
- p = NULL;
- cs = value;
- }
+ p = NULL;
+ cs = value;
{
fr_ipaddr_t ipaddr;
}
/*
- * Add the port number to the Framed-IP-Address if
- * vp->addport is set.
- */
- if (((tmp = pairfind(request->reply->vps,
- PW_FRAMED_IP_ADDRESS, 0)) != NULL) &&
- (tmp->flags.addport != 0)) {
- VALUE_PAIR *vpPortId;
-
- /*
- * Find the NAS port ID.
- */
- if ((vpPortId = pairfind(request->packet->vps,
- PW_NAS_PORT, 0)) != NULL) {
- unsigned long tvalue = ntohl(tmp->vp_integer);
- tmp->vp_integer = htonl(tvalue + vpPortId->vp_integer);
- tmp->flags.addport = 0;
- ip_ntoa(tmp->vp_strvalue, tmp->vp_integer);
- } else {
- RDEBUG2("WARNING: No NAS-Port attribute in request. CANNOT return a Framed-IP-Address + NAS-Port.\n");
- pairdelete(&request->reply->vps, PW_FRAMED_IP_ADDRESS, 0);
- }
- }
-
- /*
* Set the reply to Access-Accept, if it hasn't already
* been set to something. (i.e. Access-Challenge)
*/