[OpenSIPS-Devel] [ opensips-Bugs-3485739 ] t_newtran() breaks force_rport() dport in reply

SourceForge.net noreply at sourceforge.net
Wed Feb 22 12:57:39 CET 2012


Bugs item #3485739, was opened at 2012-02-08 06:05
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3485739&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: 1.7.x
Status: Open
>Resolution: Fixed
Priority: 3
Private: No
Submitted By: Walter Doekes (wdoekes)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: t_newtran() breaks force_rport() dport in reply

Initial Comment:
Hi Bogdan et al.,

(I already spoke to bogdan about this about a month ago, and he could reproduce it. I'm filing it now lest I forget.)

The call to t_newtran() causes an early call to init_rb() from tm whichs calls update_sock_struct_from_ip() whichs checks the FL_FORCE_RPORT flag and sets the reply destination port. Ergo, when t_newtran() is called before force_rport(), the response dport is not set to the request sport.

Headers are adjusted properly however:

Example input:
REGISTER ... Via ... 5061;rport <-- good, response to sport
REGISTER ... Via ...:5061 <-- good, response to 5061
REGISTER ... Via ...:5061 and then a force_rport <-- bad, response to 5061 instead of sport

Steps to reproduce:

route
{
        t_newtran();
        force_rport();
        t_reply("403", "Testing");
}

If the Via doesn't have an rport, the t_newtran causes the reply to go to the via-port instead of the source port.

Regards,
Walter Doekes
OSSO B.V.

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2012-02-22 03:56

Message:
Hi Walter,

Spent some time on this, trying to find an easy, automatic and safe fix for
that (something that does not look like an ugly hack). What I came up with
is attached here.

Please test it and let me know if works ok for you.

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3485739&group_id=232389



More information about the Devel mailing list