Hello Kristian,

On 02/19/2014 06:51 PM, Kristian Kielhofner wrote:

It seems that with modparam("nathelper", "ping_nated_only", 0) set my
configuration should work without always also setting nat_bflag (as
that is used in various other places currently).

Seemingly, yes. From nh_timer:

rval = ul.get_all_ucontacts(buf, cblen, (ping_nated_only?ul.nat_flag:0), ((unsigned int)(unsigned long)timer_idx)*natping_interval+iteration,
        natping_processes*natping_interval);

The implication being that if ping_nated_only is < 1, contacts to ping are not filtered by the usrloc NAT flag. It did strike me as interesting that the usrloc API field is called 'nat_flag', but the usrloc modparam is called 'nat_bflag', but usrloc.c clearly reveals that they are one and the same:

   unsigned int  nat_flag;   /*! nat_flag module parameter */
   api->nat_flag   = nat_bflag;

And the filter in get_all_mem_ucontacts() does apply the flags argument:

   if ((c->cflags & flags) != flags)
      continue;

But it seems to me that it might not match if there are any other UL flags set besides the nat_bflag, e.g.

   #define POWPOW (1 << 1)
   #define PINGPONG (1 << 2)

   int flags = 0;

   flags |= PINGPONG;

   if((flags & POWPOW) != POWPOW)
      printf("Problem?\n");

   sasha@tambourine:~$ ./ns
   Problem?

Are there other UL contact flags that could be in use here and breaking this comparison in get_all_mem_ucontacts()?

--
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to