Changeset 1802

Show
Ignore:
Timestamp:
04/14/07 15:30:11 (21 months ago)
Author:
aturner
Message:

fix compile under strictly aligned systems. make test works fine.
fixes #141

Location:
trunk/src/tcpedit
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/tcpedit/plugins/dlt_plugins-int.h

    r1757 r1802  
    108108    tcpedit_t *tcpedit;                 /* pointer to our tcpedit context */ 
    109109#ifdef FORCE_ALIGN 
    110     u_char *ipbuff;                     /* pointer for L3 buffer on strictly aligned systems */ 
     110    u_char *l3buff;                     /* pointer for L3 buffer on strictly aligned systems */ 
    111111#endif 
    112112    tcpeditdlt_plugin_t *plugins;       /* registered plugins */ 
  • trunk/src/tcpedit/plugins/dlt_plugins.c

    r1758 r1802  
    394394    if (ctx->decoder != NULL) 
    395395        ctx->decoder->plugin_cleanup(ctx); 
    396          
     396 
    397397#ifdef FORCE_ALIGN 
    398398    free(ctx->l3buff); 
  • trunk/src/tcpedit/plugins/dlt_utils.c

    r1758 r1802  
    252252     * we can't edit the packet at layer 3 or above beyond this point 
    253253     */ 
    254      memcpy((&(*packet)[l2len]), l3data, pktlen - l2len); 
     254     memcpy((&(packet)[l2len]), l3data, pktlen - l2len); 
    255255#endif 
    256256    return packet; 
  • trunk/src/tcpedit/tcpedit-int.h

    r1786 r1802  
    4848    char errstr[TCPEDIT_ERRSTR_LEN]; 
    4949    char warnstr[TCPEDIT_ERRSTR_LEN]; 
     50#ifdef FORCE_ALIGN     
     51    u_char *l3buff; 
     52#endif 
    5053}; 
    5154 
  • trunk/src/tcpedit/tcpedit.c

    r1786 r1802  
    232232            pcap_datalink_val_to_name(dlt)); 
    233233 
    234              
    235234#ifdef FORCE_ALIGN 
    236     tcpedit->runtime.ipbuff = (u_char *)safe_malloc(MAXPACKET); 
     235    tcpedit->runtime.l3buff = (u_char *)safe_malloc(MAXPACKET); 
    237236#endif 
    238237 
     
    384383    /* free buffer if required */ 
    385384#ifdef FORCE_ALIGN 
    386     free(tcpedit->runtime.ipbuff); 
     385    free(tcpedit->runtime.l3buff); 
    387386#endif 
    388387