possible bug in latest argus code

Carter Bullard carter at qosient.com
Mon Oct 15 23:02:26 EDT 2007


Hey Peter,
Well, I have to admit that I'm being lazy here.  The srcint and dstint 
are our
interface index numbers based on what libpcap returns for alldevs.  I was
using -1 as not set, and 0-127 as potential ifIndex numbers.  I could easily
go 1-127, and have uninitialized be 0, but it seemed that 0 should be used
as an index?  I'll go ahead and shift to positive tomorrow.

Carter

Peter Van Epp wrote:
> 	This is on the Power5 SUSE linux box, the Mac (also PPC) doesn't seem
> to complain. Either different gccs or the Power5 thinks chars are unsigned 
> (I seem to remember that is machine dependent, although some certainly have an
>  unsigned char type). Assigning -1 to something unsigned as long as its large
> enough probably isn't illegal, what its saying in this case is that the test
> will never fail because it doesn't think it can go negative I expect. I'll see
> if our HPC folks have seen this before tomorrow.
>
> Peter Van Epp / Operations and Technical Support 
> Simon Fraser University, Burnaby, B.C. Canada
>
> On Mon, Oct 15, 2007 at 08:48:54PM -0400, Carter Bullard wrote:
>   
>> Hey Peter,
>> Thats really weird as srcint is declared as a "char".
>> It doesn't seem to complain when I set flow->srcint = -1 on line 1466.
>>
>> I wonder what is the problem?
>>
>> Carter
>>
>>
>>
>> On Oct 15, 2007, at 6:52 PM, Peter Van Epp wrote:
>>
>>     
>>> 	I expect this is telling me that srcint is unsigned and thus the else
>>> is never used (which may not be correct):
>>>
>>>   if (model->ArgusThisDir) {
>>>      if (flow->srcint >= 0) {
>>>         if (flow->srcint != model->ArgusThisInterface) {
>>>            flow->canon.encaps.hdr.argus_dsrvl8.qual |=  
>>> ARGUS_SRC_INT_CHANGED;
>>>         }
>>>
>>> gcc -g  -Wall -Wmissing-prototypes -Wstrict-prototypes -m64 -fPIC - 
>>> I.  -I./../include  -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" - 
>>> DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT= 
>>> \"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 - 
>>> DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 - 
>>> DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 - 
>>> DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 - 
>>> DHAVE_SYS_FILE_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_SYS_VFS_H=1 - 
>>> DHAVE_VFPRINTF=1 -DHAVE_STRCASECMP=1 -DHAVE_STRDUP=1 - 
>>> DHAVE_STRFTIME=1 -DHAVE_SETLINEBUF=1 -DHAVE_ALARM=1 - 
>>> DHAVE_STRERROR=1 -DHAVE_STRTOF=1 -DHAVE_SYS_BITYPES_H=1 - 
>>> DHAVE_INTTYPES_H=1 -DHAVE_VSNPRINTF=1 -DHAVE_SNPRINTF=1 - 
>>> DHAVE_GETADDRINFO=1 -DHAVE_ETHER_HOSTTON=1 -DHAVE_NETINET_ETHER_H=1  
>>> -DNETINET_ETHER_H_DECLARES_ETHER_HOSTTON= - 
>>> DHAVE_DECL_ETHER_HOSTTON=1 -D_FILE_OFFSET_BITS=64 - 
>>> DHAVE_PCAP_LIST_DATALINKS=1 -DHAVE_PCAP_SET_DATALINK=1 - 
>>> DHAVE_PCAP_DATALINK_NAME_TO_VAL=1 - 
>>> DHAVE_PCAP_DATALINK_VAL_TO_DESCRIPTION=1 -DHAVE_PCAP_BREAKLOOP=1 - 
>>> DHAVE_PCAP_DUMP_FTELL=1 -DHAVE_TCP_WRAPPER=1 -DSTDC_HEADERS=1  - 
>>> DARGUS_SYSLOG=1 -c ArgusModeler.c
>>> ArgusModeler.c: In function bArgusUpdateBasicFlowb:
>>> ArgusModeler.c:1552: warning: comparison is always true due to  
>>> limited range of data type
>>> ArgusModeler.c:1559: warning: comparison is always true due to  
>>> limited range of data type
>>>
>>> Peter Van Epp / Operations and Technical Support
>>> Simon Fraser University, Burnaby, B.C. Canada
>>>
>>>       
>
>   



More information about the argus mailing list