[sr-dev] bug in t_pick_branch for FAKED_REPLY?

Jasmin Schnatterbeck js at data-cmr.net
Sat Jun 8 22:38:18 CEST 2013


Hi,

for a local reply (e.g. 408 on request timeout with dns failover) 
t_should_relay_response() and t_pick_branch() is called - which uses

t_reply.c
1190                 rpl = t->uac[b].reply;

to check for FAKED_REPLY in get_prio().

But (that's the problem), this does not work for the 
t_should_relay_response()-run of a local_reply()-branch.

The reason is, that store_reply(), which sets the necessary value:

t_reply.c
1663                 if (rpl==FAKED_REPLY)
1664                         trans->uac[branch].reply=FAKED_REPLY;

is called too late (after t_should_relay_response()):

t_reply.c, within local_reply()
2062         reply_status=t_should_relay_response( t, msg_status, branch,
2063                 &local_store, &local_winner, cancel_data, p_msg );
2064         DBG("DEBUG: local_reply: branch=%d, save=%d, winner=%d\n",
2065                 branch, local_store, local_winner );
2066         if (local_store) {
2067                 if (!store_reply(t, branch, p_msg))

This can lead to miscalculation of branch prio values.

Cheers
Jasmin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5407 bytes
Desc: S/MIME Kryptografische Unterschrift
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20130608/3f0bc35d/attachment.bin>


More information about the sr-dev mailing list