Skip to content

Commit

Permalink
Fix crash on fallback from a prefix-less rule.
Browse files Browse the repository at this point in the history
If a prefix-less (empty prefix) rule matched, do not attempt to do fallback by reducing the len of the prefix.

(cherry picked from commit 6e7495a)
  • Loading branch information
bogdan-iancu committed Jan 5, 2017
1 parent 7fa10e3 commit 54f94aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/drouting/drouting.c
Expand Up @@ -1906,7 +1906,9 @@ static int do_routing(struct sip_msg* msg, dr_group_t *drg, int flags,
/* we are done reading -> unref the data */
lock_stop_read( ref_lock );

if ( flags & DR_PARAM_RULE_FALLBACK ) {
/* prepare data for fallback only if instructed so and if there is
* place for fallback (more rules or shorter prefix are available) */
if ( flags & DR_PARAM_RULE_FALLBACK && (prefix_len!=0 || rule_idx!=0) ) {
if ( !(flags & DR_PARAM_INTERNAL_TRIGGERED) ) {
/* first time ? we need to save some date, to be able to
do the rule fallback later in "next_gw" */
Expand Down

0 comments on commit 54f94aa

Please sign in to comment.