]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
channels/chan_mgcp: Fix regression which causes gateways to be skipped
authorMatthew Jordan <mjordan@digium.com>
Sun, 9 Nov 2014 00:37:25 +0000 (00:37 +0000)
committerMatthew Jordan <mjordan@digium.com>
Sun, 9 Nov 2014 00:37:25 +0000 (00:37 +0000)
In r227276, a while loop was turned into a for loop. Unfortunately, a portion
of the while loop was left in the code such that, when a static gateway is
encountered in the list of MGCP gateways, the next gateway would be skipped.
At best, we would simply flip past a gateway; at worst, this could lead to a
crash.

ASTERISK-24500 #close
Reported by: Xavier Hienne
patches:
  chan_mgcp.patch uploaded by Xavier Hienne (License 6657)
........

Merged revisions 427613 from http://svn.asterisk.org/svn/asterisk/branches/11

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@427614 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_mgcp.c

index 2d0afe29ded6e29aa23f5f7af796beaebe106689..e1a73d8c1c84e210a83307e34b57671438304a73 100644 (file)
@@ -1809,17 +1809,12 @@ static struct mgcp_subchannel *find_subchannel_and_lock(char *name, int msgid, s
                        /* not dynamic, check if the name matches */
                        } else if (name) {
                                if (strcasecmp(g->name, at)) {
-                                       g = g->next;
                                        continue;
                                }
                        /* not dynamic, no name, check if the addr matches */
                        } else if (!name && sin) {
                                if ((g->addr.sin_addr.s_addr != sin->sin_addr.s_addr) ||
                                    (g->addr.sin_port != sin->sin_port)) {
-                                       if(!g->next)
-                                               g = find_realtime_gw(name, at, sin);
-                                       else
-                                               g = g->next;
                                        continue;
                                }
                        } else {