X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=tr%2Ftr_tid.c;h=9d32edcaf307da52af469779587db69b5d0d4f42;hb=b5117dd88f660ee157de3cf96f8fb6d952ac342a;hp=d9acd78039ae0cfbaf876196d888d7024363aaf0;hpb=53e1f89210362e42ea19916e3a031a67ca114bf1;p=trust_router.git diff --git a/tr/tr_tid.c b/tr/tr_tid.c index d9acd78..9d32edc 100644 --- a/tr/tr_tid.c +++ b/tr/tr_tid.c @@ -179,8 +179,8 @@ static void *tr_tids_req_fwd_thread(void *arg) if (-1==(args->fwd_req->conn = tidc_open_connection(tidc, aaa_hostname, - (unsigned int) aaa_port, /* we checked, it's > 0 */ - &(args->fwd_req->gssctx)))) { + aaa_port, + &(args->fwd_req->gssctx)))) { tr_notice("tr_tids_req_fwd_thread: Error in tidc_open_connection."); /* tids_send_err_response(tids, orig_req, "Can't open connection to next hop TIDS"); */ /* TODO: encode reason for failure */ @@ -526,12 +526,19 @@ static int tr_tids_req_handler(TIDS_INSTANCE *tids, &idp_shared); } else { tr_debug("tr_tids_req_handler: route not local."); - aaa_servers = tr_aaa_server_from_name(tmp_ctx, trp_route_get_next_hop(route)); /* cleaned up via talloc */ + aaa_servers = tr_aaa_server_new(tmp_ctx); /* cleaned up via talloc */ if (aaa_servers == NULL) { tr_err("tr_tids_req_handler: error allocating next hop"); retval=-1; goto cleanup; } + tr_aaa_server_set_hostname(aaa_servers, trp_route_dup_next_hop(route)); + if (tr_aaa_server_get_hostname(aaa_servers) == NULL) { + tr_err("tr_tids_req_handler: error allocating next hop"); + retval=-1; + goto cleanup; + } + tr_aaa_server_set_port(aaa_servers, trp_route_get_next_hop_port(route)); idp_shared = 0; }