[OpenSER-Devel] gflags in version 1.3

T.R. Missner trmissner at bandwidth.com
Thu Sep 13 14:50:43 CEST 2007


The gflags module is not returning the expected results with is_gflag
() using the version of Openser we have installed now.  If I set a 
gflag, for instance 3, when I read back the flags that are set 
multiple flags are showing up.  Using the example 3, anything that 
sets bit one or bit two is returned as being true.

For Example:
gflag 1 is TRUE
gflag 2 is TRUE
gflag 3 is TRUE
gflag 4 is FALSE
gflag 5 is TRUE
gflag 6 is TRUE
gflag 7 is TRUE
gflag 8 is FALSE

The problem appears to be the logic being used in is_gflag().

   return ( (*gflags) & ((unsigned int)(long)flag)) ? 1 : -1;

There appear to be other problems in this module in the set flag 
routine as well.  The documentation states that the argument passed 
in is the bit position you want set in a 32 bit bitmask.  However, it 
appears that the code is OR'ing what you pass in with whatever is 
already there.  Not exactly the same thing at all.

It looks like the only way to use these in the current state of the 
code would be to use the get flags routine and AND that against 
whatever I am looking for.  Checking individual flags will certainly 
not work.

Richard
-- 
------------------------------------------------------------------------
*
T.R. Missner*
/VP Network Engineering/
trmissner at bandwidth.com <mailto:trmissner at bandwidth.com>
4001 Weston Parkway
Cary, NC 27513

919-439-3575
919-297-1101 - Fax 	

-------------- next part --------------
Skipped content of type multipart/related


More information about the Devel mailing list