Changeset 147 for trunk

Show
Ignore:
Timestamp:
12/29/10 15:10:44 (12 years ago)
Author:
andreu
Message:

bug correction in DOS detection

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/dataFlowSet.c

    r146 r147  
    7777#endif 
    7878  struct AggCache agCache; 
    79         struct DoSCache dosCache; 
     79  struct DoSCache dosCache; 
     80  dosCache.packets = 1; 
     81  dosCache.bytes = 1; 
     82  dosCache.endTime = 1; 
     83  dosCache.startTime = 1; 
     84  dosCache.sampling = myPtrs->currentRouterPtr->sampled; 
    8085  int bool = 0; /* in IPV4 Agg mode enabled, we need to now if it's an IPv4 */ 
    8186  int isIPv6 = 0; 
     
    14611466          && ((dosCache.bytes)/(dosCache.packets) < RATIO_DOS ) ) { 
    14621467        jdos = 0; 
    1463         while ( ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+jdos))) != NULL ) { 
    1464           posdos = 69*MAX_RULES_PER_FIELD+jdos; 
     1468        posdos = 69*MAX_RULES_PER_FIELD+jdos; 
     1469        while ( ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+posdos))) != NULL ) { 
    14651470          ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+posdos)))->check = 1; 
    14661471          jdos++; 
     1472          posdos = 69*MAX_RULES_PER_FIELD+jdos; 
    14671473        } 
    14681474      } 
     
    14711477          & ((dosCache.bytes)/(dosCache.packets) < RATIO_DOS ) ) { 
    14721478        jdos = 0; 
    1473         while ( ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+jdos))) != NULL ) { 
    1474           posdos = 69*MAX_RULES_PER_FIELD+jdos; 
     1479        posdos = 69*MAX_RULES_PER_FIELD+jdos; 
     1480        while ( ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+posdos))) != NULL ) { 
    14751481          ((RuleDefPtr)(*(myPtrs->rulesAddressPtr+posdos)))->check = 1; 
    14761482          jdos++; 
     1483          posdos = 69*MAX_RULES_PER_FIELD+jdos; 
    14771484        } 
    14781485      } 
    14791486    } 
     1487    dosCache.packets = 1; 
     1488    dosCache.bytes = 1; 
     1489    dosCache.endTime = 1; 
     1490    dosCache.startTime = 1; 
    14801491 
    14811492        /*