Re: [PATCH] netfilter: nf_nat_sip: fix RTP/RTCP source port translations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alin,

On Thu, Dec 13, 2018 at 06:36:56AM +0100, Alin Năstac wrote:
> On Thu, Dec 13, 2018 at 2:28 AM Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
[...]
> > I can see in the existing code:
> >
> > #1 do DST manip case: so range.flags, .min_proto and .min_addr are set.
> > #2 In case of paired expectation in place, we overwrite these range fields
> >    again.
> > #3 No override for the _SRC case.
> >
> > If your patch can help disentagle this code a bit by:
> >
> > #1 check for paired expectation, if so do handling, return.
> > #2 check for _SRC manip needed, return.
> > #3 existing _DST manip case.
> 
> DST manip handling is needed at least in one RTP case: on the
> expectation created by the INVITE send from LAN. So you see, I can't
> return from this function just because one manip logic applies, doing
> so will break the case where the applied manip is equivalent to no
> operation.
> 
> > It may be larger patch, but we skip 'range_set_for_snat'?
> 
> What is wrong with using booleans? If you want, I can use range.flags
> for the same purpose (I would have to reset it to 0 after doing DST
> manip), but I thought this would make code reading more difficult.
> Besides, if I would use return in the loop I would have to duplicate
> the spin unlocking within the loop and this will look ugly.

Right. No worries. I was just exploring.

Please, just submit a v2 patch that restricts this to RTP/RCTP and we go.

Thanks!



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux