From: Alan T. DeKok Date: Tue, 22 Nov 2011 13:44:55 +0000 (+0100) Subject: Removed "addport" functionality. X-Git-Tag: release_3_0_0_beta0~486 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85a524257fbd0c35a160e2c8a2fa5b179491d53a;p=thirdparty%2Ffreeradius-server.git Removed "addport" functionality. It was always a terrible hack. There should be better ways to do it, like actually tracking IP addresses. --- diff --git a/src/include/libradius.h b/src/include/libradius.h index 841a204e00b..b3ee74ec94a 100644 --- a/src/include/libradius.h +++ b/src/include/libradius.h @@ -97,7 +97,6 @@ extern "C" { #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 */ diff --git a/src/lib/valuepair.c b/src/lib/valuepair.c index 86b32a0643f..bf69f3a8f9d 100644 --- a/src/lib/valuepair.c +++ b/src/lib/valuepair.c @@ -991,16 +991,8 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value) * 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; diff --git a/src/main/auth.c b/src/main/auth.c index a3bedd9d336..6a392be2ad4 100644 --- a/src/main/auth.c +++ b/src/main/auth.c @@ -778,30 +778,6 @@ autz_redo: return RLM_MODULE_REJECT; } - /* - * 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)