summaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-09-04 20:35:09 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-09-04 20:35:09 +0000
commit0a838de8adf3b06590e73cff6415275d9b1cd4fe (patch)
tree17d8ef48307d970ad53efb4e9d7f61bf62a6e292 /socket.c
parent4f23b71018c07ced4624481a652a53aa3bfb3f7a (diff)
downloadopenvpn-0a838de8adf3b06590e73cff6415275d9b1cd4fe.tar.gz
openvpn-0a838de8adf3b06590e73cff6415275d9b1cd4fe.tar.xz
openvpn-0a838de8adf3b06590e73cff6415275d9b1cd4fe.zip
Added --allow-pull-fqdn option which allows client to pull DNS names
from server (rather than only IP address) for --ifconfig, --route, and --route-gateway. OpenVPN versions 2.1_rc7 and earlier allowed DNS names for these options to be pulled and translated to IP addresses by default. Now --allow-pull-fqdn will be explicitly required on the client to enable DNS-name-to-IP-address translation of pulled options. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3307 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/socket.c b/socket.c
index a7ed55f..9622637 100644
--- a/socket.c
+++ b/socket.c
@@ -294,6 +294,17 @@ ip_addr_dotted_quad_safe (const char *dotted_quad)
}
}
+bool
+ip_or_dns_addr_safe (const char *dotted_quad, const bool allow_fqdn)
+{
+ if (ip_addr_dotted_quad_safe (dotted_quad))
+ return true;
+ else if (allow_fqdn)
+ return string_class (dotted_quad, CC_NAME|CC_DASH|CC_DOT, 0);
+ else
+ return false;
+}
+
static void
update_remote (const char* host,
struct openvpn_sockaddr *addr,