Call new functions to do DNS lookups
authoraland <aland>
Tue, 19 Apr 2005 23:50:39 +0000 (23:50 +0000)
committeraland <aland>
Tue, 19 Apr 2005 23:50:39 +0000 (23:50 +0000)
src/lib/valuepair.c

index 472aebd..a5b0f1f 100644 (file)
@@ -774,8 +774,17 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value)
                                p = NULL;
                                cs = value;
                        }
-                       vp->lvalue = librad_dodns ? ip_getaddr(cs) :
-                                                   ip_addr(cs);
+                       
+                       {
+                               lrad_ipaddr_t ipaddr;
+
+                               if (ip_hton(cs, AF_INET, &ipaddr) < 0) {
+                                       librad_log("Failed to find IP address for %s", cs);
+                                       return NULL;
+                               }
+
+                               vp->lvalue = ipaddr.ipaddr.ip4addr.s_addr;
+                       }
                        if (s) free(s);
                        vp->length = 4;
                        break;