mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user