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