[sr-dev] [kamailio/kamailio] nathelper: fix_nated_sdp added ignoring RFC3605-param if omitted (#2784)

Dmitry Wagin notifications at github.com
Fri Jun 18 16:46:58 CEST 2021


https://github.com/kamailio/kamailio/blob/ecc2cc69b08e797ca954af233c229ed44475ce33/src/modules/nathelper/nathelper.c#L1699

First of all, using `'a=rtcp'` in `replace_sdp_ip()` violates a principle of SoC ([separation of concerns](https://en.wikipedia.org/wiki/Separation_of_concerns)).
Comparsion with 'a=rtcp' should be made at `ki_fix_nated_sdp_ip()`. Issue #2768 is perfect, but merge #2769 is "some word".

The original  #2768 (71441c08970c307e2ce17b2dd292630ea615079c) contain bug with out-of-bound.

Later on (521485c8f25f55cb3045ab2b33232c7026d8527d) it was brought to new problem. Using `linelen` comparsion with `memcmp()` avoids appearing an error while "o=xxx" or "c=ccc" (while linelen is less then 6 chars).

I tried to fix it.

It looks like a duct tape. I get the impression, there's no a code review at the project. I think, that you have look even my fix very superficially. 

You are very quick-tempered, for any criticism you are answer: "_go away_", "_offend_" etc.

P.S. Unfortunately, I didn't have any free time and was unable to review code #2768 prior to commit.
P.P.S. Can you provide a stoplist of words, that [inappropriate?](https://en.wiktionary.org/wiki/dirty_code) for using.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2784#issuecomment-864091701
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20210618/c2737e66/attachment-0001.htm>


More information about the sr-dev mailing list