mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-24 07:43:16 -05:00
ITS#7194 fix IPv6 URL detection
This commit is contained in:
parent
348be30259
commit
bb921063e0
3 changed files with 6 additions and 18 deletions
|
|
@ -651,12 +651,8 @@ tlsg_session_chkhost( LDAP *ld, tls_session *session, const char *name_in )
|
|||
}
|
||||
|
||||
#ifdef LDAP_PF_INET6
|
||||
if (name[0] == '[' && strchr(name, ']')) {
|
||||
char *n2 = ldap_strdup(name+1);
|
||||
*strchr(n2, ']') = 0;
|
||||
if (inet_pton(AF_INET6, n2, &addr))
|
||||
ntype = IS_IP6;
|
||||
LDAP_FREE(n2);
|
||||
if (inet_pton(AF_INET6, name, &addr)) {
|
||||
ntype = IS_IP6;
|
||||
} else
|
||||
#endif
|
||||
if ((ptr = strrchr(name, '.')) && isdigit((unsigned char)ptr[1])) {
|
||||
|
|
|
|||
|
|
@ -2694,12 +2694,8 @@ tlsm_session_chkhost( LDAP *ld, tls_session *session, const char *name_in )
|
|||
}
|
||||
|
||||
#ifdef LDAP_PF_INET6
|
||||
if (name[0] == '[' && strchr(name, ']')) {
|
||||
char *n2 = ldap_strdup(name+1);
|
||||
*strchr(n2, ']') = 0;
|
||||
if (inet_pton(AF_INET6, n2, &addr))
|
||||
ntype = IS_IP6;
|
||||
LDAP_FREE(n2);
|
||||
if (inet_pton(AF_INET6, name, &addr)) {
|
||||
ntype = IS_IP6;
|
||||
} else
|
||||
#endif
|
||||
if ((ptr = strrchr(name, '.')) && isdigit((unsigned char)ptr[1])) {
|
||||
|
|
|
|||
|
|
@ -501,12 +501,8 @@ tlso_session_chkhost( LDAP *ld, tls_session *sess, const char *name_in )
|
|||
}
|
||||
|
||||
#ifdef LDAP_PF_INET6
|
||||
if (name[0] == '[' && strchr(name, ']')) {
|
||||
char *n2 = ldap_strdup(name+1);
|
||||
*strchr(n2, ']') = 0;
|
||||
if (inet_pton(AF_INET6, n2, &addr))
|
||||
ntype = IS_IP6;
|
||||
LDAP_FREE(n2);
|
||||
if (inet_pton(AF_INET6, name, &addr)) {
|
||||
ntype = IS_IP6;
|
||||
} else
|
||||
#endif
|
||||
if ((ptr = strrchr(name, '.')) && isdigit((unsigned char)ptr[1])) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue