diff --git a/lib/krb5/get_for_creds.c b/lib/krb5/get_for_creds.c index 0ae82f510..dbb507b60 100644 --- a/lib/krb5/get_for_creds.c +++ b/lib/krb5/get_for_creds.c @@ -214,12 +214,20 @@ krb5_get_forwarded_creds (krb5_context context, *enc_krb_cred_part.usec = usec; if (auth_context->local_address && auth_context->local_port) { - ret = krb5_make_addrport (context, - &enc_krb_cred_part.s_address, - auth_context->local_address, - auth_context->local_port); - if (ret) - goto out4; + krb5_boolean noaddr; + const krb5_realm *realm; + + realm = krb5_princ_realm(context, out_creds->server); + krb5_appdefault_boolean(context, NULL, *realm, "no-addresses", FALSE, + &noaddr); + if (!noaddr) { + ret = krb5_make_addrport (context, + &enc_krb_cred_part.s_address, + auth_context->local_address, + auth_context->local_port); + if (ret) + goto out4; + } } if (auth_context->remote_address) {