Skip to content

Commit

Permalink
nathelper Via header for SIP ping over IPv6 needs square brackets
Browse files Browse the repository at this point in the history
(cherry picked from commit 274f103)
  • Loading branch information
oej committed Oct 7, 2015
1 parent b7678a7 commit 74042e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/nathelper/sip_pinger.h
Expand Up @@ -146,7 +146,13 @@ static inline char* build_sipping(str *curi, struct socket_info* s, str *path,
*(p++) = ' ';
append_str( p, curi->s, curi->len);
append_fix( p, " SIP/2.0"CRLF"Via: SIP/2.0/UDP ");
if (s->address.af == AF_INET6) { /* Via header IP is a IPv6 reference */
append_fix( p, "[");
}
append_str( p, s->address_str.s, s->address_str.len);
if (s->address.af == AF_INET6) {
append_fix( p, "]");
}
*(p++) = ':';
append_str( p, s->port_no_str.s, s->port_no_str.len);
if (path->len) {
Expand Down

0 comments on commit 74042e3

Please sign in to comment.