Make sure it's really a dotted IP (bug #2198)
authorMark Spencer <markster@digium.com>
Sun, 1 Aug 2004 18:26:41 +0000 (18:26 +0000)
committerMark Spencer <markster@digium.com>
Sun, 1 Aug 2004 18:26:41 +0000 (18:26 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3562 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_mgcp.c

index d0d22ed..4073a7e 100755 (executable)
@@ -3417,7 +3417,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
             ast_mutex_init(&gw->msgs_lock);
             strncpy(gw->name, cat, sizeof(gw->name) - 1);
             /* SC: check if the name is numeric ip */
-            if (inet_addr(gw->name) != INADDR_NONE)
+            if ((strchr(gw->name, '.')) && inet_addr(gw->name) != INADDR_NONE)
                 gw->isnamedottedip = 1;
         }
                while(v) {