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 841a204..b3ee74e 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 86b32a0..bf69f3a 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 a3bedd9..6a392be 100644 (file)
@@ -779,30 +779,6 @@ autz_redo:
        }
 
        /*
-        *      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)
         */