#466 t_newtran() breaks force_rport() dport in reply

1.7.x
closed-fixed
modules (454)
3
2012-02-22
2012-02-08
No

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.

Discussion

  • Walter Doekes

    Walter Doekes - 2012-02-08
    • summary: t_newtran() beaks force_rport() dport in reply --> t_newtran() breaks force_rport() dport in reply
     
  • Bogdan-Andrei Iancu

    • assigned_to: nobody --> bogdan_iancu
     
  • Bogdan-Andrei Iancu

    • priority: 5 --> 3
    • status: open --> open-accepted
     
  • Bogdan-Andrei Iancu

    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

     
  • Bogdan-Andrei Iancu

    fix for force_rport() after t_newtran()

     
  • Bogdan-Andrei Iancu

    • status: open-accepted --> open-fixed
     
  • Bogdan-Andrei Iancu

    • labels: 1134769 --> modules
     
  • Bogdan-Andrei Iancu

    The fix is on SVN.

    Regards,
    Bogdan

     
  • Bogdan-Andrei Iancu

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks