2347432
Fall back to TCP on kdc-unresolvable/unreachable errors.  We still have
2347432
to wait for UDP to fail, so this might not be ideal.  RT #5868.
6c3e6bd
6c3e6bd
Index: src/lib/krb5/os/changepw.c
6c3e6bd
===================================================================
6c3e6bd
--- src/lib/krb5/os/changepw.c	(revision 20199)
6c3e6bd
+++ src/lib/krb5/os/changepw.c	(working copy)
6c3e6bd
@@ -251,11 +251,22 @@
6c3e6bd
 				   NULL,
6c3e6bd
 				   NULL
6c3e6bd
 		 ))) {
6c3e6bd
-
6c3e6bd
-	    /*
6c3e6bd
-	     * Here we may want to switch to TCP on some errors.
6c3e6bd
-	     * right?
6c3e6bd
-	     */
6c3e6bd
+	    /* if we're not using a stream socket, and it's an error which
6c3e6bd
+	     * might reasonably be specific to a datagram "connection", try
6c3e6bd
+	     * again with a stream socket */
6c3e6bd
+	    if (!useTcp) {
6c3e6bd
+		switch (code) {
6c3e6bd
+		case KRB5_KDC_UNREACH:
6c3e6bd
+		case KRB5_REALM_CANT_RESOLVE:
6c3e6bd
+		case KRB5KRB_ERR_RESPONSE_TOO_BIG:
6c3e6bd
+		/* should we do this for more result codes than these? */
6c3e6bd
+		    krb5int_free_addrlist (&al);
6c3e6bd
+		    useTcp = 1;
6c3e6bd
+		    continue;
6c3e6bd
+		default:
6c3e6bd
+		    break;
6c3e6bd
+		}
6c3e6bd
+	    }
6c3e6bd
 	    break;
6c3e6bd
 	}
6c3e6bd