Skip to content

Commit 5a28baf

Browse files
author
ionutrazvanionita
committed
[siptrace]fix proto issues
leave IPPROTO_* format in hep header(which is returned by pipport2su() function) and after setting it use OpenSIPS format for sending(PROTO_UDP)
1 parent ad32566 commit 5a28baf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/siptrace/siptrace.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,8 +1824,7 @@ static int trace_send_hep_duplicate(str *body, str *fromproto, str *fromip,
18241824

18251825

18261826
/* create a temporary proxy*/
1827-
proto = PROTO_UDP;
1828-
p=mk_proxy(&dup_uri->host, (dup_uri->port_no)?dup_uri->port_no:SIP_PORT,proto, 0);
1827+
p=mk_proxy(&dup_uri->host, (dup_uri->port_no)?dup_uri->port_no:SIP_PORT, PROTO_UDP, 0);
18291828
if (p==0){
18301829
LM_ERR("bad host name in uri\n");
18311830
return -1;
@@ -1842,7 +1841,12 @@ static int trace_send_hep_duplicate(str *body, str *fromproto, str *fromip,
18421841
/* Version && proto && length */
18431842
hdr.hp_l = sizeof(struct hep_hdr);
18441843
hdr.hp_v = hep_version;
1844+
1845+
/* set proto to PROTO_UDP after we set the proto in HEP header;
1846+
* in hep header we need standard library format IPPROTO_* which is set by
1847+
* pipport2su() function */
18451848
hdr.hp_p = proto;
1849+
proto = PROTO_UDP;
18461850

18471851
/* AND the last */
18481852
if (from_su.s.sa_family==AF_INET){

0 commit comments

Comments
 (0)