Changeset 1487

Show
Ignore:
Timestamp:
07/08/06 19:43:55 (3 years ago)
Author:
aturner
Message:

fix bus error (can't write to a null ptr) and add debugging
refs #1

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/mac.c

    r1482 r1487  
    118118{ 
    119119    char *tok, *tempstr, *ourstring; 
    120     u_char *tempmac; 
     120    u_char tempmac[6]; 
    121121    int len = 6, ret = CACHE_SECONDARY; 
    122122     
     
    127127       mac2hex(tempstr, tempmac, len); 
    128128       if (memcmp(mac, tempmac, len) == 0) { 
     129           dbgx(3, "Packet matches: " MAC_FORMAT " sending out primary.\n", MAC_STR(tempmac)); 
    129130           ret = CACHE_PRIMARY; 
    130131           goto EXIT_MACINSTRING; 
     
    138139       if (memcmp(mac, tempmac, len) == 0) { 
    139140           ret = CACHE_PRIMARY; 
     141           dbgx(3, "Packet matches: " MAC_FORMAT " sending out primary.\n", MAC_STR(tempmac)); 
    140142           goto EXIT_MACINSTRING; 
    141143       } 
     
    144146EXIT_MACINSTRING: 
    145147    free(ourstring); 
     148#ifdef DEBUG 
     149    if (ret == CACHE_SECONDARY) 
     150       dbg(3, "Packet doesn't match any MAC addresses sending out secondary.\n"); 
     151#endif 
    146152    return ret; 
    147153}