diff options
Diffstat (limited to 'socket.c')
-rw-r--r-- | socket.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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, |