ensure socket address family is copied (bug #4789)
authorKevin P. Fleming <kpfleming@digium.com>
Mon, 25 Jul 2005 17:31:50 +0000 (17:31 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Mon, 25 Jul 2005 17:31:50 +0000 (17:31 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6190 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index d7fe500..20f198f 100755 (executable)
@@ -1639,9 +1639,11 @@ static int create_addr_from_peer(struct sip_pvt *r, struct sip_peer *peer)
        if ((peer->addr.sin_addr.s_addr || peer->defaddr.sin_addr.s_addr) &&
            (!peer->maxms || ((peer->lastms >= 0)  && (peer->lastms <= peer->maxms)))) {
                if (peer->addr.sin_addr.s_addr) {
+                       r->sa.sin_family = peer->addr.sin_family;
                        r->sa.sin_addr = peer->addr.sin_addr;
                        r->sa.sin_port = peer->addr.sin_port;
                } else {
+                       r->sa.sin_family = peer->defaddr.sin_family;
                        r->sa.sin_addr = peer->defaddr.sin_addr;
                        r->sa.sin_port = peer->defaddr.sin_port;
                }