+ else if ((strchr(ip_addr, '.')) && (!strchr(ip_addr, ':'))) /* specific IPv4 */
+ {
+ ip_version = 4;
+ if (inet_pton(AF_INET, ip_addr, &sin4.sin_addr) <= 0) {
+ snprintf(errormessage, SIZ,
+ "Error binding to [%s] : %s", ip_addr, strerror(errno)
+ );
+ CtdlLogPrintf(CTDL_ALERT, "%s\n", errormessage);
+ return (-1);
+ }
+ }
+ else /* specific IPv6 */
+ {
+ ip_version = 6;
+ if (inet_pton(AF_INET6, ip_addr, &sin6.sin6_addr) <= 0) {
+ snprintf(errormessage, SIZ,
+ "Error binding to [%s] : %s", ip_addr, strerror(errno)
+ );
+ CtdlLogPrintf(CTDL_ALERT, "%s\n", errormessage);
+ return (-1);
+ }