FS-7499: copy port to where apr keeps it too

This commit is contained in:
Anthony Minessale 2015-01-20 20:20:35 -05:00 committed by Michael Jerris
parent 2983c7e6df
commit 0c56081975
1 changed files with 5 additions and 1 deletions

View File

@ -2002,11 +2002,15 @@ SWITCH_DECLARE(int) switch_cp_addr(switch_sockaddr_t *sa1, switch_sockaddr_t *sa
if (ss1->sa_family != ss2->sa_family) if (ss1->sa_family != ss2->sa_family)
return 0; return 0;
sa1->port = sa2->port;
sa1->family = sa2->family;
switch (ss1->sa_family) { switch (ss1->sa_family) {
case AF_INET: case AF_INET:
s1->sin_addr.s_addr = s2->sin_addr.s_addr; s1->sin_addr.s_addr = s2->sin_addr.s_addr;
s1->sin_port = s2->sin_port; s1->sin_port = s2->sin_port;
return 1; return 1;
case AF_INET6: case AF_INET6:
if (s16->sin6_addr.s6_addr && s26->sin6_addr.s6_addr) { if (s16->sin6_addr.s6_addr && s26->sin6_addr.s6_addr) {