[OpenSIPS-Devel] Fwd: Remove_hf not working for Via

Patrick Wakano pwakano at gmail.com
Tue Jun 24 17:07:09 CEST 2014


Hello,

Regarding this problem I mentioned in the user list, I found the cause of
the problem but I'm not sure about the correct fix.
Probably this is not the best way to report the problem and correction but
right now it is the easiest one for me. Let me know if I need to create a
Githu user and open an issue there.

The problem of not being able to remove the Via fields happened because of
commit
https://github.com/OpenSIPS/opensips/commit/609c81c8713dd94ab45dbef76599a54dcbee5361
that inserted:
l=del_lump(msg, hf->name.s-msg->buf, hf->len, *hf->type*);
in the place of:
l=del_lump(msg, hf->name.s-msg->buf, hf->len, *0*);
in remove_hf_f() function.

This caused the function free_via_clen_lump() of the TM engine to delete
this lump since now it has the type HDR_VIA_T, when previously it had type
0.

It is possible to add a test in free_via_clen_lump to allow the LUMP_DEL
operation, so the deletion of Via will work, or to keep the old call to
del_lump in the remove_hf functions.
So what's the best choice? Or I will not be allowed to remove the Via
header in any case?
I think the best solution would be to add a LUMP_DEL test in the
free_via_clen_lump(), something like this:
                if (lump->op!=LUMP_DEL &&

(lump->type==HDR_VIA_T||lump->type==HDR_CONTENTLENGTH_T)) {

Thanks,

Patrick





---------- Forwarded message ----------
From: Patrick Wakano <pwakano at gmail.com>
Date: Wed, Jun 18, 2014 at 12:40 PM
Subject: Remove_hf not working for Via
To: OpenSIPS users mailling list <users at lists.opensips.org>


Hello All,

I am making some tests regarding topology hide for non-invite requests and
noticed that since version 1.11.1 the remove_hf function is not working for
Via headers. It was working in version 1.10.1, and from what I could track
this patch https://github.com/OpenSIPS/opensips/issues/219 is causing this
problem. So far I haven't noticed this problem in any other field but
Via....
I know I'm not supposed to remove and insert Via headers on my on since it
may cause problems, but is this a resctriction the patch was meant to do or
a side effect (bug?) of the patch?

Thanks,
Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20140624/c2021c58/attachment.htm>


More information about the Devel mailing list