summaryrefslogtreecommitdiff
path: root/pbx
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-02-21 16:09:47 -0500
committerSean Bright <sean.bright@gmail.com>2017-02-21 17:10:11 -0600
commit0654bf637cd8f1c31b82e1751d4030299e745452 (patch)
treedb4935e1393a2e5f83154d9dc9259d29f83d5267 /pbx
parentf29ea24d9f1d5771f7a5fe2f0bae51c4bf9a657a (diff)
pbx_dundi: DUNDi weight parameter not processed correctly
The DUNDi weight field is not always converted from network byte order to host byte order. This can result in incorrect weight values and incorrect selection of DUNDi destinations. ASTERISK-18731 #close Reported by: Peter Racz Patches: dundi_weight.patch (license #6290) patch uploaded by Peter Racz Change-Id: Iba3e1a700ff539db57211a7bbc26f7b22ea9a1be
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_dundi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 5ca8a8568..ff4fa3f30 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -994,9 +994,9 @@ static int dundi_prop_precache(struct dundi_transaction *trans, struct dundi_ies
sizeof(trans->parent->dr[trans->parent->respcount].tech));
trans->parent->respcount++;
ast_clear_flag_nonstd(trans->parent->hmd, DUNDI_HINT_DONT_ASK);
- } else if (trans->parent->dr[z].weight > ies->answers[x]->weight) {
+ } else if (trans->parent->dr[z].weight > ntohs(ies->answers[x]->weight)) {
/* Update weight if appropriate */
- trans->parent->dr[z].weight = ies->answers[x]->weight;
+ trans->parent->dr[z].weight = ntohs(ies->answers[x]->weight);
}
} else
ast_log(LOG_NOTICE, "Dropping excessive answers in precache for %s@%s\n",
@@ -1764,9 +1764,9 @@ static int handle_command_response(struct dundi_transaction *trans, struct dundi
sizeof(trans->parent->dr[trans->parent->respcount].tech));
trans->parent->respcount++;
ast_clear_flag_nonstd(trans->parent->hmd, DUNDI_HINT_DONT_ASK);
- } else if (trans->parent->dr[z].weight > ies.answers[x]->weight) {
+ } else if (trans->parent->dr[z].weight > ntohs(ies.answers[x]->weight)) {
/* Update weight if appropriate */
- trans->parent->dr[z].weight = ies.answers[x]->weight;
+ trans->parent->dr[z].weight = ntohs(ies.answers[x]->weight);
}
} else
ast_log(LOG_NOTICE, "Dropping excessive answers to request for %s@%s\n",