]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: net - Remove is_ipv4_address() and is_ipv6_address()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Tue, 29 Mar 2022 12:20:38 +0000 (15:20 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 14 Apr 2022 11:10:37 +0000 (11:10 +0000)
Nothing is using these anymore.

src/lib/net.c
src/lib/net.h

index c318387cd6f5cb27b1ef45a6f846ba28bd9dd955..981e69095299c9b4d48057e1859ca2c4d799d53d 100644 (file)
@@ -1169,37 +1169,6 @@ const char *net_getservbyport(in_port_t port)
        return entry == NULL ? NULL : entry->s_name;
 }
 
-bool is_ipv4_address(const char *addr)
-{
-       while (*addr != '\0') {
-               if (*addr != '.' && !i_isdigit(*addr))
-                       return FALSE;
-                addr++;
-       }
-
-       return TRUE;
-}
-
-bool is_ipv6_address(const char *addr)
-{
-       bool have_prefix = FALSE;
-
-       if (*addr == '[') {
-               have_prefix = TRUE;
-               addr++;
-       }
-       while (*addr != '\0') {
-               if (*addr != ':' && !i_isxdigit(*addr)) {
-                       if (have_prefix && *addr == ']' && addr[1] == '\0')
-                               break;
-                       return FALSE;
-               }
-                addr++;
-       }
-
-       return TRUE;
-}
-
 int net_parse_range(const char *network, struct ip_addr *ip_r,
                    unsigned int *bits_r)
 {
index 474cf5b432edc39d671399555b8a6a6572ba1187..9d7f768457184e9f7bb4ceb67c021ee76938da09 100644 (file)
@@ -184,9 +184,6 @@ int net_geterror(int fd);
 /* Get name of TCP service */
 const char *net_getservbyport(in_port_t port) ATTR_CONST;
 
-bool is_ipv4_address(const char *addr) ATTR_PURE;
-bool is_ipv6_address(const char *addr) ATTR_PURE;
-
 /* Parse network as ip/bits. Returns 0 if successful, -1 if invalid input. */
 int net_parse_range(const char *network, struct ip_addr *ip_r,
                    unsigned int *bits_r);