aboutsummaryrefslogtreecommitdiffstats
path: root/acl.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-23 14:15:59 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-23 14:15:59 +0000
commitdfca19960211143fcbb595725930ab4649c0a450 (patch)
tree43724dbfe33a85d5aecea7e525a5b124d133a6dd /acl.c
parent7fff6f6d5ad1c7173b541a3ff8952560d3fe8873 (diff)
Fix BSD issue (bug #2668)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4065 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'acl.c')
-rwxr-xr-xacl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/acl.c b/acl.c
index 672a7eb7e..935ec808d 100755
--- a/acl.c
+++ b/acl.c
@@ -242,13 +242,12 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
memset(&m_rtmsg, 0, sizeof(m_rtmsg));
m_rtmsg.m_rtm.rtm_type = RTM_GET;
- m_rtmsg.m_rtm.rtm_flags = RTF_UP | RTF_HOST;
m_rtmsg.m_rtm.rtm_version = RTM_VERSION;
ast_mutex_lock(&routeseq_lock);
seq = ++routeseq;
ast_mutex_unlock(&routeseq_lock);
m_rtmsg.m_rtm.rtm_seq = seq;
- m_rtmsg.m_rtm.rtm_addrs = RTA_DST;
+ m_rtmsg.m_rtm.rtm_addrs = RTA_DST | RTA_IFA;
m_rtmsg.m_rtm.rtm_msglen = sizeof(struct rt_msghdr) + sizeof(struct sockaddr_in);
sin = (struct sockaddr_in *)m_rtmsg.m_space;
sin->sin_family = AF_INET;
@@ -268,7 +267,7 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us)
}
do {
l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg));
- } while (l > 0 && (m_rtmsg.m_rtm.rtm_seq != 1 || m_rtmsg.m_rtm.rtm_pid != pid));
+ } while (l > 0 && (m_rtmsg.m_rtm.rtm_seq != seq || m_rtmsg.m_rtm.rtm_pid != pid));
if (l < 0) {
if (errno != EAGAIN)
ast_log(LOG_ERROR, "Error reading from routing socket\n");