Address comments from Mark Michelson

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357014 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Sean Bright
2012-02-27 17:03:46 +00:00
parent 1fac2fba4b
commit c20cfcdcf0
2 changed files with 7 additions and 3 deletions

View File

@@ -167,6 +167,11 @@ struct ast_netsock *ast_netsock_bind(struct ast_netsock_list *list, struct io_co
struct ast_sockaddr addr;
if (ast_sockaddr_parse(&addr, bindinfo, 0)) {
if (!ast_sockaddr_is_ipv4(&addr)) {
ast_log(LOG_WARNING, "Only IPv4 addresses are supported at this time.\n");
return NULL;
}
if (!ast_sockaddr_port(&addr)) {
ast_sockaddr_set_port(&addr, defaultport);
}