From 9f1136143bad80bbd8222d8cf5856dbe363a61eb Mon Sep 17 00:00:00 2001 From: Matthew Nicholson Date: Wed, 16 Jun 2010 20:34:31 +0000 Subject: Set sin_family to AF_INET when doing lookups, also reset sin_port the first time the ip address changes. (closes issue #17496) Reported by: ManChicken (closes issue #15827) Reported by: DennisD Patches: dnsmgr_15827.patch uploaded by chappell (license 8) Tested by: DennisD, gentlec, damage, wimpy git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270974 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/acl.c | 1 + 1 file changed, 1 insertion(+) (limited to 'main/acl.c') diff --git a/main/acl.c b/main/acl.c index 67c05b03c..caa1d56f0 100644 --- a/main/acl.c +++ b/main/acl.c @@ -387,6 +387,7 @@ int ast_get_ip_or_srv(struct sockaddr_in *sin, const char *value, const char *se } } if ((hp = ast_gethostbyname(value, &ahp))) { + sin->sin_family = hp->h_addrtype; memcpy(&sin->sin_addr, hp->h_addr, sizeof(sin->sin_addr)); } else { ast_log(LOG_WARNING, "Unable to lookup '%s'\n", value); -- cgit v1.2.3