d2767e5
diff -up openssh-5.3p1/sshconnect2.c.canohost openssh-5.3p1/sshconnect2.c
d2767e5
--- openssh-5.3p1/sshconnect2.c.canohost	2009-03-05 14:58:22.000000000 +0100
d2767e5
+++ openssh-5.3p1/sshconnect2.c	2009-11-02 11:55:00.000000000 +0100
d2767e5
@@ -542,6 +542,12 @@ userauth_gssapi(Authctxt *authctxt)
914284f
 	static u_int mech = 0;
914284f
 	OM_uint32 min;
914284f
 	int ok = 0;
d2767e5
+	char* remotehost = NULL;
d2767e5
+	const char* canonicalhost = get_canonical_hostname(1);
d2767e5
+	if ( strcmp( canonicalhost, "UNKNOWN" )  == 0 )
d2767e5
+		remotehost = authctxt->host;
d2767e5
+	else
d2767e5
+		remotehost = canonicalhost;
914284f
 
914284f
 	/* Try one GSSAPI method at a time, rather than sending them all at
914284f
 	 * once. */
d2767e5
@@ -554,7 +560,7 @@ userauth_gssapi(Authctxt *authctxt)
914284f
 		/* My DER encoding requires length<128 */
914284f
 		if (gss_supported->elements[mech].length < 128 &&
914284f
 		    ssh_gssapi_check_mechanism(&gssctxt, 
914284f
-		    &gss_supported->elements[mech], authctxt->host)) {
914284f
+		    &gss_supported->elements[mech], remotehost)) {
914284f
 			ok = 1; /* Mechanism works */
914284f
 		} else {
914284f
 			mech++;