]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Removed "addport" functionality.
authorAlan T. DeKok <aland@freeradius.org>
Tue, 22 Nov 2011 13:44:55 +0000 (14:44 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 22 Nov 2011 13:44:55 +0000 (14:44 +0100)
It was always a terrible hack.  There should be better ways
to do it, like actually tracking IP addresses.

src/include/libradius.h
src/lib/valuepair.c
src/main/auth.c

index 841a204e00bdbd1262cd6f345f5eb93060aff406..b3ee74ec94af1a9b63720dba20926bd73b6650c2 100644 (file)
@@ -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 */
index 86b32a0643f0b7741777a058e1972f8b7d29c5b1..bf69f3a8f9db9092f2e0e977d503fe7b1ddc9c91 100644 (file)
@@ -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;
index a3bedd9d33606af8446ed3527b2e4e7d2be84907..6a392be2ad4c53167958d311b167a9e81270b512 100644 (file)
@@ -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)